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

Stop Generator Image Assets

Explorer ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

Hi,

is there any way to stop the Generator "Image Assets".

To activate i use

var desc1 = new ActionDescriptor();

desc1.putString(app.stringIDToTypeID("javaScriptName"), "Bild-Assets");

executeAction(app.stringIDToTypeID('AdobeScriptAutomation Scripts'), desc1, DialogModes.NO);

TOPICS
Actions and scripting

Views

1.7K

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

People's Champ , Nov 23, 2017 Nov 23, 2017

Try universal localized code. I have it working in the russian version ).

var d = new ActionDescriptor();

d.putString( charIDToTypeID( "jsNm" ), localize("$$$/JavaScripts/Generator/ImageAssets/Menu") );

d.putString( charIDToTypeID( "jsMs" ), "undefined" );

executeAction( stringIDToTypeID( "AdobeScriptAutomation Scripts" ), d, DialogModes.NO );

You can also take the code from the one that is executed in the Scripts / generate.jsx file. It seems to work as it should.

start_assets()

function start_assets

...

Votes

Translate

Translate
Adobe
People's Champ ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

Never used this thing. If I correctly understood what you meant, then in the CC2018 you can turn off for the active document in this way (verified):

try {

    var r = new ActionReference(); 

    r.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "generatorSettings" ) ); 

    r.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); 

    var d = executeActionGet(r);   

    var generatorSettings = d.getObjectValue(stringIDToTypeID("generatorSettings"));

    var generator_45_assets = generatorSettings.getObjectValue(stringIDToTypeID("generator_45_assets"));

    var json = generator_45_assets.getString(stringIDToTypeID("json"));

    generator_45_assets.putString(stringIDToTypeID("json"), "{\"enabled\":false}");

    generatorSettings.putObject(stringIDToTypeID("generator_45_assets"), stringIDToTypeID("generator_45_assets"), generator_45_assets);

    var d = new ActionDescriptor();

    d.putReference( charIDToTypeID( "null" ), r );

    d.putObject( charIDToTypeID( "T   " ), charIDToTypeID( "null" ), generatorSettings );

    executeAction( charIDToTypeID( "setd" ), d, DialogModes.NO );

    }

catch(e) { alert(e); }

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
Explorer ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

My goal is to activate and deactivate the generator (Image Assets) from my html panel

File > Generate > Image Assets

The code from the scriptlistener looks like this:

var desc1 = new ActionDescriptor(); 

desc1.putString(app.stringIDToTypeID("javaScriptName"), "Bild-Assets"); 

executeAction(app.stringIDToTypeID('AdobeScriptAutomation Scripts'), desc1, DialogModes.NO); 

But with that I can only activate the generator (Image Assets)

Thank you very much

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
Explorer ,
Nov 23, 2017 Nov 23, 2017

Copy link to clipboard

Copied

Thank you! I have another question, though.

Is it possiblt to start the generator the same way?

With my code, it only works in the german Photoshop version.

Setting the value for generatorSettigns "{\"enabled\":false}" to true only works, once the generator is started.

generator_45_assets.putString(stringIDToTypeID("json"), "{\"enabled\":true}"); 

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 23, 2017 Nov 23, 2017

Copy link to clipboard

Copied

Try universal localized code. I have it working in the russian version ).

var d = new ActionDescriptor();

d.putString( charIDToTypeID( "jsNm" ), localize("$$$/JavaScripts/Generator/ImageAssets/Menu") );

d.putString( charIDToTypeID( "jsMs" ), "undefined" );

executeAction( stringIDToTypeID( "AdobeScriptAutomation Scripts" ), d, DialogModes.NO );

You can also take the code from the one that is executed in the Scripts / generate.jsx file. It seems to work as it should.

start_assets()

function start_assets()

    {

    var pluginName = "generator-assets-dummy-menu";

    try {

        var generatorDesc = new ActionDescriptor();

        generatorDesc.putString (app.stringIDToTypeID ("name"), pluginName);

        var returnDesc = executeAction( app.stringIDToTypeID ("generateAssets"), generatorDesc, DialogModes.NO );

        }

    catch( e ) { 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
Explorer ,
Nov 23, 2017 Nov 23, 2017

Copy link to clipboard

Copied

Thanks a lot!

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
Explorer ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

r-bin,
I have tried your code but it does not stop Generator "Image Assets" for me (As I believe was Joachim_Hiller's question.)  It will only start asset generation.  I am not a pro on Action Manager so I might be missing something basic. 

 

I've tried this exact code in a JS and, as I mentioned, it will TURN ON asset generation but not off...

 

start_assets()

 

function start_assets()

    {

    var pluginName = "generator-assets-dummy-menu";

    try {

        var generatorDesc = new ActionDescriptor();

        generatorDesc.putString (app.stringIDToTypeID ("name"), pluginName);

        var returnDesc = executeAction( app.stringIDToTypeID ("generateAssets"), generatorDesc, DialogModes.NO );

        }

    catch( e ) { alert(); }

    };

 

Many thanks,

 

 

 

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
LEGEND ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

Start means start? 😛 For stop look few posts higher.

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 ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

Can not say anything, especially if you are going to use it in an extension.
Most likely in 2020 the behavior was changed and the script (for stopping) does not work.

Try just turning off the generator.
var d = new ActionDescriptor();
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("pluginPicker"));
r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
d.putReference(stringIDToTypeID("null"), r);
var d1 = new ActionDescriptor();
d1.putBoolean(stringIDToTypeID("generatorEnabled"), false);
d1.putBoolean(stringIDToTypeID("generatorDisabled"), true);
d.putObject(stringIDToTypeID("to"), stringIDToTypeID("pluginPicker"), d1);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
 

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
Explorer ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

LATEST

 r-bin, 

(I obviously copied and pasted the wrong code in my post... Had intended to past the stop code). 

 

Yeah, it appears it something broke it in the 2019 release. It still works on 2018. 

 

Turning off the generator completely will get me through for now. 

 

Thanks!

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