Skip to content

Instantly share code, notes, and snippets.

View Trevor-'s full-sized avatar

Trevor Trevor-

View GitHub Profile
@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);
@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- / 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- / 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- / 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- / 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);
var varFromRemote = "foo";
function blah(bar, baz){
var result = bar + " " + baz;
alert(result);
return result;
}
blah(varFromLocal1, varFromLocal2);
// See https://forums.adobe.com/message/10632451#10632451
@Trevor-
Trevor- / LogFactory.squished.jsx
Created July 8, 2019 11:32
Squished version of LogFactory.jsx
// LogFactory.jsx Ver 1 By Trevor 6rd Mar 2017 https://creative-scripts.com/logging-with-a-smile/ Provided 'as is', with no warranty whatsoever. This line may not be removed.
var LogFactory=function(file,write,store,level,defaultStatus,continuing){if(file&&(file.constructor===String||file.constructor===File)){file={file:file};}else if(!file)file={file:{}};write=(file.write!==undefined)?file.write:write;if(write===undefined){write=true;}store=(file.store!==undefined)?file.store||false:store||false;level=(file.level!==undefined)?file.level:level;defaultStatus=(file.defaultStatus!==undefined)?file.defaultStatus:defaultStatus;if(defaultStatus===undefined){defaultStatus='LOG';}continuing=(file.continuing!==undefined)?file.continuing:continuing||false;file=file.file||{};var stack,times,logTime,logPoint,icons,statuses,LOG_LEVEL,LOG_STATUS;stack=[];times=[];logTime=new Date();logPoint='Log Factory Start';icons={"1":"\ud83d\udd50","130":"\ud83d\udd5c","2":"\ud83d\udd51","230":"\ud83d\udd5d","3":"\ud83d\udd52","330":"\
@Trevor-
Trevor- / LogFactory.jsx
Created July 8, 2019 11:36
A Log Factory for Adobe Products
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// LogFactory.jsx //
// Version 1 //
// 1st Published: 6th Mar 2017 //
// Modified: 6th Mar 2017 //
// Copyright © 2017 Trevor https://creative-scripts.com //
// May be used on condition that this comment block is left in
@Trevor-
Trevor- / Thinny Font Finder.jsx
Created July 8, 2019 14:56
Finds thin fonts in InDesign Document
// jshint unused: true, undef: true, evil:true
/* globals app, alert, LocationOptions, UndoModes, ColorSpace, UnitValue,
AutoEnum, MeasurementUnits, AlternateGlyphForms, File, Folder,
ConditionIndicatorMethod, ScriptLanguage, ChangeConditionsModes, Window, exit, $*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////
// InDesign Thin Font Finder Version 1 //
// By Trevor https://creative-scripts.com //
// Created 27th March 2017 Last modified 30th March 2017 //
// See https://creative-scripts.com/indesign-thin-font-finder for explanation, instructions and EULA //