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?
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
...
Copy link to clipboard
Copied
THIS IS SO $%^#&$#%&&*$%*& AMAZING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! TYTYTYTYTYTYTYTYTYTY
Copy link to clipboard
Copied
You're welcome!
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!!!
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();
}
Copy link to clipboard
Copied
Nice work @Stephen_A_Marsh !
Jane
Copy link to clipboard
Copied
Thank you Jane!