Skip to main content
Inspiring
August 14, 2023
Answered

Batch Processing for a Print action of multiple files has annoying "The command “Print” is not curr

  • August 14, 2023
  • 2 replies
  • 574 views

I want to batch Automate/Batch print all the files in a folder.

I create an action that specifies print requirements using the Photoshop Print Dialog and end the action with Close.

I can navigate the Batch dialog and select proper action and point to the folder that contains the files I wish to print.  When I run the Batch I get for each of the files the following alert:

"The command “Print” is not currently available."

I just click on the CONTINUE button and each file and the folder successfully is sent to the destination printer and enters the Print Que.

I would like to find a solution that allows all the files to be processed without having to click on CONTINUE for each file.

I have attached a screen shot of the action was created by recording the click path .

 

This topic has been closed for replies.
Correct answer Stephen Marsh

I have successfully tested the following script, no warning dialogs pop up and all files silently print. Change the name of the action and action set as indicated in the script:

 

/* 
Batch print files without warning messages.jsx
Stephen Marsh
v1.0 - 9th December 2024
https://community.adobe.com/t5/photoshop-ecosystem-discussions/batch-processing-for-a-print-action-of-multiple-files-has-annoying-quot-the-command-print-is-not/td-p/14007050
*/

#target photoshop;

// Set the input folder
var inputFolder = Folder.selectDialog("Please select the folder containing the files to print:");

// Limit the input files, add or remove extensions as required
var fileList = inputFolder.getFiles(/\.(webp|tif|tiff|jpg|jpeg|psd|psb|png)$/i);
fileList.sort();

// Disable display dialogs during batch processing
var savedDisplayDialogs = app.displayDialogs;
app.displayDialogs = DialogModes.NO;

// Batch process the input files
for (var i = 0; i < fileList.length; i++) {
    var doc = open(fileList[i]);

    // Change the name of the action and action set as required (case sensitive)
    app.doAction("my print action", "my print action set");

    //app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

}

// Restore the display dialog
app.displayDialogs = savedDisplayDialogs; 

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

2 replies

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
December 9, 2024

I have successfully tested the following script, no warning dialogs pop up and all files silently print. Change the name of the action and action set as indicated in the script:

 

/* 
Batch print files without warning messages.jsx
Stephen Marsh
v1.0 - 9th December 2024
https://community.adobe.com/t5/photoshop-ecosystem-discussions/batch-processing-for-a-print-action-of-multiple-files-has-annoying-quot-the-command-print-is-not/td-p/14007050
*/

#target photoshop;

// Set the input folder
var inputFolder = Folder.selectDialog("Please select the folder containing the files to print:");

// Limit the input files, add or remove extensions as required
var fileList = inputFolder.getFiles(/\.(webp|tif|tiff|jpg|jpeg|psd|psb|png)$/i);
fileList.sort();

// Disable display dialogs during batch processing
var savedDisplayDialogs = app.displayDialogs;
app.displayDialogs = DialogModes.NO;

// Batch process the input files
for (var i = 0; i < fileList.length; i++) {
    var doc = open(fileList[i]);

    // Change the name of the action and action set as required (case sensitive)
    app.doAction("my print action", "my print action set");

    //app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

}

// Restore the display dialog
app.displayDialogs = savedDisplayDialogs; 

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

Stephen Marsh
Community Expert
Community Expert
December 9, 2024

Here is an updated version with a scriptUI interface, which is more accessible as you don't have to edit the code to set the action set and action:

 

/* 
Batch Run Action Without Warnings.jsx
Stephen Marsh
v1.0 - 9th December 2024
v1.1  - 15th December 2024, Added an option to truncate long paths and other minor GUI changes
https://community.adobe.com/t5/photoshop-ecosystem-discussions/batch-processing-for-a-print-action-of-multiple-files-has-annoying-quot-the-command-print-is-not/td-p/14007050
*/

#target photoshop

// Create ScriptUI dialog
var win = new Window("dialog", "Batch Run Action Without Warnings (v1.1)");
win.panel = win.add("panel", undefined, "Select Folder and Action");
win.panel.orientation = "column";
win.panel.alignChildren = ["fill", "top"];
win.panel.spacing = 10;
win.panel.margins = 10;

// Folder selection
win.panel.folderGroup = win.panel.add("group");
win.panel.folderGroup.orientation = "row";
win.panel.folderGroup.alignChildren = ["fill", "center"];
win.panel.folderGroup.alignment = "fill";
win.panel.folderGroup.add("statictext", undefined, "Folder:");
var folderButton = win.panel.folderGroup.add("button", undefined, "Browse");
var folderText = win.panel.folderGroup.add("statictext", undefined, "No folder selected", { truncate: "middle" });
folderText.size = [300, 25];

