What Is Best Way to Copy All KM Variables to Another Mac?

###What Is Best Way to Copy All KM Variables to Another Mac?

I now have a lot of Macros that use “permanent” KM Variables.
I need those Variables on another Mac.

Is there an easy way to do this?
Are they all in a giant plist somewhere?

Or do I have to write a macro/script to go though all Variables and save to file?

Within the KM Editor, under the Help menu is Open Preferences folder (which opens ~/Library/Application Support/Keyboard Maestro). In that folder is the file Keyboard Maestro Variables.plist.

1 Like

Thanks. Just what I was looking for. I'll give it a shot tomorrow.

As usual, make sure Keyboard Maestro and Keyboard Maestro Engine are not running on the target Mac.

Also, there isn’t a guarantee that the files will be up to date on the source Mac if you don’t quit Keyboard Maestro and Keyboard Maestro Engine there as well before copying the file. Some files will, some wont, it depends on the files.

1 Like

Many thanks @NaOH and @peternlewis.

This worked like a charm.
I copied both my KM Variables and Named Clipboards over to my new Mac, and it took them without any issues.

When I search this list it doesn't have several Variables that are found in the preferences in Keyboard Maestro editor?

~/Library/Application Support/Keyboard Maestro/Keyboard Maestro Variables.plist

Am I looking at the wrong file or does Keyboard Maestro pull those values

I am guessing that is from an old version of Keyboard Maestro and that I have several things that can be cleaned up in my Keyboard Maestro folder.

~/Library/Application Support/Keyboard Maestro/Keyboard Maestro Variables.sqlite

Probably an easier way to search for things and more efficient is why the change was made?

Just a guess... I wonder if default, built-in variables are stored in one file and user-created ones in another.

I suspect the plist has been superseded by the database -- I don't have the former (newbie!) but do have the latter. A suspicion that is reinforced by this, from 2019.

Easy enough for you to check, though -- Get Info on both and check the last modification dates... If the plist hasn't changed in yonks, why keep it?

1 Like

Please give an example of a "default, built-in variable." I've never seen one. Are you talking about tokens? They aren't variables, and aren't stored anywhere. They are evaluated at run-time.

My mistake. Thanks for the correction.

Good point, it was an old date 2017 so into the trash!

1 Like

Correct - the .plist is old and unused in modern Keyboard Maestro. Keyboard Maestro never deleted it because sometimes people revert to older versions (that's what trial periods are for after all), and variable files are generally very small.

2 Likes

I like the logic and sound thinking.