Copy link to clipboard
Copied
i have a script that i use to re-save a master file that may or may not have many layers, channels and/or paths. when i have the master file open, i run the script and it flattens the image, deletes all the channels and paths, and then does a "save as" step saving the file as a tiff with lzw compression. this all takes place without any user input or dialogs. the script is copied at the bottom for reference. i have made an action out of this script and it works fine everytime. the problem is that when i try to batch process multiple file with this action, it seems that regardless of which options i choose in the batch processing window for saving (e.g. "none", save and close", etc.), the action is interrupted with the usual "save as" dialog window and even though lzw is specified in the script, i also have to manually select this option in the dialog. does anyone know how to accomplish what i am trying to do (batch "save as" with lzw compression to files that are saved as uncompresseed tiffs) without having to stop for any dialogs? please help!!!! thanks.
johnh h.
_____________________________________________
if(documents.length){
var saveFile = new File(activeDocument.fullName.fsName);
SaveTIFF(saveFile);
}
function SaveTIFF(saveFile){
tiffSaveOptions = new TiffSaveOptions();
tiffSaveOptions.embedColorProfile = true;
tiffSaveOptions.alphaChannels = true;
tiffSaveOptions.byteOrder = ByteOrder.IBM;
tiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW;
activeDocument.saveAs(saveFile, tiffSaveOptions, false, Extension.LOWERCASE);
activeDocument.close();
}
Copy link to clipboard
Copied
There must be some other part of the script/action or perhaps with the images that is causing the dialog.
If I make an action that calls the script you posted and batch that action with 'None' as the destination it runs for me without any dialogs.
Copy link to clipboard
Copied
hey michael,
your reply made me curious to try something i hadn't tried before which was to run the "batch" processing from within photoshop and to my surprise it worked. however if i repeat the exact same thing from within bridge (although in bridge i am selecting multiple files instead of the enclosing folder) it runs into the same problem. so you have 1/2 solved my problem. did you actually get it to run properly from bridge (bridge/tools/photoshop/batch) or did you run it from within photoshop itself? please let me know... i am very curious to detmine the source of the problem. thanks. i appreciate the help.
Copy link to clipboard
Copied
Add this line to the top of your script and try again from Bridge..
app.displayDialogs = DialogModes.NO;
Copy link to clipboard
Copied
thanks! that did the trick.
do you know if that is a bug in bridge or is there a good reason why it doesn't operate the same way in both application? just curious....
Copy link to clipboard
Copied
I didn't know that you were running the batch from Bridge. I used Photoshop.
If you add the line Paul posted it will run from Brdige as well without the dialog.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now