Skip to main content
March 1, 2012
Answered

Load default/preset values from external file?

  • March 1, 2012
  • 1 reply
  • 799 views

Hello all,

I have several Illustrator JavaScripts that I've written with the ESTK.

A lot of these scripts involve resizing the artboard or artwork to specific sizes.

Instead of forcing the user to manually input the dimensions they want into text fields, I just stored a half-dozen or so "presets" in an array.

Then they can select one of the presets from a dropdownlist, or go ahead and input a custom size.

These presets are the same for multiple "resize" scripts, so it would be nice to store those presets in a separate file (i.e. presets.jsx) that my resize scripts could reference, so when I need to add or change a preset, I could just go to that one shared file, and all the scripts would be updated.

Is it possible to do that?

If it is, a quick example of how to load the variables from another file would be helpful, thanks!

This topic has been closed for replies.
Correct answer Muppet Mark

The toolkit allows for modular scripting with:

#include file

#includepath path

Allows you to use common functions etc.

But you could probably just do this with plain old read and write file…

1 reply

Muppet MarkCorrect answer
Inspiring
March 1, 2012

The toolkit allows for modular scripting with:

#include file

#includepath path

Allows you to use common functions etc.

But you could probably just do this with plain old read and write file…