Preamble

IdExtenso is the place to go if you want to take your InDesign script to the next level. But this is a framework, and as many frameworks it might intimidate at first.

You may think: “My code is ok, I don't want to install extra stuff, I will gradually fix the issues and improve the functionalities as the requests arise, I can do that!” Sure you can! IdExtenso is not a magic enhancer, it won't translate your code into some ultimate dialect.

Simply consider it a toolbox. Many recurring needs and issues have been already addressed here. And all IdExtenso bricks converge on improving the frame and the robustness of your own script, in whatever InDesign version and system environment. That's the deal.

Now let's move on to concrete things. In this series, I will try to recap and illustrate the migration of a minimal sample script to IdExtenso. From the scratch code to the final product, all stages will be covered. (So you can see for yourself if the task is as insurmountable as you thought at the beginning ;-)


1. Prepare The Core Routine

Before downloading and installing anything, your first exercise is to format your InDesign script as a single function (the usual main routine) being called at the last line of the code. This function achieves the fundamental task. Of course it may have some arguments and many dependencies. In most cases, the “fundamental task” leads in fact to various optional subtasks which depend on the context, the user options, etc. Anyway, we still need something of an entry point, and that entry point is your core routine.

• Give it a name (for example, the name of your project.)

• Document it properly.

• Make sure dependencies are declared before it and invoked from it.

Note. — A “dependency” can be seen as a subcomponent (value, object, routine) and should be thought as a private feature of the core routine. As long as IdExtenso doesn't come into play, you may need to declare these data or references globally. We'll clean that up in a future episode.

• Invoke the core routine at the last line of your script, passing some default settings if needed.

• Test your script in InDesign.

Our Base Example

Given below in its original state is the script that we shall port into IdExtenso. It creates dots—in fact, small circles—on every path point of the selected spline item(s):

Effect of the original script.


It's your turn!


STEP 2