Copy link to clipboard
Copied
var saveDialog = new ActionDescriptor();
saveDialog.putBoolean(stringIDToTypeID("saveAs"), true);
saveDialog.putString(stringIDToTypeID("as"), "TIFF");
executeAction(stringIDToTypeID("save"), saveDialog, DialogModes.ALL);
I need help, is it possible to open the save as dialog in a predefined folder? i have a variable directoryPath with the path in which save as should open. but i have not found a working solution 😞 can anyone help me 🙏
How so? Both work for me when I change ~/Desktop to say ~/Documents.
By @Stephen Marsh
\
Copy link to clipboard
Copied
I'm not very good with AM code.
Here is the raw SL recording:
var idsave = stringIDToTypeID( "save" );
var desc9 = new ActionDescriptor();
var idas = stringIDToTypeID( "as" );
var desc10 = new ActionDescriptor();
var idbyteOrder = stringIDToTypeID( "byteOrder" );
var idplatform = stringIDToTypeID( "platform" );
var idIBMPC = stringIDToTypeID( "IBMPC" );
desc10.putEnumerated( idbyteOrder, idplatform, idIBMPC );
var idsaveTransparency = stringIDToTypeID( "saveTransparency" );
desc10.putBoolean( idsaveTransparency, true );
var idTIFF = stringIDToTypeID( "TIFF" );
desc9.putObject( idas, idTIFF, desc10 );
var idin = stringIDToTypeID( "in" );
desc9.putPath( idin, new File( "~/Documents/myFile.tif" ) );
var iddocumentID = stringIDToTypeID( "documentID" );
desc9.putInteger( iddocumentID, 862 );
var idlowerCase = stringIDToTypeID( "lowerCase" );
desc9.putBoolean( idlowerCase, true );
var idsaveStage = stringIDToTypeID( "saveStage" );
var idsaveStageType = stringIDToTypeID( "saveStageType" );
var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
desc9.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
executeAction(idsave, desc9, DialogModes.NO);
I started hacking at it:
var desc9 = new ActionDescriptor();
var idas = stringIDToTypeID("as");
desc9.putPath(stringIDToTypeID("in"), new File("~/Documents/"));
var idlowerCase = stringIDToTypeID("lowerCase");
desc9.putBoolean(idlowerCase, true);
executeAction(stringIDToTypeID("save"), desc9, DialogModes.ALL);
Hope this helps!
Copy link to clipboard
Copied
Thank you very much! But unfortunately that doesn't work either 😞
Copy link to clipboard
Copied
Thank you very much! But unfortunately that doesn't work either 😞
By @Innotex Nico Tanne
How so? Both work for me when I change ~/Desktop to say ~/Documents.
As @Lumigraphics wrote, this can be done with standard DOM code which is more accessible as you will find more examples and people who know DOM vs AM coding.
Copy link to clipboard
Copied
How so? Both work for me when I change ~/Desktop to say ~/Documents.
By @Stephen Marsh
\
Copy link to clipboard
Copied
Thank you so much! I
changed the code to save Tiff and now all works fine 👍🙏
Copy link to clipboard
Copied
I originally tested the code I posted on a Mac, which works correctly. I just tested in Windows and it doesn't work.
Copy link to clipboard
Copied
Why use AM code for this? What you want can be done with regular ScriptUI.
Copy link to clipboard
Copied
do you have an example for me? I want to save a tif to a defined Path with all dialogs and not as a copy.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now