Skip to content

Instantly share code, notes, and snippets.

@MarshySwamp
Last active January 3, 2022 01:24
Show Gist options
  • Save MarshySwamp/eb36460ae2813b6fc47e2d3fec48deb3 to your computer and use it in GitHub Desktop.
Save MarshySwamp/eb36460ae2813b6fc47e2d3fec48deb3 to your computer and use it in GitHub Desktop.
Run a script from another script
// No GUI
$.evalFile(File('~/Desktop/myScript.jsx'));
$.evalFile(File(app.path.fsName + "/Presets/Scripts/Fit Image.jsx"));
// or
$.evalFile(File($.fileName).path + '/myScript.jsx')
// or
// GUI
(function () {
var selectJSX = File.openDialog("Select a JSX file to open", "Select:*.jsx");
if (selectJSX === null) return;
var cleanJSXpath = selectJSX.fsName.toString();
$.evalFile(File(cleanJSXpath));
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment