| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
|
On 1 Nov 2007, at 8:42 PM, Major Domo wrote:
Did you have a look at the script support of the Sketch sample project? IIRC it has a graphics element and several subtypes. I think that works with subclasses, but that isn't necessary. You can have several elements with the same class, one for each type of medium. There is nothing to implicitly define the filtering as in interpreting "book" as "media whose type is book", so you need to do the filtering in the code, probably in the (scripting) accessors for the different types of elements. If you want to define different applescript types for the different types, to do things like "make new book", I don't think that's possible: different AS classes must be different Cocoa classes (I think). So if you'd want something like that you'd have to make the different types also different Cocoa classes. Also, when you have a fixed number of types, I would use an enumeration for the type rather than a string. It's clearer, prevents abuse and mistyping, and mentions the possible values automatically in the scripting dict. HTH, Christiaan |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-implementors mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-implementors/email@hidden This email sent to email@hidden
| References: | |
| >AppleScript-Cocoa Impedance Mismatch (From: Major Domo <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.