Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I use self-defined terms in main script?



On Jul 2, 2005, at 10:23 AM, Christopher Hickman wrote:

If I have an AppleScript Studio application with some Objective-C classes (let's say in my NSApp subclass), can I write an sdef to be able to use AppleScript terms to call my own ObjC methods in my main AppleScript? ... I was hoping that the answer would be "Yeah, that works automatically," but it seems to be "Maybe, if you get really clever with the build options." Any ideas to make it easy?

It may not be completely automagic, but really, it's not all that hard. I had thought that adding an extra compile flag would work, but it won't, since it wasn't built to understand raw sdefs. However, there's a bootstrapping trick that should work:


1. Build your application with your sdef, but *without* any script using terms from it.
2. Add the self-referential script; you'll need to say 'using terms from application "MyApp"'.


Any time you change the sdef, you'll need to do that extra build step before you can use the terms. File a bug asking for direct support, please -- this seems like something that would be nice to have.


--Chris Nebel AppleScript and Automator Engineering

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
References: 
 >Re: Can I use self-defined terms in main script? (From: Matt Neuburg <email@hidden>)
 >Re: Can I use self-defined terms in main script? (From: Christopher Hickman <email@hidden>)



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.