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

Script to Enable Generator in Photoshop?

New Here ,
Nov 27, 2024 Nov 27, 2024

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! 

TOPICS
Actions and scripting

Views

68

Translate

Translate

Report

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) {
  
...

Votes

Translate

Translate
Adobe
Community Expert ,
Nov 27, 2024 Nov 27, 2024

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.

 

 

Votes

Translate

Translate

Report

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
New Here ,
Nov 27, 2024 Nov 27, 2024

Copy link to clipboard

Copied

LATEST

Amazing! Thank you so much. Works perfectly.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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