Is it possible to send a Keyboard Maestro variable from one Mac to another one which is in the same network, and both have Keyboard Maestro installed?
I tried with Applescript:
But I don´t know what do on the second Mac to grab this Variable. My aim is to send the Variable over and trigger another Macro there to save the Variable in Clipboard together with a Notification
One solution might be to use SSH, if you don't mind running sshd on the other Mac. (You can enable it under System Preferences, Sharing, Remote login)
Execute a shell script like this:
ssh MYUSERNAME@Pierres-MacBook-Pro.local "osascript -e 'display notification (\"Some text here\") with title \"Some title here\"'"
You would also need to set up a public key on your first machine, and add it to the authorized_hosts file on Pierres-MacBook-Pro.local, but it's probably a pretty clean/secure way to do it.
Just to explain what I'm doing real quick:
Connect via SSH to your laptop
Execute an AppleScript (using the command osascript)
Use the built-in display notification from AppleScript to show the notification (escaping the double quotes, because we already used those for the SSH-command)
Hey @MartijnEngler, thanks for your reply and the idea. SSH sounds good,I just set up a public key and add it to the macbook. But I found another shell script, that directly copy the clipboard to the laptops clipboard:
Looks like you have a solution that works for you, but for those that don't want to use SSH, or would like a more general solution, here's an untested idea:
Use a Cloud sharing tool like DropBox or iCloud, and create a "KM Variables" folder that both (all) Macs can read/write to.
To set a KM Variable, just write a text file using the KM Variable Name as the file name to that folder.
Then any Mac that wants sync to any KM Variable, can just read that file.
You can use the Remote trigger with a parameter value to send a value to another Mac (and execute a macro on the target Mac at the same time of course).
Just wanted to chime in on this old discussion. I needed to pass a variable from my laptop to my iMac every hour. I found the Remote Trigger did not always operate reliably on the Mac. I realized, though, that creating a folder in iCloud (or DropBox) if my value is True or deleting said folder if False gets the job done just as well.
I want to trigger different macros on my second Mac from my first Mac.
(The first Mac is attached to a Stream Deck and I want to use the Stream Deck to trigger videos, clips and animations on my second Mac. The second Mac is hooked to an ATEM mini using HDMI and I can then mix that channel to my program flow. The Program is used as a web cam in Zoom on my first Mac)
My thinking was that I set up macros on the first Mac and link them to buttons on the Stream Deck. The macros then trigger other macros on the second Mac. It feels like that should work but I have yet to find a way to do it.
I would like the most reliable way of doing it and I don't have experience in setting up the Remote trigger.
If anyone has some ideas, I would be very grateful to hear about them.
Create a macro on the target Mac, give it the Remote trigger.
Add an Display Text action, and display the text in a window, displaying %TriggerValue%.
Copy the URL of the remote trigger.
On the source Mac, add a Remote Trigger action. In the Parameter field, type “1234”. In the trigger field, include only the ID part of the URL - remove the https://trigger.keyboardmaestro.com/t/ from the front, and the ?TriggerValue from the end.
Clicking Try on the source Mac should show the “1234” on the target Mac.