I wish there was an Action called "Assert", where I could specify a condition (usually involving a variable) and if the condition is false, I would do a Notification with some text I specify, and "Cancel this Macro".
I can, of course, do something like this:
But being the anal person I am, I would also want to rename the "If" action and collapse it like this:
This naturally got me to thinking that, if no "Assert" action is forthcoming from Peter (and I wouldn't expect it to be high on his list), there's got to be some way to automate creating this code. I just can't quite come to grips with how to accomplish it.
I could do some really kludgy combination of Prompt, Paste from Named Clipboard, tab keys, inserting text, right-clicking on a found image to rename the "IF", and clicking a found image to collapse the result.
Could be done, of course. In fact, in lieu of any other ideas, I'll probably do just that. But I was hoping there was a way that didn't "smell" as much.
Any ideas?
PS: "Asserts" are awesome, and help debug complex code, especially when you have macros calling each other. Each sub-macro makes some assumptions, and Asserts double-check the assumptions so if you change something somewhere and it breaks something down the line, you know why.