This is probably super obvious but I can’t get my head around it.
I have an action which sets up a prompt (using Matt Gemmell’s ever useful
MGCheckListPrompt Library) to get a title for a draft (I’m building - like everyone these days - a zettel like system with templates)
Now, if I cancel the prompt, I want to abort the entire action. Matt’s examples have a graceful structure to process the results, using
context.cancel(). However, as stated in the reference guide:
It is important to understand that cancel() and fail() will not immediately stop script, just stop any further action steps from being performed.
So, when I cancel the prompt, subsequent actions are still taken and fail (prompt exit variables are not set, etc …) quite ungracefully.
break() but I’m not in a browser nor in the middle of a function …
I really need a way to say ‘I give up, please return to the draft having done nothing …’
Do I need to wrap my entire script in the contextual check for the prompt at the beginning?
As I write, it seems the obvious thing to do, but I’m wondering if it’s best practice.
Thanks for any help.