• 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: Script Objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script Objects


  • Subject: Re: Script Objects
  • From: has <email@hidden>
  • Date: Tue, 19 Jan 2010 21:38:47 +0000

Luther Fuller wrote:

> Last week, I was invited to talk to some Cocoa programmers about AppleScript. I don't know Cocoa, they don't know AppleScript. One of them is very interested and we are in an email discussion about AppleScript. He insists on writing everything as a script object because, as he explained, they look familiar since they contain "data and methods".
>
> I've never written a script object and I'm not familiar with "data and methods", so I'm not sure what he's getting at, but he is beginning to make some sense.
>
> Which brings me to my question ...
> What can I do with script objects that I absolutely could not do without them?
> (Or, should I continue to ignore them?)

Script objects are an essential part of AppleScriptObjC development, of course. Apart from that, there's nothing you _can't_ do without script objects; however, they do make certain tasks much easier. The two major uses are libraries and object-oriented programming, both of which are powerful tools for organizing large or complex code.

Libraries make it easy to reuse general-purpose handlers from script to script without having to copy and paste them each time - a common source of code clutter and a maintenance headache whenever you have to change something.

OOP allows you to parcel up complex data structures with the handlers that manipulate them, making them simpler to work with and cutting down the number of 'moving parts' in your code that you need to think about at any one time.

(I'll have a lot more to say on these subjects in a couple of months, so watch this space, etc.)

HTH

has

--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Script Objects
  • Next by Date: Re: Script Objects
  • Previous by thread: Re: Script Objects
  • Next by thread: Resize applescript windo
  • Index(es):
    • Date
    • Thread