I'm beginning to use Keyboard Maestro and I think I'm making a rookie mistake, but I don't see any useful answers here and I can't understand what I'm doing wrong myself. So maybe you could help me…
I'm trying to set a variable from the current browser URL, using the token FrontBrowserURL. In the set variable action, the correct URL is picked up by Keyboard Maestro, but then, it's as if the variable does not exist at all.
Have you tried running the macro yet, or used the "Try" button at the bottom of the editor while the "Set Variable" action is selected? Until you do either of those things (or manually create the variable in KM's preferences) the urlVideo variable won't exist, which is why the condition currently shows "false" and it only shows an empty string when displayed.
Hmm, that's certainly strange; an identical macro works fine for me:
By any chance, are you using Chrome for the front browser? There are some problems with the current release version of Chrome that prevent KM's browser actions from functioning properly; it's possible that could explain what you're seeing.
You can see the token is working because Keyboard Maestro is showing you what it will set the variable to (at the bottom of the action).
You can also see the variable is currently empty.
If clicking Try on the action does not set the variable, then my guess is your variable database has become corrupted somehow.
Select Help ➤ Open Preferences Folder
and then move your “Keyboard Maestro Variables.sqlite” file to your desktop, then relaunch the Keyboard Maestro Engine and Keyboard Maestro editor.
See if that resolves the problem.
You might like to send the broken “Keyboard Maestro Variables.sqlite” file to support so I can see if I can duplicate the corruption and then auto-detect it and reset the database.
I think there is an issue somewhere with this file… I followed the procedure, but it's still not working. The database is created upon reopening, but I can't register a new variable.
Looking quickly inside the database, I saw earlier variables I created, but on a different computer. Maybe it's the source of the problem ?
Anyway, I'm sending you the file by mail to see if you can debug me.
So if you quit Keyboard Maestro and Keyboard Maestro Engine, and then trash the file, and then launch Keyboard Maestro, is the file created? And if you then change a variable in the Preferences, Variables pane, does that stick across relaunching Keyboard Maestro?