How to skip next step in automator if no file is selected

Hi,

I have commands in automator that asks for file(s) as input and then move them to desired folder, But when I select no file in file chooser dialog box, my automator crashes and stops, is there any way to avoid this, if I select no file then nothing should be moved and my script should go on next steps


Below is the image showing log at bottom side


iMac Line (2012 and Later)

Posted on Oct 30, 2021 7:30 AM

Reply

Similar questions

4 replies

Oct 30, 2021 7:59 AM in response to SuyogBauskar

Have you set the Options to Ignore Actions input for the 2nd through last instances of Ask For Finder Items?



Clicking a Cancel button in this action sends an error code to Automator which intercepts it as an error condition that you see in red at the bottom of the log entries.


Because Automator is a cascade of data between actions, it has no branch logic to skip subsequent actions. You may have to rewrite your workflow to incorporate that branching logic in either a Run AppleScript or Run Shell Script and the equivalent move operations within that code based on the selection of a dummy filename instead of clicking Cancel. You pass that dummy filename into the code and test it to determine the logic branch to take.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to skip next step in automator if no file is selected

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.