Re: OK, so how *do* you create (and expose) an Applescript dictionary to scripters?
Re: OK, so how *do* you create (and expose) an Applescript dictionary to scripters?
- Subject: Re: OK, so how *do* you create (and expose) an Applescript dictionary to scripters?
- From: Christopher Nebel <email@hidden>
- Date: Wed, 23 Jul 2003 13:03:43 -0700
On Wednesday, July 23, 2003, at 4:36 AM, Charles Arthur wrote:
I've seen the phrase used often - about exposing the AS dictionary so
that
scripters can make use of it. (I think most recently by one of the
Johns..
which should be broad enough to be true.)
OK, then, how does one do this with Project Builder etc? Perhaps this
is
the wrong list to ask on (in which case, do redirect me).
Yep. You want applescript-implementors.
For example, I like an app called Egg Timer, whose source is available
at
http://homepage.mac.com/estebanuribe/software/eggtimer.html
But.. it's written in Obj-C. (Or just C++ - how would I know the
difference?)
You have no idea how surreal this question is, do you? It's in
Objective-C. Do you know C++?
Examining it in PBuilder, there's no ApplescriptKit. Fine, so I add
that and compile. Still doesn't create an AS dictionary. What steps
are missing here? ... You're going to tell me it's harder than that,
aren't you?
Gee, how did you guess? It's harder than that. While it's possible to
get a "scriptable" application by linking with AppleScriptKit (and
adding NSAppleScriptEnabled = YES to your Info.plist), all it gets you
is user interface scripting, which is not the recommended way to make
your application scriptable.
Fortunately for you, making a Cocoa application scriptable is
relatively straightforward. If you've learned Objective-C, you've
probably read some stuff about the model-view-controller paradigm.
Making an application scriptable is all about exposing your "model"
layer -- in your case, the Reminder objects -- via scripting. If your
internal model objects map well to what the user thinks are the model
objects, then it's pretty easy. (The more indirect the mapping is, the
harder it gets.) Go read the Cocoa Scripting documentation; when it
comes time to create your dictionary, you might look into sdef (man 5
sdef), which is easier to write than a scriptSuite/scriptTerminology
pair. (Except that there are no decent editors for sdef yet, whereas
for scriptSuite/scriptTerminology you could use Suite Modeler.)
--Chris Nebel
Apple Development Tools
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.