Re: SmartSet
Re: SmartSet
- Subject: Re: SmartSet
- From: Shane Stanley <email@hidden>
- Date: Thu, 19 Dec 2013 12:10:35 +1100
On 19 Dec 2013, at 11:47 AM, Paul Berkowitz <email@hidden> wrote:
> I'm curious why you use this empty BaseObject top-level script object, while in your Everyday AppleScriptObjC book, for the Archiver (chapter 23) you used a top-level script that had some properties and a couple of its own handlers as the parent, then used a standard construction handler to build archivers from that more-complete script object.
>
> Is there some reason why and when you'd do it one way (BaseObject) rather than the other (top-level script object with properties and handlers)?
As the police are wont to say, new information has come to light ;-)
If the top-level script object has properties, they are shared by child objects. That means you have problems if you want to have multiple instances of the object. In the archiver case, you only ever want a single instance, so that's fine. But you might well want to have multiple SmartSet instances. Consider SmartSet an addendum.
> I can't say I'm even clear on why you need a top-level script object rather than just incorporating one in a handler but it seems that's needed? Hence the empty BaseObject.
There has to be a top-level object because that's essential to how AppleScript checks to see if AppleScriptObjC should be enabled.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
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
References: | |
| >Re: SmartSet (From: Paul Berkowitz <email@hidden>) |