Using 2 separate scripts might be more challenging. Maybe someone else could consider that.
You could use AppleScript to drive Illy, or you could use BridgeTalk. You could pass the variables in or save them as environment variables. You could even save them to text files that the second script could read...
Can someone indicate a way to export variables from inDesign and import them in Illustrator?
I'm not sure, but you can try:
$.setenv(key,value) in InDesign
$.getenv(key) in Illy.
Alternatively, you can pass variables into BridgeTalk...
(Not sure if it is worth posting this a month later).
No. Environment variables are not passed from one process to another. They are only passed to child processes. So if you ran an app.doScript() of an applescript "do shell script 'whatever'", then environment vars will be inherited. Or perhaps if you "tell application System Events to open application 'Adobe Illustrator CS4'" or whatnot.
These are not reliable, though,since if Illustrator is already open, the Finder will just front the application that's running and it will not be restarted with a new environment.
The easiest way is writing the state to a file.
fancier is BridgeTalk.
I don't use environment variables, so I wasn't really sure there. Good to know...
Actually I found a way to export everything I need through a text file that I import in another Illustrator script.
Thank you all for the help