Copy link to clipboard
Copied
Hello there,
I am trying to create a droplet where I can drop multiple files on it and it creates layer comps to JPGs. All is working fine except all of the files take on the filename of the first file!
I figure I have to edit the .jsx file, but have no clue how to do that. Not sure if I should post the .jsx file here as it's pretty long.
Does anyone have any ideas?
At your own risk and peril 🙂
Make two changes to the script (save the original script of course)
1. Code replacement, original line 137
main();
on the code
main();
if (DialogModes.ALL == app.playbackDisplayDialogs) app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
2. Code replacement, original line 177
if ( DialogModes.ALL == app.playbackDisplayDialogs ) {
if (cancelButtonID == settingDialog(exportInfo)) {
return 'cancel'; // quit, returning 'cancel' (d
...
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
At your own risk and peril 🙂
Make two changes to the script (save the original script of course)
1. Code replacement, original line 137
main();
on the code
main();
if (DialogModes.ALL == app.playbackDisplayDialogs) app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
2. Code replacement, original line 177
if ( DialogModes.ALL == app.playbackDisplayDialogs ) {
if (cancelButtonID == settingDialog(exportInfo)) {
return 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script
}
}
on the code
if ( DialogModes.ALL == app.playbackDisplayDialogs ) {
if (cancelButtonID == settingDialog(exportInfo)) {
return 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script
}
}
else {
try {
var tmp = app.activeDocument.fullName.name;
exportInfo.fileNamePrefix = decodeURI(tmp.substring(0, tmp.indexOf("."))); // 1 body part
} catch(someError) {
exportInfo.fileNamePrefix = app.activeDocument.name; // filename body part
}
}
The prefix will always be the same as the file name. The rest of the parameters, including the save path, will be recorded in your Action that calls the script from which (from the Action) you will make the droplet.
Good luck 🙂
Copy link to clipboard
Copied
@r-bin Thank you, I will def. try this! I will report back!
Copy link to clipboard
Copied
@r-bin IT WORKED!!!!!! I can't thank you enough for your help!!!!! Thank you Thank you Thank you!
Copy link to clipboard
Copied
If I wanted to do the same script but for Layer Compts To PDFs. What would I have to change?
Copy link to clipboard
Copied
The "Layer Comps To PDF.jsx" scripts differ in different versions of Photoshop.
Give a link to your script. Maybe I'll take a look.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Do you have a link to where that "extended" script came from?
I don't really like/trust that www.uncorp.net site...
Copy link to clipboard
Copied
@Stephen_A_Marsh Yes, I got it from here: photoshopscripts
Copy link to clipboard
Copied
You have given a script the same as that of the author of the topic, only it has been corrected.
You need to create a new action in which you record the script call. Specify the output format in the script dialog - PDF. Create a new droplet from this action.
..
Or I didn't understand the problem.
Copy link to clipboard
Copied
I may have explained it wrong. I tried this and it saved out the layer comps as separate PDFs. I would want the PDF to be saved out with all layer comps in one PDF.
Copy link to clipboard
Copied
I don’t know anything about the PDF format. Even Photoshop does not work directly with it.
Can a PDF contain LayerComps?
Unfortunately, I do not understand what this is about and I can hardly help.
Copy link to clipboard
Copied
@r-bin Would love your help on this, as I am having the same problem.
I created an action using File/export/Layer Comps to PDFs. That works perfectly when I run it on 1 file at a time. When I run the action on more than 1 file at a time, each filename saves over the last, just like what happened with the Layer Comps to Files script. I actually tried to replace the code with how you suggested it for the first time, and when I did that, and ran the action again the file name ended up being replace with untitled.pdf lol
I can upload the file if you wouldn't mind taking a look as you hit it out of the park the last time!!!
Copy link to clipboard
Copied
Yes, upload your version of the "Layer Comps To PDF.jsx" file that I requested.
Copy link to clipboard
Copied
Thanks @r-bin
Here is the link to the file on my gmail drive: Layer Comps To PDF.jsx
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
@r-bin Sorry for the delay! Thx for the script. When I run this, the PDF is named untitled.pdf. I need it to be the filename. Is there a fix for that?
Copy link to clipboard
Copied
@Rbin False alarm! Seems to be naming them correctly!
Copy link to clipboard
Copied
Similar to this other topic:
How to make a script for saving out multiple files with layer comps to JPEGs
EDIT: No surprise that the answer provided by @r-bin resulted in a perfect result compared to my hack!