folderButton.onClick = function () {
    var folder = Folder.selectDialog("Please select the folder containing the files to print:");
    if (folder) folderText.text = folder.fsName;
};

// Action set selection
win.panel.actionSetGroup = win.panel.add("group");
win.panel.actionSetGroup.orientation = "row";
win.panel.actionSetGroup.alignChildren = ["left", "center"];
win.panel.actionSetGroup.alignment = "fill";
win.panel.actionSetGroup.add("statictext", undefined, "Action Set:");
var actionSets = getActionSets();
var actionSetDropdown = win.panel.actionSetGroup.add("dropdownlist", undefined, actionSets);
actionSetDropdown.size = [372, 25]; // Hack to visually fit the dropdown width
actionSetDropdown.selection = 0;

// Action selection
win.panel.actionGroup = win.panel.add("group");
win.panel.actionGroup.orientation = "row";
win.panel.actionGroup.alignChildren = ["fill", "center"];
win.panel.actionGroup.alignment = "fill";
win.panel.actionGroup.add("statictext", undefined, "Action:");
var actions = getActions(actionSetDropdown.selection.text);
var actionDropdown = win.panel.actionGroup.add("dropdownlist", undefined, actions);
actionDropdown.size = [350, 25];
actionDropdown.selection = 0;

actionSetDropdown.onChange = function () {
    actionDropdown.removeAll();
    var actions = getActions(actionSetDropdown.selection.text);
    for (var i = 0; i < actions.length; i++) {
        actionDropdown.add("item", actions[i]);
    }
    actionDropdown.selection = 0;
};

// Checkbox for Save Options
win.panel.saveOptionsGroup = win.panel.add("group");
win.panel.saveOptionsGroup.orientation = "row";
win.panel.saveOptionsGroup.alignChildren = ["fill", "center"];
win.panel.saveOptionsGroup.alignment = "fill";
var saveCheckbox = win.panel.saveOptionsGroup.add("checkbox", undefined, "Close without saving changes");
saveCheckbox.value = false; // Default value

// Buttons
win.buttons = win.add("group");
win.buttons.alignment = "right";
win.buttons.alignChildren = ["fill", "center"];
var cancelButton = win.buttons.add("button", undefined, "Cancel", { name: "cancel" });
var okButton = win.buttons.add("button", undefined, "OK", { name: "ok" });

cancelButton.onClick = function () {
    win.close();
};

okButton.onClick = function () {
    if (folderText.text == "") {
        alert("Please select a folder.");
        return;
    }
    var theInput = Folder(folderText.text);
    var fileList = theInput.getFiles(/\.(webp|tif|tiff|jpg|jpeg|psd|psb|png)$/i);
    fileList.sort();
    var actionSetName = actionSetDropdown.selection.text;
    var actionName = actionDropdown.selection.text;
    var savedDisplayDialogs = app.displayDialogs;
    app.displayDialogs = DialogModes.NO;
    for (var i = 0; i < fileList.length; i++) {
        var doc = open(fileList[i]);
        app.doAction(actionName, actionSetName);
        if (saveCheckbox.value) {
            app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
        }
    }
    app.displayDialogs = savedDisplayDialogs;
    win.close();
};

win.show();


// Functions
function getActionSets() {
    var actionSets = [];
    var i = 1;
    while (true) {
        try {
            var ref = new ActionReference();
            ref.putIndex(charIDToTypeID('ASet'), i);
            var desc = executeActionGet(ref);
            var name = desc.getString(charIDToTypeID('Nm  '));
            actionSets.push(name);
            i++;
        } catch (e) {
            break;
        }
    }
    return actionSets;
}

function getActions(actionSet) {
    var actions = [];
    var ref = new ActionReference();
    ref.putName(charIDToTypeID('ASet'), actionSet);
    var desc = executeActionGet(ref);
    var count = desc.getInteger(charIDToTypeID('NmbC'));
    for (var i = 1; i <= count; i++) {
        ref = new ActionReference();
        ref.putIndex(charIDToTypeID('Actn'), i);
        ref.putName(charIDToTypeID('ASet'), actionSet);
        try {
            var actionDesc = executeActionGet(ref);
            var name = actionDesc.getString(charIDToTypeID('Nm  '));
            actions.push(name);
        } catch (e) {
            break;
        }
    }
    return actions;
}

 

Participant
December 8, 2024

Has anyone found a solution? I'm dealing with the same problem...?

Stephen Marsh
Community Expert
Community Expert
December 8, 2024

@Cheerful_Jubilee5FA6 – Can you post a screenshot of the batch window as you have it set?