Posts filed under 'Scripting Tips'

Yet Another Geek Alert

If you are an InDesign scripter, you may find this interesting.

When I create scripted extensions, I always break things up into files that make things manageable. A large project for me might contain 200 script files. Rather than try to stuff it all into a single script for delivery, I came up with a template that I use for just about all my InDesign scripting projects that makes this about as easy as it can be. This concept really only applies when a script will reside in a persistent (named) scripting engine and adds menus to the InDesign menu bar and/or context menu.

I have made the template available in the Free Stuff page of this site, so go ahead and download it.

When you unzip it, it creates a folder. Inside that folder is “startup scripts” that contains one jsx, “loader.jsx”. That file loads the entire extension. It recursively looks through all the folders and loads the entire project into the named scripting engine for you.

There’s a “resources” folder. It contains things, like images, that are not jsx files. The loader script does not load anything in the resources folder. As another freebie, I put some ESTK extensions in this folder. There’s a PDF that describes how to install and use them. One of those extensions does a batch conversion to jsxbin. It places all of the scripts into a “bin” folder except those in the “startup scripts” and “jsx” folder. The loader script that creates the names engine can not be a jsxbin. Files in the jsx folder are those script files which should not be converted to jsxbin (basically any class definition that might be serialized and deserialized using toSource()).

When you convert a project to binary for delivery, the loader script contains a flag, “loadBinary”. If you set that flag to “true”, it will load the binary files. You then remove the jsx’s to hide your source code, and yer’ done.

Just to be clear – use the tempate (it has examples of menu creation, context menu creation, and some handy libraries), complete and test the project, convert it to binary (one step), remove the jsx files (other than those in the jsx folder), set the loader’s loadBinary to “true”, and you are ready to ship projects that are arbitrarily huge.


Add comment August 3rd, 2009

Another Handy Flex Project

Free stuff now includes a Flex project for receiving APID events in PatchPanel

Continue Reading Add comment July 31st, 2009

Added some new free stuff

Just that you gotta be a geek to appreciate it.

I’ve added a Flex project to the free stuff page. This was in response to a posting on the Patchpanel forums (Adobe Labs). The poster wanted to react to InDesign events in ActionScript. This Flex project shows you how to do it (and yes, it’s in a persistent scripting engine that is launched by InDesign at startup.

Add comment July 29th, 2009

My Way

How to make a complex InDesign scripting project easier to edit and manage. This is the way I do it, and it’s been working really well for me.

Continue Reading Add comment February 16th, 2009


December 2022
« Sep    

Posts by Month

Posts by Category