Skip to content

Instantly share code, notes, and snippets.

View Trevor-'s full-sized avatar

Trevor Trevor-

View GitHub Profile
@Trevor-
Trevor- / CurlAndExecuteInDesign-Remote.jsx
Last active September 21, 2018 06:47
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);
@Trevor-
Trevor- / CurlAndExecuteInDesign-local.jsx
Last active September 21, 2018 06:51
Curls And Executes a remote script in InDesign
////////////////////////////////////////////////////////////
// For InDesign Windows !!!!! //
// See https://forums.adobe.com/message/10632451#10632451 //
// By Trevor http://creative-scripts.com 21 Sep 18 //
////////////////////////////////////////////////////////////
// https://gist.github.com/Trevor-/a5de06d41e28936ad72fe3e348bddd33
var remoteCodeUrl, vbs, appleScript, remoteScript;
@Trevor-
Trevor- / local_script_for_running_remote_script_on_indesign.jsx
Created September 21, 2018 06:06
This will run a remote script on InDesign. It curls the script and then executes it.
////////////////////////////////////////////////////////////
// For InDesign Windows !!!!! //
// See https://forums.adobe.com/message/10632451#10632451 //
// By Trevor http://creative-scripts.com //
////////////////////////////////////////////////////////////
var remoteCodeUrl, vbs, appleScript, remoteScript;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Trevor-
Trevor- / local_mac_script_for_running_remote.jsx
Created September 21, 2018 05:18
This will run a remote script on PhotoShop on the Mac
// See https://forums.adobe.com/message/10632458#10632458
if (app.name !== 'Adobe Photoshop') {
alert('Crash,for Adobe Photoshop only!');
}
var remoteCode = 'https://gist.githubusercontent.com/Trevor-/6a02d8cb49bbfeb9822f061dea300bc1/raw';
// this function is nicked from // https: //forums.adobe.com/thread/2364797
function getSystemCommandStdout(command) {
var stdout = "";
@Trevor-
Trevor- / photoshop_run_remote.jsx
Last active September 21, 2018 05:39
For running remote scripts on photoshop. The link to local part is in the first comment
var testVar = "foo";
var envVar1 = $.getenv("envVar1");
var envVar2 = $.getenv("envVar2");
function blah(bar, baz){
var result = bar + " " + baz;
alert(result);
return result;
}
blah(envVar1, envVar2);
// See https://forums.adobe.com/message/10632451#10632451
@Trevor-
Trevor- / gist:a297b25e270c2e19d3ba12b5406212d9
Last active September 21, 2018 06:11
Demo for running remote scripts on InDesign. Shares vars and arguments with "local" script. See 1st comment for link to "local" script.
var testVar = "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);