Random_TD_Programmer
New Here
Random_TD_Programmer
New Here
Activity
‎Sep 11, 2023
08:55 AM
3 Upvotes
Hi, sorry for being so late. I tried to edit the the OP but couldn't. Here is the function: function makedirs(folderString){
var f = new Folder(folderString);
if (f.exists == false) {
f.create()
}
} As for the path,i will try to test today on the M1 to see if that string is wrong somehow.
... View more
‎Sep 06, 2023
05:45 PM
1 Upvote
Hi, I have a script that manipulate layers and save them in different photoshop files.Some of them are big so need to be saved in .psb. My function that does this is based on many suggestions that i found both here and on stack overflow: function SavePSB(saveFile) {
var desc1 = new ActionDescriptor();
var desc2 = new ActionDescriptor();
desc2.putBoolean( stringIDToTypeID('maximizeCompatibility'), true );
desc1.putObject( charIDToTypeID('As '), charIDToTypeID('Pht8'), desc2 );
desc1.putPath( charIDToTypeID('In '), new File(saveFile) );
desc1.putBoolean( charIDToTypeID('LwCs'), true );
//this function creates the folder if it doesn't exist already.
makedirs(saveFile.substring(0, os.lastIndexOf('/')));
executeAction( charIDToTypeID('save'), desc1, DialogModes.NO );
}; This function works fine on windows but recently it caused trouble on macos. The computer is a M1 chip and when the artist tries to execute the script this error show up: Error: General Photoshop Error has occurred. This functionality may not be available in this version of Photoshop. - <no additional information available> After some digging it seems that it's the desc1.putPath() method that doesn't exist. The photoshop version is 24.7 which is the same one i have on my widows and it works well there. My question is, is there an alternative way to save a psb file programmatically that is compatible with modern MAC? thanks in advance.
... View more