Copy link to clipboard
Copied
Hi,
I'm looking to automate enabling the generator in Photoshop through a script.
Does anyone have the code I could pinch?
Thanks so much!
To toggle the checked menu on an open doc:
var idAdobeScriptAutomationspScripts = stringIDToTypeID("AdobeScriptAutomation Scripts");
var desc326 = new ActionDescriptor();
var idjavaScriptName = stringIDToTypeID("javaScriptName");
desc326.putString(idjavaScriptName, """Image Assets""");
executeAction(idAdobeScriptAutomationspScripts, desc326, DialogModes.NO);
app.beep();
Or:
AdobeScriptAutomationScripts("Image Assets");
app.beep();
function AdobeScriptAutomationScripts(javaScriptName) {
...
Copy link to clipboard
Copied
To toggle the checked menu on an open doc:
var idAdobeScriptAutomationspScripts = stringIDToTypeID("AdobeScriptAutomation Scripts");
var desc326 = new ActionDescriptor();
var idjavaScriptName = stringIDToTypeID("javaScriptName");
desc326.putString(idjavaScriptName, """Image Assets""");
executeAction(idAdobeScriptAutomationspScripts, desc326, DialogModes.NO);
app.beep();
Or:
AdobeScriptAutomationScripts("Image Assets");
app.beep();
function AdobeScriptAutomationScripts(javaScriptName) {
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
descriptor.putString(s2t("javaScriptName"), javaScriptName);
executeAction(s2t("AdobeScriptAutomation Scripts"), descriptor, DialogModes.NO);
}
Or:
$.evalFile(File(app.path + '/Presets/Scripts/generate.jsx'));
app.beep();
Feel free to remove the beep, it's just there to let you know that something happened, it could as well have been an alert.
Copy link to clipboard
Copied
Amazing! Thank you so much. Works perfectly.
Copy link to clipboard
Copied