Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script to Enable Generator in Photoshop?

Community Beginner ,
Nov 27, 2024 Nov 27, 2024

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! 

TOPICS
Actions and scripting
364
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 27, 2024 Nov 27, 2024

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) {
  
...
Translate
Adobe
Community Expert ,
Nov 27, 2024 Nov 27, 2024

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.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 27, 2024 Nov 27, 2024
LATEST

Amazing! Thank you so much. Works perfectly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Nov 27, 2024 Nov 27, 2024
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines