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

Can this be done with an action or script?

Community Beginner ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

Hello!

 

I created an action that shortens my work by a good half hour on each psd file. The only thing left is to manually select the files during the action. It makes me wonder if the selection of files could also be done automatically.

 

My file structure looks the same every time:
+200! folders and in each of them 12 strings of files:

 

0_A.png
0_B.png
0_C.png
0_D_1.png
0_D_2.png
0_D_3.png

then

1_A.png
1_B.png
1_C.png
1_D_1.png
1_D_2.png
1_D_3.png

then
2_A.png
2_B.png
2_C.png
(... )
last

11_A....

I run actions for files with prefix 0 then separately for 1 and so on and so forth. I wonder if it is possible to do so, that I choose a range of files, that is those with prefix 0 and the action will automatically choose those files in the right order and process them. Then I would select 1_... and the action selects the files in the correct order (by recognizing the names not prefixes, i.e. A, B, C, etc.).

 

Has anyone done something similar before? Is there already a script or action that would work this way?

 

TOPICS
Actions and scripting

Views

243

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
Adobe
Guide ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

You are writing about psd, and the list of files contains png. What exactly do you mean by "action will automatically choose those files"? Should the files just be opened or placed in a document?

 

Is the process on video similar to what you need?

 

I see a potential problem with sorting - the number of characters must be the same to compare string values correctly. The standard batch will open your files in the following order: 0_, 1_, 10_, 11_, 2_, 3_, 4_, 5_, 6_, 7_, 8_, 9_, 0_. To fix this, find any program to batch rename files add a zero before all digits except 10 and 11

 

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
LEGEND ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

If he used script then compareWithNumbers function would sort your array from 0_ to 11_.

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 Beginner ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

Thanks to this video, I came up with a simpler way that probably doesn't require scripting. Just load a set of images on layers and rename them to 1,2,3,4,5,6,7.
0_A.png - >  1 (layer)
0_B.png  -> 2
0_C.png - > 3

Then this action would call my current action, slightly reworked to select layers by number from previous document. I think that's it. 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
Community Expert ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

I am not sure I do understand what exactly you want to do... I guess you know for posibility to run batch script like Image Processor or Image Processor Pro and to select action to play on each file processed. One of the options is to run process on open files. Another option is to re-structure files into folders and then to run batch process. You should be able also to select files in Bridge and to run batch processing script on selected files (Bridge > Tools > Photoshop > Batch).

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 Beginner ,
Sep 03, 2021 Sep 03, 2021

Copy link to clipboard

Copied

LATEST

I have an action where I have to manually select files in the correct order. So that I don't have to think about what I am selecting, I came up with this video that I will load the images using "load into stack", rename them to 1,2,3 etc... and then the actual action will pull those layers out of the document by itself.

 

If I select all the files at the beginning it makes my work much simpler. It is not an ideal solution but I do not have to write a script and I do not know how.

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 ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

That can be scripted however that script has most likely has not be created yet.  Having  200 folders  each having 12 images to composite is not a common work flow you would need to design and code your custom script. Png that have a transparent boarder can add complxity to the scripting  process.

JJMack

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
Guide ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

quote

That can be scripted however that script has most likely has not be created yet.  


By @JJMack

 

In this video, I expand example. The same set of actions handles 3 directories with 72 files in each. It is clear that if we have a lot of coffee, then 200 catalogs will be easily processed 😉

 

To automatically start an action depending on the name of the document, I use my old script https://github.com/boogalooper/Auto-find-action (it is intended to be recordered in the actions panel )

 

2021-09-03_00-47-59.png

 

I additionally put empty 12.png file to each directory and wrote a separate action for it that saves the finished psd (I use a script to save the psd with an increment of the name - it can be easily found in the community).

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
LEGEND ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

What does your new Trigger Layer script do?

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
Guide ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

I would not say that it is new, I just never published it (like many other things). I have a lot of scripts made for the needs of our production, but I'm not a professional programmer, in some places my code is just awful and i'm just ashamed to publish it. 🙂

 

It's kind of like an tool preset system. Presets are not stored in the palette, but in the script settings. The script selects them automatically depending on the layer (or channel) selected by the user (script can triggered by layer type, name mask, etc.). Also, instead of a preset, you can run an action or another script. I made a simple tool settings editor - you can choose which parameters will be taken from the previously saved tool settings, and which from the current ones. In general, the script is configurable quite flexibly. This is actually very handy for manual processing. I tried to make the trigger firing as fast as possible, so its work in the background is almost invisible (at least I think so 🙂)

For example, i use these triggers all the time above 2 years:

2021-09-03_01-37-29.png

- if a layer is selected containing * LUT * in the name, then activate the brush on the palette (I use this to mask LUT masks)
- if a channel is selected containing * mask * in its name (these are ordinary layer masks), then activate the gradient tool on the palette with saved tool settings
- if the "enhance" adjustment layer is selected, then launch a specific action (the action removes this layer, since at the moment of selecting it I no longer need it)

etc

 

One day I will find the time and make at least a basic description 🙂

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
LEGEND ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

So it's like Image Assets of Generate item of File menu which reads layer names to run export.

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