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

Batch Processing 'Save As' Dialog

New Here ,
Aug 22, 2018 Aug 22, 2018

Copy link to clipboard

Copied

Hi all,

I'm working on a large number of DICOM files that are 200+ layers/frames each (ultrasound clips). I created an action that runs a script which performs a redaction of information on each layer. In the Automate > Batch window, I set the Destination as 'Save and Close' so that I don't need to manually click save everytime. Works like a charm, can get through a good number of ultrasound studies with minimal time.

Problem: there are a few files which are just a single layer (still DICOM, but a still image displaying a measurement on the screen). For some reason, the batch process grinds to a halt after performing the redaction and a 'Save As' dialog comes up asking me to save it. Weird thing is it defaults me to saving it as a .psd rather than a .dcm.

Hoping for some input so that I can run this batch and walk away without having to watch for these troublesome dialog boxes.

I'm running PS Ver 19.0. Let me know if any further info or screenshots are required, kind of new to PS

Thanks

D

Views

2.1K

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

LEGEND , Aug 23, 2018 Aug 23, 2018

The problem isn't your script, its the action you call from it.

You can branch the script if you want:

if(doc.layers.length == 1){

     call action 1

}

else{

     for(){

          call action 2

     }

}

Votes

Translate

Translate
Adobe
LEGEND ,
Aug 23, 2018 Aug 23, 2018

Copy link to clipboard

Copied

You need to create two separate actions and separate the single files. No way around it. Actions cannot accomodate variations, they always use absolute settings "as is" when the action was created, including states of togglke switches such as the one for sequences. Could be that you could combine the two actions inside a parent action using conditional states to differentiate stills from sequences, but that's as good as it usually gets. this stuff is simply too dumb for its own good. If this is a regular requirment, you should look into scripting.

Mylenium

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
New Here ,
Aug 23, 2018 Aug 23, 2018

Copy link to clipboard

Copied

I actually needed to use a script to automate going through all the layers of the multi-layer images and performing the action. I copied it from somewhere online and replaced with my own action names, see below:

var doc = activeDocument;

for(var a = 0; a < doc.layers.length; a++){

doc.activeLayer = doc.layers;

app.doAction("redact", "dicom redaction");

}

any recommendation on how to edit it to make sure the single layer files can be treated like the multi-layer files?

cheers

d

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 ,
Aug 23, 2018 Aug 23, 2018

Copy link to clipboard

Copied

The problem isn't your script, its the action you call from it.

You can branch the script if you want:

if(doc.layers.length == 1){

     call action 1

}

else{

     for(){

          call action 2

     }

}

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
New Here ,
Aug 23, 2018 Aug 23, 2018

Copy link to clipboard

Copied

Thanks for the reply.

The issue I found is that since the single layer images are, as the kids call it, a 'floating layer', it wants to save it as a psd rather than overwrite the original file. It's still weird to me because it still allows me to save as a dcm file if I choose it, it just pops up with a dialog box. I found if I flatten the image I can hit save and it will automatically overwrite the file rather than opening a dialog and defaulting the save as a psd.

My thoughts to fix this are to create another action that includes flattening the image, and then implementing it in a branched script as you said. I'll be close by as my scripting experience is only comprised of copy and pasting...

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 ,
Aug 23, 2018 Aug 23, 2018

Copy link to clipboard

Copied

LATEST

There are multiple ways to do this but a second action then edit the script to call the one you want is the best bet.

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 ,
Aug 23, 2018 Aug 23, 2018

Copy link to clipboard

Copied

Actually, actions can have conditionals. See if you can create a master action that checks your files first and then processes them.

Untitled-2.png

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