Search code examples
applescriptapplescript-objcapplescript-studio

Convert applescript to applescript studio


This is my first time here. Anyway I have a question.

I just decided to try using Applescript studio, but currently I have trouble converting my script and linking actions to the GUI. I will provide more info if needed, but I just need to convert an applescript for use in Applescript studio. Is there any specific code I need to inject or something? Thanks.

Running on Mac OS X 10.6.8 Snow Leopard, Xcode 4.2


Solution

  • Using AppleScriptObjC in Xcode, the Interface Editor will use any handler with the right definition as an action method. An action handler takes a single parameter, which means that it has a single trailing underscore in the name - see the AppleScriptObjC Release Notes.

    Once a handler has been declared, it will show up in the Interface Editor and can be connected by dragging from the Connections Inspector to the desired UI object, or by right-clicking on a UI object and dragging from the popup to the desired script class.

    Example projects are a bit scarce, but a couple of resources to bring you up to speed are the introductory tutorials at MacScripter.net, and Shane Stanley's excellent AppleScriptObjC Explored ebook.