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

Can I using NEXT in Photoshop Script to bypass and action ?

Participant ,
Jul 12, 2023 Jul 12, 2023

Copy link to clipboard

Copied

The code as following, but photoshop keep raide error on NEXT

 

if (theW-targetW >10||theH-targetH>10){
		alert(theW-targetW,theH-targetH);
		NEXT
	};

	var bounds = [0,0,targetW, targetH]
	app.activeDocument.crop(bounds);

How should I bypass the corp action if meet the criteria ?

TOPICS
Actions and scripting , Windows

Views

154

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 , Jul 12, 2023 Jul 12, 2023

@Calvin21914323wi10 

 

No, not Next. You need to use the following if/else/else if – there are many code examples in the forum if you search.

 

https://www.w3schools.com/js/js_if_else.asp

 

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else

 

Here is a Photoshop example of a simple conditional:

 

https://snipit.io/public/collections/22660/22660/74742

Votes

Translate

Translate
Adobe
Community Expert ,
Jul 12, 2023 Jul 12, 2023

Copy link to clipboard

Copied

@Calvin21914323wi10 

 

No, not Next. You need to use the following if/else/else if – there are many code examples in the forum if you search.

 

https://www.w3schools.com/js/js_if_else.asp

 

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else

 

Here is a Photoshop example of a simple conditional:

 

https://snipit.io/public/collections/22660/22660/74742

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
Participant ,
Jul 12, 2023 Jul 12, 2023

Copy link to clipboard

Copied

LATEST

Thank you very much, it works and much better

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