Can I use a variable in a script file path in Adobe Configurator 2.0?

1

I'm building an InDesign panel using Adobe Configurator 2.0. Basically, it provides a button which executes a javascript on click. I added the button by dragging a Script File in my panel and setting its Script File attribute to the desired path, e.g. I:\someFolder\theScript.jsx. This way, I can keep InDesign open and simply modify the script, save it, and press the button again to test it.

In the deployed version of the panel, however, I would like the button to point to a compiled version of the same script, e.g. I:\someOTHERfolder\theScript.jsxbin.

I could simply change the Script File attribute, but I have many of these buttons and it could become quite time consuming. I was kind of hoping I could use variables here, like so:

thePath = "I:\someFolder\"
theExtension = ".jsx"

Now the Script File attribute would become thePath + "theScript" + theExtension and I could change all the paths of all the buttons by simply changing these variables:

thePath = "I:\someOTHERfolder\"
theExtension = ".jsxbin"

Is something like this possible?

Shawn

Posted 2012-05-10T18:40:14.063

Reputation: 1 219

Answers

0

I found a way to do it. Rather than using a Script File, I use a simple Script, which executes a command like this:

app.doScript(File(configurationObject.scriptFolder + "scriptName" + configurationObject.jsExtension), ScriptLanguage.JAVASCRIPT);

The configurationObject is initialized On Panel Initialization with this code:

configurationObject =
{
  "jsExtension": ".jsx",
  "scriptFolder": "I:\\someFolder\\"
}

Shawn

Posted 2012-05-10T18:40:14.063

Reputation: 1 219