Hi all,
I am ready to start creating collections of handlers that I can reuse. As such, I am interested in the concept of script libraries.
So, I put all of my generic string handlers in a compiled script file called “String Handlers.scpt”.
In a new main script (“test.scpt” saved as a compiled script), I included:
set stringHandlers to (load script file "String Handlers.scpt")
tell stringHandlers
...
set newS to convertCase(s)
...
end tell
This works perfectly when executed within Script Editor. All of my calls to “String Handlers.scpt”'s handlers (e.g., “convertCase”) executed fine.
However, when the “test.scpt” script is called from the iTunes script menu (and thus executed within the iTunes application context), although the “load script” executes fine, the first call to a handler (e.g., “convertCase”) causes a fatal error (“Can’t continue with convertCase”).
Can anyone tell me a more generic way to have reusable code that will also work when called from within an application script menu (e.g., iTunes)?
Due to this and other quirks, I am assuming that applications like iTunes do not yet necessarily support all scripting logic properly.
Regards,
Steve
Mac OS X 10.5.5
AppleScript 2.0.1
iTunes 8.0.1