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