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

Automating Different Batch Actions with JavaScript

Community Beginner ,
Sep 28, 2022 Sep 28, 2022

Copy link to clipboard

Copied

Hey guys, so I have a bunch of different batch actions that work by selecting an action, with the corresponding folder (see below)

 

Screen Shot 2022-09-28 at 4.10.49 PM.png

 

is there a way to write a script that will automatically pair an action up with the correct file path and run through all of these batch actions with one click?? THANKS!!:)

TOPICS
Actions and scripting , macOS

Views

81

Likes

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 ,
Sep 28, 2022 Sep 28, 2022

Copy link to clipboard

Copied

If you're 100% certain the names match this could probably be achieved relatively easy. It would just be a simple loop that retrieves the folder names and calls the action by extracting the relevant string from the folder path. I'm just not too much into PS scripting and can't point you to relevant examples and code references without looking it up myself. Perhaps one of the PS scripting gurus can chime in and whip up the code.

 

Mylenium 

Likes

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 Beginner ,
Sep 28, 2022 Sep 28, 2022

Copy link to clipboard

Copied

Thank you!! 

Likes

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 ,
Sep 28, 2022 Sep 28, 2022

Copy link to clipboard

Copied

I would create a CSV file with paired action/folder path and then write a script to read the file and run each pair in sequence. If you look through scripting posts you should find some good examples to get you started.

Likes

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 Beginner ,
Sep 28, 2022 Sep 28, 2022

Copy link to clipboard

Copied

I'll do that and keep you guys updated! Any continued help on this is greatly appreciated since I don't really know how to write scripts.

Likes

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 ,
Sep 28, 2022 Sep 28, 2022

Copy link to clipboard

Copied

LATEST

You can use my Auto find action script.

20220316_213716_2022-03-16_19-12-06.png

It allows you to match the name of one of the document properties to find the appropriate action. The only problem is that I did not take into account the possibility of using the nested directories (however, I think this problem can be easily solved by renaming folders)

 

or you can use a simple script to change the name of the active layer as needed (when saved as a png, it will be automatically deleted)

activeDocument.activeLayer.name = decodeURI(Folder(activeDocument.path.parent).name) + ' - ' +decodeURI(activeDocument.path.name);

 

 

Likes

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