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

Droplet using a .jsx action not working properly - every file has the same name!

Explorer ,
May 13, 2021 May 13, 2021

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? 

TOPICS
Actions and scripting

Views

2.5K

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

Valorous Hero , May 13, 2021 May 13, 2021

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

Votes

Translate

Translate
Adobe
Valorous Hero ,
May 13, 2021 May 13, 2021

Copy link to clipboard

Copied

Download the script for example on google drive and give a link here.
I don't think Edgar Cayce is here.

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
Explorer ,
May 13, 2021 May 13, 2021

Copy link to clipboard

Copied

Thank you. Here is the link to the .jsx file:

 

Layer Comps To Files (Extended).jsx

 

 

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
Valorous Hero ,
May 13, 2021 May 13, 2021

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 🙂

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
Explorer ,
May 14, 2021 May 14, 2021

Copy link to clipboard

Copied

@r-bin Thank you, I will def. try this! I will report back!

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
Explorer ,
May 14, 2021 May 14, 2021

Copy link to clipboard

Copied

@r-bin IT WORKED!!!!!! I can't thank you enough for your help!!!!! Thank you Thank you Thank you! 

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
New Here ,
May 26, 2021 May 26, 2021

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?

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
Valorous Hero ,
May 26, 2021 May 26, 2021

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.

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
New Here ,
May 26, 2021 May 26, 2021

Copy link to clipboard

Copied

Thanks @r-bin 

 

The link below is to the script.

Layer Comps To Files (Extended).jsx

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 ,
May 13, 2021 May 13, 2021

Copy link to clipboard

Copied

@jackieg25153876 

 

Do you have a link to where that "extended" script came from?

 

I don't really like/trust that www.uncorp.net  site...

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
Explorer ,
May 14, 2021 May 14, 2021

Copy link to clipboard

Copied

@Stephen_A_Marsh  Yes, I got it from here: photoshopscripts

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
Valorous Hero ,
May 26, 2021 May 26, 2021

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.

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
New Here ,
May 26, 2021 May 26, 2021

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. 

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
Valorous Hero ,
May 26, 2021 May 26, 2021

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.

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
Explorer ,
May 26, 2021 May 26, 2021

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!!!

 

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
Valorous Hero ,
May 26, 2021 May 26, 2021

Copy link to clipboard

Copied

Yes, upload your version of the "Layer Comps To PDF.jsx" file that I requested.

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
Explorer ,
May 26, 2021 May 26, 2021

Copy link to clipboard

Copied

Thanks @r-bin 

Here is the link to the file on my gmail drive:  Layer Comps To PDF.jsx

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
Valorous Hero ,
May 26, 2021 May 26, 2021

Copy link to clipboard

Copied

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
Explorer ,
May 26, 2021 May 26, 2021

Copy link to clipboard

Copied

@r-bin  THANK YOU! I'll keep you posted!

 

 

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
Explorer ,
Aug 24, 2021 Aug 24, 2021

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? 

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
Explorer ,
Aug 24, 2021 Aug 24, 2021

Copy link to clipboard

Copied

LATEST

@Rbin False alarm! Seems to be naming them correctly! 

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 ,
May 13, 2021 May 13, 2021

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!

 

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