Modular scripting - howto
Hi,
I'm having a hard time trying to implement a modular scripting approach in JS. I hope there's someone out there to guide me.
Basically, I want a set of my scripts to share a library of my own functions. What I'm trying is to make use of the #targetengine "session" statement, which is referred to in InD and Ai guides as the one to persist for an app session. And that's what I want to do: put my library in the startup scripts folder so that it loads first, and then any time user launches a tool script of my suite, it would benefit from a set of functions residing in the script engine.
The snippets from the Adobe pdfs however do not work. I'm getting "Cannot execute script in the 'session' engine" alerts.
I checked it with both Illustrator CS3 and InDesign CS3 (which are said to support #targetengine), with same poor result.
I tried also a snippet for declaring an engine (#engine library) found in the JS Tools pdf. This in turn won't compile, claiming an illegal use of reserved word 'export'.
Anyone got a clue what I'm doing wrong?
regards,
Moniuch