• 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 automatically run a script Vertical image & Horizontal image

Community Beginner ,
Jul 01, 2022 Jul 01, 2022

Copy link to clipboard

Copied

Hi all,
I'm not good at scripting, but I'm having trouble with my work and if someone can help me to make things more convenient then that's fine.

 

Vertical image- run script A
Horizontal image - run script B

 

Any help will be appreciated. Thanks very much!

TOPICS
Actions and scripting

Views

234

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

Guide , Jul 01, 2022 Jul 01, 2022

Add conditional actions

 

This can be done without a script - just write a condition to the action and assign a command that it will execute for each case (if you need to run a script, you can easily write it into an action)

 

2022-07-01_13-59-15.png

2022-07-01_13-59-50.png

Votes

Translate

Translate
Adobe
Community Expert ,
Jul 01, 2022 Jul 01, 2022

Copy link to clipboard

Copied

Insert the necessary code in the respective clause instead of running the Actions. 

// 2012, use at your own risk; 
#target photoshop
if (app.documents.length > 0) {
var myDocument = app.activeDocument;
if (myDocument.width > myDocument.height) {
	app.doAction("Canvas landscape", "bfunk")
	}
else {
	app.doAction("Canvas portrait", "bfunk")
	}
};

 

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 ,
Jul 01, 2022 Jul 01, 2022

Copy link to clipboard

Copied

LATEST

Add conditional actions

 

This can be done without a script - just write a condition to the action and assign a command that it will execute for each case (if you need to run a script, you can easily write it into an action)

 

2022-07-01_13-59-15.png

2022-07-01_13-59-50.png

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