Re: Call Objective-C methods from any script
Re: Call Objective-C methods from any script
- Subject: Re: Call Objective-C methods from any script
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 18 Jan 2005 11:25:29 -0800
On 1/18/05 10:51 AM, "Romy Opena" <email@hidden> wrote:
> After downloading the doc, I am still left hoping to see more
> examples how to use the technique (much like Brian Anderson's plea).
> Are there more leads for the uninitiateds?
Read up on 'call method' in the AppleScript Studio Terminology Reference,
available online through links on the AppleScript page at Apple. It's in the
Application Suite. To understand more about 'of class' vs. 'of object' you'd
need to read up more on Studio and Cocoa. There really aren't that many
shortcuts. if you ever need 'of object', you'd also need to learn about
alloc and init in Cocoa (just the minimal ; you can do a
set someObject to call method "init" of (call method "alloc" of class
"NSWhatever")
set theResult to call method "someMethod:" of someObject with parameters
{"this", "that"}
But you're rarely, if ever, going to be doing this since it would only work
if someObject can exist also in regular AppleScript, which is most
unlikely. Virtually 100% of the time (I can't think of any counter-example
at the moment) you'd be doing something like Daniel demonstrated, using a
class method to do something with built-in system objects or constants, and
then maybe calling another call method that can fetch certain properties of
that object.
To find all the zillions of useful and not so useful (in this context)
Objective C methods that are available to be called, you have to do like
everyone else and read up in the ApplicationKit and Foundation Cocoa
libraries in the Cocoa docs, and a little bit of time figuring out or
learning how to find your way around there and a bit about Objective C.
There are tons of documents available at ADC, and in Developer folder if you
install Xcode Tools. You don't really need to learn Objective C though to
work your way around. But you can't really expect anyway to explain
everything from A to Z in a reply to your question. You're going to have to
spend some time learning if you've never done any Studio. There's also a
separate mailing list for Studio where virtually everyone has been around
the territory.
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden