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

How to run multiple scripts in folder in succession?

New Here ,
Jul 24, 2024 Jul 24, 2024

Copy link to clipboard

Copied

Hello, i am attempting to figure out a way to automate running two scripts that perform seperate actions and im stumped.

 

to explain, I am trying to accomplish 2 functions.


1. trim white borders & export as jpeg

2. Place and scale trimmed jpegs to new canvas with pre determined dimensions & export

 

I have made scripts for both steps, though they are seperate functions and im trying to figure out how to automate the process, without having to prompt the task to begin operating script 2 once script 1 has completed processing. Is this possible?

TOPICS
Actions and scripting , Windows

Views

131

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
Community Expert ,
Jul 24, 2024 Jul 24, 2024

Copy link to clipboard

Copied

Saving as JPEG isn't a great choice for the planned input to further processing.

 

Why don't you just do all of the processing in one script?

 

Anyway a third script can be used to sequentially call script 1 and script 2, while an action can also do the same.

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
New Here ,
Jul 24, 2024 Jul 24, 2024

Copy link to clipboard

Copied

I don't particularly need to save as JPEG, I could also save as PNG. Most of my input data comes as JPEG so I've just stuck to that file type currently. 

That's the part that has me stuck. I'm not the most knowledgeable when it comes to writing scripts. I dabble. But this is a little beyond me.

 

Essentially I want to trim all files within a folder, then insert and scale the trimmed files within a smart object of a psd template I've already created, as those have specific deminsions I need, exit the smart object, and export all files within the smart object as individual files.

 

currently my manual process is

 

Trim > open Template > double click desired smart object > place all trimmed images > scale proportionally to smart object bounds > Copy all scaled images > exit smart object > toggle visibility of smart object off > paste all scaled images > export layers to files


it works, though it's pretty manual.  

Calling my 2 previous scripts would solve the problem, though because im a noob at this, I'm not entirely sure how to write a code that would call them. 

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 ,
Jul 24, 2024 Jul 24, 2024

Copy link to clipboard

Copied

LATEST

Ah, you didn't mention that this was for smart object replacement.

 

Some examples of a script calling a script can be found here:

 

https://gist.github.com/MarshySwamp/eb36460ae2813b6fc47e2d3fec48deb3

 

As I previously wrote, you just record the execution of a script into an action, and then the action can sequentially run the 2 scripts. 

 

That being said, this may not be what you are looking for.

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