I've reached my wit's end on this one. I need to automate the comparison of a series of text strings but for whatever reason when I run the macro it simply dies, it doesn't even abort.
The first series of text strings are on a column of a spreadsheet and the second series are on different web pages.
Examples of strings on the spreadsheet column:

Examples of strings on the different web pages:


All I need to compare are the strings within the yellow rectangles above, therefore, I have a "Search Variable using Regular Expression" action that extracts them.
I then have an "If, Then, Else" action like so:

Here's the problem: If for example, I remove a leading zero from one of the numbers (I do this to test the macro), the action simply dies. No abort notification, nothing.
Any ideas why the action dies like this? My theory is that it doesn't know how to handle the missing zero.
I was thinking perhaps there's a way to convert the numbers to HEX or Binary values and then compare those two but I don't understand how to implement that in the macro.
Thanks in advance!
PS: I didn't upload the entire macro as it's pretty long but I can do so if needed.
What happens if you change "The variable is !=" to "The variable is not"?

!=
is only meant for numbers, and it looks like you're comparing strings.
If I do "is !=" it works so long as the leading zero is not missing.
if I do "is not" —per your kind suggestion— the comparison says "currently true" but it's NOT true because they are the same (I even checked it with a text editor just to make sure there are no invisible spaces).
Strange...
Aha, I think I see the problem now. The problem is that you're using a plain variable name in the comparison field, where you need token syntax. In other words, right now you have this:
When it should be this:
Essentially, you were comparing a variable's contents to another variable's name, so it's no wonder the comparison said they were different.
1 Like
I'm so embarrassed. The macro was not "dying" as I reported initially. Early this morning I turned off notifications as I wanted to stay focused and forgot about that!
That said, my macro was indeed aborting (not dying) because when I removed a leading zero (to test things) the Regular expression action that was extracting the strings I needed to compare (in yellow rectangles in my original post) failed to execute because it "Failed to match".
After adding the token syntax in the comparison field, It's all working as expected now.
BTW: For those of you who ever wonder what all these exactly do:

Here's a link: https://wiki.keyboardmaestro.com/condition/Clipboard?s[]=comparison&s[]=criteria
Thank you so much gglick!
2 Likes