Skip to main content
Participant
September 2, 2021
Question

Can this be done with an action or script?

  • September 2, 2021
  • 2 replies
  • 641 views

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?

 

This topic has been closed for replies.

2 replies

JJMack
Community Expert
Community Expert
September 2, 2021

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
Legend
September 2, 2021
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 )

 

 

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

Kukurykus
Legend
September 2, 2021

What does your new Trigger Layer script do?

Legend
September 2, 2021

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

 

Kukurykus
Legend
September 2, 2021

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