I am following the instructions in the Wiki to set a variable to calculation but not sure why is not working and the action cancels my macro:
Does anyone knows what I am doing wrong? I defined my instanceGrossSales variable in a previous step, and used for other action so that's not the issue.
Make sure "Notify on Failure" is turned on for that action -- does the message in the notification give you any clues?
And try popping a "Display Text: instanceGrossSales" action in after the "Execute JavaScript..." one to check that you are getting a number rather than something that's being treated as text.
When I'm troubleshooting I always use Display Text in a window actions wherever appropriate, so I get persistent info/error messages that are easily edited.
When something cancels a macro it's frequently a good idea to consult the Keyboard Maestro Engine log.
** BBEdit is commercial software, but it reverts to a freeware "lite" version after a demo period. Even the lite version is very powerful – it has PCRE RegEx search and replace, is highly AppleScriptable, and has many other useful features. Commercial vs Freeware Comparison Chart.
I realized what was happening so I am giving an update in case is helpful for somebody else.
So basically, the text copied from the website had a ($) and a (,) for the thousands, that was giving me an error when trying to perform the calculation.
So what I did to solve this issue is: "Search and Replace" to delete the ($) and (,) and the calculation action worked!