Re: scriptable applescript application
Re: scriptable applescript application
- Subject: Re: scriptable applescript application
- From: John Fowler <email@hidden>
- Date: Fri, 19 Mar 2004 08:27:59 -0600
On March 14 I asked:
I want to make my applescript application scriptable. In trying to do
this I tried
tell app "myapp"
testhandler("this message")
end tell
where testhandler was a display dialog handler.
It didn't work.
Is it supposed to work?
Is there a scheme for making applescript apps scriptable?
I got this reply from "boo":
Same question came up on January 30th.
There is a separate mailing list for Studio; perhaps someone there
will know.
In case this question comes up on this list again, here is an
interesting reply I found on the Studio list archive:
While you can't easily make an AppleScript Studio application
scriptable in the normal sense (ie. Dictionary with objects, verbs
etc.) You can still drive some of the functionality by scripting the
user interface.
I've done this as work around by setting NSAppleScriptEnabled to YES
in the Info.plist and then talking to the user interface elements as
follows:
Note: This script function was in another script outside my
AppleScript Studio app called MyApp.
on compareImages(baseImage, testImage)
set PosixbaseImage to (POSIX path of (alias baseImage))
set PosixtestImage to (POSIX path of (alias testImage))
tell application "MyApp"
activate
set the contents of text field "File 1 path" of view "Files Box" of
window "Comparison Window" to PosixbaseImage
set the contents of text field "File 2 path" of view "Files Box" of
window "Comparison Window" to PosixtestImage
tell button named "Compare" of window "Comparison Window" to perform
action
set theResult to the contents of text field "result" of window
"Comparison Window"
if theResult is "These two files are identical." then
quit
return true
else
quit
return false
end if
end tell
end compareImages
Hope that helps.
David Weiss
Hope this helps.
John Fowler
_______________________________________________
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.