Re: Scriptability of ASObjC Cocoa applications
Re: Scriptability of ASObjC Cocoa applications
- Subject: Re: Scriptability of ASObjC Cocoa applications
- From: Shane Stanley <email@hidden>
- Date: Sat, 16 May 2015 09:45:08 +1000
On 16 May 2015, at 9:14 am, Stan Cleveland <email@hidden> wrote:
>
> In early testing of my new ASObjC-based "Controller", it appears that it is NOT scriptable. Is this indeed true or am I missing something?
No, you're not missing anything -- that huge hole has been closed.
> Is there any way, short of creating terminology with an sdef file, to access the contents of interface elements from outside the app?
Not that I know of -- it's a standard Cocoa app, so you use the standard Cocoa methods for adding scriptability. There's an example in my book. Properties are generally a lot simpler than commands.
As Ron said, you start with the Info.plist, adding an entry for Scriptable set to the boolean YES, and another for 'Scripting definition file name', where you enter a string that will be the name of your .sdef file. Then you write the .sdef. FWIW, I use ASObjC Explorer to build my sdefs -- it doesn't cover everything, but I find it easier to start their and flesh it out manually.
Finally, you write the code -- there are often good reasons to have separate code for scripting commands. (Some of the issues we see scripting apps smell like the .sdef calling code that was written for UI use.)
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden