Hello, I’m trying to launch a closed application on a remote computer with this code-
tell application "Finder" of machine "eppc://user:pass@machine.local" to ¬
launch application "Transmission" of machine "eppc://user:pass@machine.local"
I have Transmission as the application here for testing. It works fine with the quit application command. Eventually I’ll be launching an automator workflow saved as an application. If there’s an easier way to do it using just the workflow that’s cool too.
When running the workflow on the main computer I don’t get the usual “application isn’t running” message when using the open command. Nothing happens.
Is the first line with Finder necessary, or is there a better method?
Thanks
Sorry, maro, this is wrong. You can launch applications with Remote Apple Events even on Catalina machines.
First of all enable Remote Apple Events in System Preferences > Sharing on the target machine.
As the Finder is the only application which is guaranteed to run you have to tell the Finder to launch the app.
This opens Safari on the target machine. Replace literal name “Safari” and bundle identifier “com.apple.Safari” with the corresponding values of Transmission
set RemoteMachine to "eppc://user:pass@machine.local"
tell application "Finder" of machine RemoteMachine
using terms from application "Finder"
if "Safari" is not in (get name of processes) then
open application file id "com.apple.Safari"
repeat until "Safari" is in (get name of processes)
delay 1
end repeat
end if
end using terms from
end tell
The repeat loop is only necessary if you want to proceed to send Apple Events to the application.
Now I can use a key on my keyboard to put my computer to sleep and run an automator app on my Savant host to turn off all my speakers, displays, and powered music equipment at the same time!