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

Script to convert .TIF with Path to transparent PNG (action not based on path name)

Community Beginner ,
Oct 13, 2022 Oct 13, 2022

Copy link to clipboard

Copied

Hi all,

I am wondering if someone can help me with a solution to batch convert a library of 36.000 images from .TIF with path to transparent .png files

I created a action script with steps to select the .TIF path and delete the background, after that save it as .png.

But i'm having trouble. Not all files have the same path name. some have Path 1 others have 1/outline/pad 1 etc. 

The current script only runs when the path is named Path 1 but stops when a path is named outline.

Is there a way to generalize the action to select the first path regardless of the name?

Thanks in advance,
Joeri Dullens

TOPICS
Actions and scripting

Views

69

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

correct answers 1 Correct answer

Community Expert , Oct 13, 2022 Oct 13, 2022

@Joeri5E20 – This is a limitation with actions, they record absolute path names.

 

If the path is consistently the very top/first path in the path panel, the following JavaScript will select it for you:

 

activeDocument.pathItems[0].select();

 

Or to make a selection from the first path:

 

activeDocument.pathItems[0].makeSelection();

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

Likes

Translate

Translate
Community Expert ,
Oct 13, 2022 Oct 13, 2022

Copy link to clipboard

Copied

You would simply address it by index. I'm not that deep into PS scripting, but a quick web search turned up this:

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/clipping-path-info/m-p/4673305

 

The first function fetches the index of paths and certainly it could be modified to work with your script.

 

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 Expert ,
Oct 13, 2022 Oct 13, 2022

Copy link to clipboard

Copied

@Joeri5E20 – This is a limitation with actions, they record absolute path names.

 

If the path is consistently the very top/first path in the path panel, the following JavaScript will select it for you:

 

activeDocument.pathItems[0].select();

 

Or to make a selection from the first path:

 

activeDocument.pathItems[0].makeSelection();

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

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

Copy link to clipboard

Copied

Worked like a charm! ❤️

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

Copy link to clipboard

Copied

LATEST

@Joeri5E20 – thank you, I wasn't sure if this was consistently the first/top path that varied in the name. Glad you got the result that you needed!

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

Copy link to clipboard

Copied

@Joeri5E20 – So, how did the scripts work for 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