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}");
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(); }
}