• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: scriptable applescript application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: do shell script and prompts
  • Next by Date: Re: Hat bug.
  • Previous by thread: Re: scriptable applescript application
  • Next by thread: Sending data direct to USB in OSX
  • Index(es):
    • Date
    • Thread