Are variables' contents synced across multiple devices like macros?

This is probably a simple question, but are variables' contents synced across devices like macros themselves are?

For instance, I just added a second monitor to my main computer, and have adjusted a lot of macros to take advantage of it. To make sure the macros continue to run properly on my MacBook, I added a set variable "Screen Count" to %Calculate%SCREENCOUNT% at login so the computer will set that variable according to how many monitors are connected, then I use that variable on any macros I have adjusted.

But does that variable's contents get synched back and forth like the macros themselves? Like if I login to my MacBook while my Mini is running, and it sets that variable to "1", will that "1" sync back to my Mini and cause it to run subsequent macros on only one monitor?

No. KM Variables, Clipboard History, and Named Clipboards are stored only on the Mac that KM is running on, and are NOT synced.

One alternative is to store the data you want sync'd in files in a system like DropBox.
Then, in KM use the Read a File action and Write a File action to use in your Macros.

You could also use a naming convention like "SYNC__MyVarName" to read all "sync" variables and write all, either periodically, or on demand.

@cdthomer: In the most constructive way possible I would like to suggest: You could have figured this out in one minute with a simple test. Only sayin' you can develop your skillz and benefit in the long run.

(Though @JMichaelTX has provided what is probably a more helpful response. Still…)

1 Like

I figured as much since it didn't appear the contents of the variables were changing on each computer as I would work on the other computer; but I wanted to be sure.

FWIW, I don't want this particular one to change. Since it runs at login, I want it to basically identify how many monitors are setup on a specific computer when it starts and be unaffected by any other computer I use Keyboard Maestro on.

Thanks for your help as always!

New question which is best placed in a new topic, but for now see: SCREENCOUNT function.

New question which is best placed in a new topic, but for now see: SCREENCOUNT function.

Actually I wasn't asking a question; sorry if it seemed like I was.

I was reading that very page the other day (after my old Windows PC died and I took it's old monitor and hooked it up as a secondary monitor to my Mac), and that's what gave me the idea to use SCREENCOUNT as a variable.