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

How to cancel or stop the action that called the script?

Participant ,
Dec 23, 2016 Dec 23, 2016

Hi,

I would like to stop the action that called my script. I can see in the forum how to get the calling action name:

  1. var ref = new ActionReference(); 
  2. ref.putEnumerated( charIDToTypeID("Actn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );  
  3. var desc = executeActionGet(ref); 
  4. var actionName = desc.getString( charIDToTypeID("Nm  ") ); 
  5. var actionSetName = desc.getString( charIDToTypeID("PrNm") ); 
  6. alert( 'Current selected action is: '+actionName+'\rin the action set: '+actionSetName ); 

Is there some way to stop the action? (What I'm doing in the script is giving the user the option to display help; if this option is chosen I display the help and would like to be able to terminate the action).

Thanks!

Robert

TOPICS
Actions and scripting
6.1K
Translate
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 ,
Dec 23, 2016 Dec 23, 2016

If a Action is running your script I would think if your script ends a throw and error the action would be in the action script step that user would see the error message like things went wrong the action should be stopped.  However once the users dismisses the error message the action would continue with its next step for actions can not use logic can not test if a script step worked or not even if the script was able to return a failed return code the action can not see that it can mot use logic to see that was the case.

While your script is running it can interact with the user gives help receive information from the user do Photoshop steps because of info user provided. If there are additional steps in the action after the script step when your script ends the rest of the action will be played.

JJMack
Translate
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 ,
Dec 23, 2016 Dec 23, 2016
LATEST

Yes, unfortunately I think you're right.  I will just need to put all of the steps in the scripts.

Thanks

Robert

Translate
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