On Apr 30, 2010, at 8:04 AM, Hagimeno wrote: Hi,
after many years of ASS (since the beginning) we need to learn the new ASOC. Is better to learn ASOC or learn Cocoa and interact with apps using AppleScript? We need, like in ASS, create Apps that use much interaction with standard Apps (Photoshop, InDesign...). Is possible using Cocoa to invoke AppleScript? We think yes but this is robust implementation or is complicated? I mean more complicated that do this in ASS or ASOC. There is an example of AS routine invoked by Cocoa app? Just a short example that explain how to pass parameters and how the result are returned to Cocoa app.
--- Alex
I have used KFAppleScript in the past. You can find lots of examples on the web of calling AppleScript from Objective-C using NSAppleScript. There is also ScriptingBridge by Apple and objc-appscript by Hamish Sanderson.
AppleScriptObjC is very easy to use if you understand Objective-C. If I were writing an application to communicate with other applications, such as you are, then I would use ASOC. If I were only needing to use the occasional AppleScript in my application, then I would use Cocoa instead.
IMHO, in your situation, ASOC is definitely the best and easiest way to go.
A few tips. Learn Objective-C Learn Objective-C Learn Objective-C
Once you understand Objective-C, ASOC is simple. If you do not understand Objective-C, then you will struggle and be extremely frustrated with ASOC.
So, why use ASOC at all, you ask? 1. Most of your code is AppleScript. 2. It is incredibly easy to mix AppleScript and Objective-C. 3. You don't have to know as much Objective-C to write quality applications.
I found all the resources I know of on the first page of a Google search for AppleScriptObjC, so I won't list them here.
|