Re: Cocoa scripting: targeting an app via its bundle identifier

2011-06-26 Thread Andy Lee
On Jun 26, 2011, at 6:09 AM, Bill Cheeseman wrote: > > On Jun 25, 2011, at 7:52 PM, Andy Lee wrote: > >> get application id "com.yourcompany.TrivialScriptable" >> set myApp to result >> tell myApp > > > It has been true since the beginning of time (1993) that you cannot 'tell' a > variable but

Re: Cocoa scripting: targeting an app via its bundle identifier

2011-06-26 Thread Bill Cheeseman
On Jun 25, 2011, at 7:52 PM, Andy Lee wrote: > get application id "com.yourcompany.TrivialScriptable" > set myApp to result > tell myApp It has been true since the beginning of time (1993) that you cannot 'tell' a variable but must instead 'tell' the application, at least in most cases. It's

Re: Cocoa scripting: targeting an app via its bundle identifier

2011-06-25 Thread Jeff Johnson
Glad to hear. And I definitely recommend Neuburg's book. -Jeff On Jun 25, 2011, at 7:54 PM, Andy Lee wrote: > Indeed, that works! And I thought I'd tried that and gotten an error, but my > syntax must have been wrong. > > Many thanks, Jeff. It's such a relief to be able to move on that I won'

Re: Cocoa scripting: targeting an app via its bundle identifier

2011-06-25 Thread Andy Lee
Indeed, that works! And I thought I'd tried that and gotten an error, but my syntax must have been wrong. Many thanks, Jeff. It's such a relief to be able to move on that I won't even bother to dope-slap myself. One of these days I'll read Matt Neuburg's book, but for now... I'll move on. --An

Re: Cocoa scripting: targeting an app via its bundle identifier

2011-06-25 Thread Jeff Johnson
Hi Andy. It seems that the indirection confuses AppleScript, and it doesn't know which dictionary to use. Is there a reason you don't use the following more simple code? tell application id "com.yourcompany.TrivialScriptable" That works better in my testing. -Jeff On Jun 25, 2011, at 6:52 P

Re: Cocoa scripting: targeting an app via its bundle identifier

2011-06-25 Thread Andy Lee
On Jun 25, 2011, at 07:54 PM, Andy Lee wrote: I have a scriptable app I want to write AppleScript that targets the app   That should be: "I have a scriptable app. I want to write AppleScript that targets the app...". --Andy ___ Cocoa-dev mailing lis

Cocoa scripting: targeting an app via its bundle identifier

2011-06-25 Thread Andy Lee
This has been bedeviling me all day. As an AppleScript novice I suspect -- I *hope* -- I'm missing something trivial. I have a scriptable app I want to write AppleScript that targets the app via its bundle identifier rather than its name. But when I do what seems the obvious thing, I get a -17