Keyboard Maestro Script Error On Applescript That Previously Worked

Did anything change with the new release that would cause a previously successful macro using the AppleScript below to fail with the following error?

/var/folders/8l/d8k02sns5jl42_zp_hcpqtfh0000gp/T/Keyboard-Maestro-Script-B61B8B86-1155-44D7-B1D2-273DC68ECEF8:645:697: execution error: Keyboard Maestro Engine got an error: Can’t set variable "Employee_Row" to "102". (-10006)

Review_Date shows up blank in the preferences pane and Employee_Row does not show up at all. This worked previously and I'm not sure if cleaning up and removing (i.e. deleting) old leftover variables caused the issue or the new release.

Apparently you have cleaned up your Employee_Row variable. Re-create it and it should work again.

(You can directly create it in Preferences > Variables, or you insert a Set Variable action before the AppleScript action.)

You can also change the AppleScript so that it creates the variable and sets the value:

tell application "Keyboard Maestro Engine"
  setvariable "Employee_Row" to fRow as text
end tell

This needs KM 7.1 or later.

See also the Wiki article for details and alternatives.

Thanks Tom,

I used the KM documentation (maybe older) and made the following changes, but now have to get the date string in the proper format.

Both versions are working here:

set myVar to current date

tell application "Keyboard Maestro Engine"
  setvariable "zzzzDate" to date string of myVar
end tell

tell application "Keyboard Maestro Engine"
  make variable with properties {name:"zzzzDate", value:date string of myVar}
end tell

Tom,

Same on this end once corrected!

Many thanks!