Re: Executing embedded script with parameters (was: QuarkXPress 6 Spread Finder)
Re: Executing embedded script with parameters (was: QuarkXPress 6 Spread Finder)
- Subject: Re: Executing embedded script with parameters (was: QuarkXPress 6 Spread Finder)
- From: Hans Haesler <email@hidden>
- Date: Thu, 8 Jul 2004 12:18:16 +0200
On Thu, 8 Jul 2004, Thomas Engelmeier wrote:
>
That looks as if might also cure some coercion handler problems if
>
XPress 6 and XPress {Pre Carbon} are running simulatanous. But how
>
can I pass parameters?
>
>
I need something like:
>
>
tell application "QuarkXPress"
>
if not (exists document 1) then error "No document is open."
>
set selection to null
>
do script {do someThing "hello " "world"}
>
end tell
>
>
script doSomething
>
on run text1, text2
>
tell document 1 of application "QuarkXPress"
>
set content of first box whose name is "foo" to text1
>
end tell
>
end on
>
end -- script
>
--
Hello Thomas,
you need to set variables to your strings and to declare them as 'global':
---
global text1
global text2
tell application "QuarkXPress 6.1"
activate
if not (exists document 1) then error "No document is open."
set selection to null
set text1 to "hello "
set text2 to "world"
do script {doSomeThing}
end tell
script doSomeThing
tell document 1 of application "QuarkXPress 6.1"
tell text box "foo"
set text 1 to text1
end tell
end tell
end script
---
No need for saying "...first box whose name..." because QXP 6.1
addresses only the first box -- even if more than are name the same.
Regards,
Hans
---
Hans Haesler <email@hidden>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.