Skip to content

Instantly share code, notes, and snippets.

@Trevor-
Last active September 21, 2018 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Trevor-/55297356e5728f57c2225df16a8e8b0e to your computer and use it in GitHub Desktop.
Save Trevor-/55297356e5728f57c2225df16a8e8b0e to your computer and use it in GitHub Desktop.
Demo for running remote scripts on InDesign. Shares vars and arguments with "local" script. See 1st comment for link to "local" script.
////////////////////////////////////////////////////////////////////////////////////////
// For InDesign but can easily be adapter for some other apps //
// Show methods of sharing vars etc. between local and remote scripts //
// By Trevor http://creative-scripts.com 21 Sep 18 //
// This is the "remote" script //
// The "local" is at https://gist.github.com/Trevor-/a5de06d41e28936ad72fe3e348bddd33 //
////////////////////////////////////////////////////////////////////////////////////////
// "aVarFromLocalToRemote" is set in the "local" script
alert("Got " + aVarFromLocalToRemote);
var aVarFromRemoteToLocal = "Trevor - http://creative-scripts.com";
var scriptArg1 = app.scriptArgs.getValue("scriptArg1");
var envVar1 = $.getenv("envVar1");
function blah(bar, baz){
var result = bar + " " + baz;
alert(result);
return result;
}
blah(scriptArg1, envVar1);
@Trevor-
Copy link
Author

Trevor- commented Sep 21, 2018

This is the remote script for InDesign.
The "local" script for Mac / Windows is here
See the annotations there for adapting as per needs.
See https://forums.adobe.com/message/10632451#10632451 for background.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment