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

Scripting: Load files into stack / Export layers to files from sub-folders

New Here ,
Oct 21, 2022 Oct 21, 2022

Copy link to clipboard

Copied

Dear scripting experts,

i'm a bloody beginner in scripting for photoshop and I desprately need your help.

my task is:

- load four TIF-Pictures from each sub-sub-folder into stack 

- align them

- create a brake or something to manually crop the document 

- export the aligned and croped layers into files in new Output folders named like the Input folders 

- the structure should also be like the Input Folder tree, see below

Bildschirmfoto 2022-10-21 um 13.05.34.png

 

I hope somebody can help 🙂 Thank you very much!

TOPICS
Actions and scripting , macOS

Views

70

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 ,
Oct 21, 2022 Oct 21, 2022

Copy link to clipboard

Copied

So in your example you have 5 files in the subfolder, but 4 selected. How to you determine which 4 files to select?

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
New Here ,
Oct 21, 2022 Oct 21, 2022

Copy link to clipboard

Copied

its always 4 tif. and one jpg. 

it should ignore the jpg. file and just take tif files

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 ,
Oct 21, 2022 Oct 21, 2022

Copy link to clipboard

Copied

Oh, yea, my eyes are a bit blurry, this morning. 

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 ,
Oct 21, 2022 Oct 21, 2022

Copy link to clipboard

Copied

LATEST

Some time ago I wrote a batch processing script for myself. Among other functions, it has one specifically for this case - the ability to simultaneously open all files located in a subdirectory:

In short:

  • Start recording the action
  • Open 4 files from any folder
  • Create a new document and sequentially put the contents of 4 open files into it (simulating the transfer of files into stack).
  • In the resulting document, select all the layers and do the alignment
  • After that, make a crop by checking the "dialog mode" mark in the action - this will allow us to execute it manually
  • Copy the layers from this document to the source files.
  • Close the created document, leaving on the screen 4 source documents that currently contain new content.

Since my script is a typical batch processor, it is mean that the action will be repeated for EVERY open file (and this will lead to an error, since the action we wrote only needs to be executed 1 time for 4 files), but we can trick it:

  • write another action in which add the condition "document has unsaved changes", then do nothing.

Run my script, set it up as in the video (select TIF files from the list of extensions, indicate that you need to open all files at once grouped by subdirectories, specify our additional action with a condition (which will launch the main action only once for all files), set up saving parameters without forgetting to specify the path to the new directory and setting the option to save the file structure) and run.

 

If you did everything correctly, then a copy of the original directory with all subdirectories will be created, containing the processed files.

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