Practical way of maintaining a variable value across different Macs?

I know that variables and clipboards are not synced across Macs, so I'm after a suggestion for how I might work around this?

I have some processes that I primarily run on one Mac, but sometimes (and it's the exception) I need to do these on another Mac. Part of the process involves keeping a daily count of some items, but also a longer term count. When I switch to the other machine, it's not an issue for the daily count (if I start the day on that other computer) as one of the processes is to reset the daily count. But for the long term count (a running total of the daily counts), I cannot simply reset that.

I am guessing the simplest approach would be to write the value to a text file that is synced - e.g. iCloud drive) and to use that instead? My reticence with that is that sometimes the iCloud drive is not syncing in a timely fashion. KM variables are instant, whereas iCloud can sometimes get locked up and take days to resolve syncing issues.

Current thinking is to read the value from the text file in the morning at a set time that I am confident is good to update a local variable, then maintain that KM variable and writing back to text file at the end of the day. A hybrid solution.

Any thoughts about how else I might do this?

Your idea of writing and then reading the variable value to a text file that is kept in sync via Cloud syncing is the way to do this.

I use Dropbox to do this and it syncs instantly (by default I think Dropbox syncs smallest files first). A free Dropbox account would easily handle this.

1 Like

Syncing a text file is reasonable, but I agree, iCloud is sadly not up to the task.

Dropbox would likely be fine.

Assuming the main Mac is online and awake at all times, you can query it for information using the Remote trigger and Remote Trigger action.

For example, your secondary Mac could trigger a macro on your primary Mac, which in turn would trigger a macro on your secondary Mac including as a parameter your total count. Similarly you could send the resulting total macro to the primary Mac at the end.

1 Like