Tuesday, February 25, 2020

#1 2020-01-24 11:59:38 am

Veiss
Member
Registered: 2020-01-24
Posts: 2

Launch application on remote machine with EPPC - Newb

Hello, I'm trying to launch a closed application on a remote computer with this code-

Applescript:

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

Model: Mac Mini
Operating System: macOS 10.14


Filed under: eppc

Offline

 

#2 2020-01-24 07:19:53 pm

maro
Member
From:: Nerima, Tokyo, Japan
Registered: 2004-05-30
Posts: 61
Website

Re: Launch application on remote machine with EPPC - Newb

Older version of macOS allowed to call applications remotely. Not in recent version (After 10.7 ?).

There is the only application allowed to accept eppc, AppleScript applet.

So, you have to call AppleScript applet on remote machine then applet calls application and returns result.

eppcmini.png

Model: MacBook Pro 2012
AppleScript: 2.7
Browser: Safari 13.0.1
Operating System: macOS 10.14

Last edited by maro (2020-01-24 07:21:09 pm)


I wrote thousands of AppleScript to realize my idea. Natural language interface, voice recognition commander and so on. Though my mother toungue is strange language, Japanese, my most frequently write language is AppleScript. I believe it is for making things easy and powerful.

Offline

 

#3 2020-01-25 05:43:07 am

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11668
Website

Re: Launch application on remote machine with EPPC - Newb

maro wrote:

Older version of macOS allowed to call applications remotely. Not in recent version (After 10.7 ?).

There is the only application allowed to accept eppc, AppleScript applet.

So, you have to call AppleScript applet on remote machine then applet calls application and returns result.



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

Applescript:

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.

Last edited by StefanK (2020-01-25 05:51:11 am)


regards

Stefan

Offline

 

#4 2020-01-25 04:01:42 pm

Veiss
Member
Registered: 2020-01-24
Posts: 2

Re: Launch application on remote machine with EPPC - Newb

Thank you! big_smile

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!

Last edited by Veiss (2020-01-25 04:02:17 pm)

Offline

 

#5 2020-01-25 09:24:38 pm

maro
Member
From:: Nerima, Tokyo, Japan
Registered: 2004-05-30
Posts: 61
Website

Re: Launch application on remote machine with EPPC - Newb

StefanK wrote:
maro wrote:

Older version of macOS allowed to call applications remotely. Not in recent version (After 10.7 ?).

There is the only application allowed to accept eppc, AppleScript applet.

So, you have to call AppleScript applet on remote machine then applet calls application and returns result.



Sorry, maro, this is wrong. You can launch applications with Remote Apple Events even on Catalina machines.



lol

Big surprise!! It is my misunderstanding. Wao.


I wrote thousands of AppleScript to realize my idea. Natural language interface, voice recognition commander and so on. Though my mother toungue is strange language, Japanese, my most frequently write language is AppleScript. I believe it is for making things easy and powerful.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)