Copy link to clipboard
Copied
Basically I want to share the information that is in a set of arrays (which I certainly could put into a single array of arrays) between several InDesign documents. It seems that the simplest way to do this would involve writing a file containing all the information while in the first document and then reading it back while in the second document. I'm looking for help about how to structure the input/output process and the data and how to move the information back and forth. Thanks in advance for suggestions/solutions.
Hi,
How about using app.insertLabel(key, string) where string is your array.toSource()?
You can call eval(app.extractLabel(key)) to return an array if needed and store it back regardless of which doc(s) is currently in use.
Jarek
Copy link to clipboard
Copied
Hi,
Broadly spoken...
Copy link to clipboard
Copied
I read that as you wanting more details. I have
var array1 = ()
...
var array7 = ()
They have been filled by the script taking user inputs and posting the input parameters in the arrays. The set of values array1 ... array7 defines the i'th preset for the script group. All the arrays are stored within the document where they were defined. I want to be able to use that group of presets while working on another document. I think the best way to do that is to put the group of settings (in other words, the array contents) into a file that can be read into a script (when the second document is open) and placed into that document's information so the presets will be available over there.
Copy link to clipboard
Copied
Hi,
How about using app.insertLabel(key, string) where string is your array.toSource()?
You can call eval(app.extractLabel(key)) to return an array if needed and store it back regardless of which doc(s) is currently in use.
Jarek
Copy link to clipboard
Copied
Thank you! I didn't appreciate that we could do this at the level of the app. That technique is how I have been keeping them within the document. But what could you do if you want to transfer the settings to another computer?
Copy link to clipboard
Copied
Hi,
If various comps (apps) in use -- probably solution could be to store these data in txt files somewhere in network.
So instead of app.insert/extractLabel could be a custom functions savePresets(name, string) and importPresets(name).
Similar logic but using File.read() and File.write() methods.
Jarek