• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OK, so how *do* you create (and expose) an Applescript dictionary to scripters?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: OK, so how *do* you create (and expose) an Applescript dictionary to scripters?
      • From: "Charles Arthur, UKClimbing Editor" <email@hidden>
References: 
 >OK, so how *do* you create (and expose) an Applescript dictionary to scripters? (From: Charles Arthur <email@hidden>)

  • Prev by Date: Re:Set View Options script problem
  • Next by Date: Probe Menu Bar.applescript
  • Previous by thread: OK, so how *do* you create (and expose) an Applescript dictionary to scripters?
  • Next by thread: Re: OK, so how *do* you create (and expose) an Applescript dictionary to scripters?
  • Index(es):
    • Date
    • Thread