Skip to main content
Participant
August 23, 2018
Answered

Batch Processing 'Save As' Dialog

  • August 23, 2018
  • 2 replies
  • 3022 views

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

    This topic has been closed for replies.
    Correct answer Lumigraphics

    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

         }

    }

    2 replies

    Legend
    August 23, 2018

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

    Mylenium
    Legend
    August 23, 2018

    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

    Participant
    August 23, 2018

    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

    LumigraphicsCorrect answer
    Legend
    August 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

         }

    }