Variables seem to be broken

Hi,

I am having problems using the variables. They just seem to be completely not working.

Take this screenshot for example. You can see varName exists and has the text 'hello', but the if statements seems to think it doesn't exist. This is the same also if I use numbers instead of text.

Any advice on how to fix this?

Thanks very much

Did you run the macro to set the variable? In the above situation, the variable isn't set unless you run it first. My guess is the variable hasn't been set yet.

Steps to set it.

  1. Right click the set variable action and select try and see if it changes.
  2. Run the macro to see if it changes.
  3. Open Preferences and search for VarName and insert hello.

KC

Yes, you can see it is set because it has hello > hello under the set variable.

Also it shows this is preferences

Interesting. Can you post the actual Macro? Mine looks fine.

Maybe something is afoot, on your system. It looks the same but try mine.

*Variable.kmmacros (1.9 KB)

Why are you testing to see if a variable name exists? equals, contains maybe but exist

Also suggest you add some simple display text and alerts to see which path is taken.

Only because that was making it obvious it wasn't working. Originally I wanted to use it to check a number was less than 50.

I just downloaded your macro and it still isn't working.

I am very confused about what to do! I suppose I could try a complete reinstall?

i suspect you are getting mixed up between variables that are text and numbers.
Try this macro and see if it works, then modify it to use a numeric test
WindowDual - set OVERRIDE as NONE, INTERNAL or EXTERNAL copy.kmmacros (5.6 KB)

perhaps it would be easier if I show you what I am trying.

Time currently = 0, which is less than 10, so why does it show as false?

Thanks

Use this condition test not the environment variable

image

I remember helping someone offline, with this, about a year ago but I think their trial expired or something.

Quit the Keyboard Maestro engine and Keyboard Maestro, reopen Keyboard Maestro, try it again and let us know.

You may have to send an email to support@stairways.com.

I'll search around to see if I can find the issue.

KC

Also, try the Help ➤ Assistance window, “Something expected is not happening” to see if something throws a reasonable response.