Re: Snow Leopard osax security and 'run script' with parameters
Re: Snow Leopard osax security and 'run script' with parameters
- Subject: Re: Snow Leopard osax security and 'run script' with parameters
- From: "email@hidden" <email@hidden>
- Date: Tue, 1 Dec 2009 22:34:57 -0800
Scott,
I believe your parameters were being passed to the script, but the problem was something else.
After a little tweaking I could get your script to work, but I think there is a better way.
First, I wouldn't use a run handler, but would load your script as a script object.
See the ASLG for more info and there's lots threads on Script Objects in the archives.
HTH,
ES
-------
tell application "TextEdit"
activate
set docRef to document 1
end tell
set theScript to "on run {X}" & return & "tell app \"TextEdit\" to set text of document 1 to X" & return & "end"
run script theScript with parameters {"This is the simple test."}
set theScript to "on run {X,y}" & return & "tell app \"TextEdit\" to set text of document 1 to X" & return & "end"
tell application "TextEdit" to run script theScript with parameters {"This is the complex test.", docRef}
On Dec 1, 2009, at 9:52pm, Scott Babcock wrote:
>
> tell application "TextEdit"
> activate
> set docRef to document 1
> end tell
>
> set theScript to "on run {X}" & return & "tell app \"TextEdit\" to set text of document 1 to X" & return & "end"
> run script theScript with parameters {"This is the simple test."}
>
> set theScript to "on run {Y, X}" & return & "tell Y to set its text to X" & return & "end"
> tell application "TextEdit" to run script theScript with parameters {docRef, "This is the complex test."}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden