Idea: Remote Actions

Hi,

I need to make sure that a specific application is only running on one of my computers. So when the app launches, I need to quit it on my other computer. I thought about implementing that by abusing dropbox as a message queue system. When the app starts, I create a file with the machine name and then have a macro that executes when that file exists and terminate the app. If anyone has a better idea, I would be happy for suggestions.

However that made me think, wouldn’t built in “remote actions”, that trigger something on another computer, be a great feature for future version? You could also just use the macro syncing feature to send the command to the other machines.

Julian

You're on the right track with the dropbox preference file sync. I've got a somewhat monkey'd out way to sync variables which would get you close to the right place, too. But automating a way to set that macro to set a different variable isn't trivial.

Interesting. How do you actually move the variable values to the other machines? Are you writing them to a file that gets synced as well?

I manually edit the action that sets the variables. When the action syncs
and the other computers are logged in, they’ll execute the action. That’s
the challenge with automating it - you can’t automate Keyboard Maestro
macro creation. (Ironically enough)

Hey Nik,

Yes, you can. But it's a bit complicated.

-Chris

Only ways I know to do that would be either scripting via the UX or messing with the XML of the macros. Is there a simpler way you know of, or is that it?

It looks like you can use Apple Scripts for that. I might be wrong, though:
http://www.keyboardmaestro.com/documentation/7/scripting.html

You can save a template of the macro you want to auto-create, change the XML, and import.

Like I said “it's a bit complicated”.

-Chris

Hey Julian,

You can probably use the shell to ssh into the system in question to test directly if a process is running.

You'll have to enable remote log-in on that system.

I haven't done this in years, so you'll have to have fun with Google to find the right syntax.

Something roughly like this:

ssh user1@server1 ps -a -x -c -o comm | egrep -i "bbedit"

'bbedit' being a stand-in for your process.

Here's a couple of hints to get you started:

http://www.cyberciti.biz/faq/unix-linux-execute-command-using-ssh/

-Chris