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

Bulk packaging

Enthusiast ,
Dec 19, 2023 Dec 19, 2023

Copy link to clipboard

Copied

ANy way to package a plethora of PSD files in one shot? I have for instance 20 PSD files that I want to package, each into their own of course... any scripts out there?

TOPICS
Actions and scripting , Windows

Views

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

Community Expert , Dec 21, 2023 Dec 21, 2023

Here is an improved 1.1 version of the script:

 

/*
Bulk Package.jsx
v1.1 21st December 2023, Stephen Marsh - Special thanks to c.pfaffenbichler for offering help in extending the original script
https://community.adobe.com/t5/photoshop-ecosystem-discussions/bulk-packaging/td-p/14308824
*/

#target photoshop

if (app.documents.length === 0) {

    var selectFile = File.openDialog("Please select the file/s to package:", Multiselect = true);

    var counter = 0;

    for (var i = 0; i < selectFil
...

Votes

Translate

Translate
Adobe
Enthusiast ,
Dec 22, 2023 Dec 22, 2023

Copy link to clipboard

Copied

THIS IS SO $%^#&$#%&&*$%*& AMAZING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! TYTYTYTYTYTYTYTYTYTY

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
Community Expert ,
Dec 22, 2023 Dec 22, 2023

Copy link to clipboard

Copied

You're welcome!

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
Enthusiast ,
Dec 22, 2023 Dec 22, 2023

Copy link to clipboard

Copied

This will save so much headache!! I work on projects that will have 20 plus PSD files and when the project is done or needing to pass off to agency this will make the workflow smoother!!!!!!!!!!!! I really appreciate the help and work on this!! If you need any deign or creative help let me know!!!

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
Community Expert ,
Dec 22, 2023 Dec 22, 2023

Copy link to clipboard

Copied

@Todd_Morgan â€“ Thank you for the kind offer!

 

Here is a 1.2 version that creates a log file on the Desktop listing the files that failed to package.

 

/*
Bulk Package.jsx
v1.2 21st December 2023, Stephen Marsh - Special thanks to c.pfaffenbichler for offering help in extending the original script
https://community.adobe.com/t5/photoshop-ecosystem-discussions/bulk-packaging/td-p/14308824
*/

#target photoshop

if (app.documents.length === 0) {

    var logFile = new File("~/Desktop/failed-batch-package-log.txt");
    if (logFile.exists);
    logFile.remove();
    var os = $.os.toLowerCase().indexOf("mac") >= 0 ? "mac" : "windows";
    if (os === "mac") {
        logFileLF = "Unix";
    } else {
        logFileLF = "Windows";
    }

    var selectFile = File.openDialog("Please select the file/s to package:", Multiselect = true);

    var counter = 0;

    for (var i = 0; i < selectFile.length; i++) {
        var openFiles = app.open(File(selectFile[i]));
        try {
            savePackage();
            openFiles.close(SaveOptions.DONOTSAVECHANGES);
            counter++;
        } catch (e) {
            writeToLog();
            openFiles.close(SaveOptions.DONOTSAVECHANGES);
        }
    }

    alert("Bulk Package Completed!" + "\r" + "Files selected: " + selectFile.length + "\r" + "Files processed: " + counter);
    //logFile.execute();

} else {
    alert('Please close all open documents before running this script!');
}

function savePackage() {
    var theFolder = activeDocument.path.fsName;
    var idpackageFile = stringIDToTypeID("packageFile");
    var desc982 = new ActionDescriptor();
    var idto = stringIDToTypeID("to");
    desc982.putPath(idto, new File(theFolder));
    executeAction(idpackageFile, desc982, DialogModes.NO);
}

function writeToLog() {
    logFile.open("a");
    logFile.encoding = "UTF-8";
    logFile.lineFeed = logFileLF;
    logFile.write("Failed to package: " + activeDocument.path.fsName + "/" + activeDocument.name + "\r");
    logFile.close();
}

 

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
Community Expert ,
Dec 22, 2023 Dec 22, 2023

Copy link to clipboard

Copied

Nice work @Stephen_A_Marsh !

Jane

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
Community Expert ,
Dec 22, 2023 Dec 22, 2023

Copy link to clipboard

Copied

LATEST

Thank you Jane!

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