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

Batch processing with a re-save Script

Explorer ,
Nov 01, 2009 Nov 01, 2009

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

}

TOPICS
Actions and scripting
1.1K
Translate
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
Adobe
Guru ,
Nov 01, 2009 Nov 01, 2009

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.

Translate
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 01, 2009 Nov 01, 2009

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.

Translate
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
Valorous Hero ,
Nov 01, 2009 Nov 01, 2009

Add this line to the top of your script and try again from Bridge..

app.displayDialogs = DialogModes.NO;

Translate
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 02, 2009 Nov 02, 2009
LATEST

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

Translate
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
Guru ,
Nov 01, 2009 Nov 01, 2009

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.

Translate
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