![]() |
Opening an app on a remote machine
i was wondering if there is any UNIX command that would open an applicatioin on a remote machine (although the machine will be on my lan).
|
Sort of.. log into the remote machine and type:
open /Path/To/Application But in order to have it work, you must be the same user as whomever is currently logged in on the remote machine. By that I mean, doing a 'whoami', the returned value (username) must match the username of the person who is currently logged into the remote Mac. Otherwise it won't work. |
how might i log in to the remote machine? ssh?
|
Nope, you have to be logged in to the GUI.
Clarification: You have 2 Macs. 1 Local, 1 Remote. Say you want to start an Aqua app on the remote Mac (an app that requires the Aqua GUI in order to be displayed, like Safari for example) from your local Mac. Before you even bother sshing to the remote Mac, you (your user) MUST be logged into that remote Mac, as if you sat down at it and logged in. OR, after you have ssh'd into the remote Mac, you MUST be able to switch the shell to be 'owned' by the user that is currently logged in, which means you need to know their password. If you cannot meat either of those requirements, you cannot open an application that requires the Aqua GUI on the remote Mac. |
Running remote app locally
Now, if you want to run an application that is stored on a remote machine on your local machine, all you would need to do is use the "Connect to Server" command in your local machines finder. Once the remote machine's hard drive has mounted, you should be able to navigate and lauch any application that you have permissions to.
Note: this does require that you have a valid login to the remote machine, but does not require you to have a GUI launched (be logged in there too!) on the remote machine. |
thanks but that's not quite looking for...
when i tried logging into the remote machine, something weird happened. i had even created an identical user of the remote machine's user on my computer, to make sure everything would go fine. i tried SSHing into the the computer via the terminal. i had the same username as the one (logged in) on the remote machine. when putting in the password to the other user i was denied access. so i checked up on the system preferences on the remote machine, but i had remote login checked. again and again i was denied access when i had the same username, same password as the remote user. what's happening? |
Your username and password on the local machine are not relevant when using ssh. You merely need to specify the name of the remote account by using the "-l" option (that's a lowercase L) and you give the password when prompted for it.
What command (in Terminal) are you using and what happens? |
so for when i try this at home, what will the line of command look like when i place it in the terminal?
|
You must be logged into the remote Mac. I don't mean ssh'd in, I mean that you must sit down at it and login (unless you use Timbuktu or something, where sitting is not required, and which would make all this pointless). Then on your home Mac, ssh into the remote Mac.
Code:
ssh -l youruserontheremotemac ip.address.oftheremote.macCode:
ssh youruserontheremotemac@ipaddress.oftheremote.macCode:
open /Path/To/Applications/you_want_to_open |
Applescript
I just say:
ignoring application responses tell application "Entourage" of machine "eppc://Gnarlodious-Cube.local" to quit end ignoring For this to work you need to have "Remote Apple Events" enabled in the Sharing Prefpanel. Starting an app should be the same as quitting it. Keep in mind there are two names for some applications, for example this script needs "Entourage" but the official name is "Microsoft Entourage". Apple says they will fix it soon, but meanwhile just stab around. -- Gnarlie's Applescript page http://www.Gnarlodious.com/Mac/AppleScript/Page.html |
is there a close or quit command, to end the program?
|
The script I offered quits Entourage so I can synchronize the database.
There is a way to launch applications too but I don't know the terminology. If you figure it out please post it here! |
if you really want to do it in applescript:
tell application "Finder" to launch application "Entourage" |
closing an application with the terminal
to close an app in the terminal type: osascript -e 'tell application "app name" to quit'
ex: osascript -e 'tell application "Mail" to quit' i found this excellent advice in this thread. |
Open a remote application
Ha! got it:
tell application "Finder" of machine "eppc://Gnarlodious-TiBook.local" to open ":Applications:iTunes" I guess it's necessary to send the path to the file to open. If you don't the local app opens. Strange. |
Me too
I'm having problems with this too.
I can't open the remote application via applescript. The chief problem is I can't get a path to the remote application, only to the local one. This fails with an error: using terms from application "Finder" tell application "Finder" of machine remotemachine set theprocs to the name of every process if "DevonThink Pro" is not in theprocs then ---open application "DEVONthink Pro" ---tell application "DEVONthink Pro" of machine remotemachine to open set tp to path to (application "DEVONThink Pro" of machine remotemachine) end if end tell end using terms from set result to tp |
Quote:
|
eppc now working in 10.4.3...
What do you mean you can't get the path? The path to the app you want to open?
I tried this just now and it's working: Code:
tell application "Finder" of machine "eppc://Gnarlodious-Cube.local" to open ":Applications:iTunes"Wonder when they fixed it. Or at least, half fixed it. |
yes, I an't get the path to the app I want to open on the remote machine. of course i know the path, but I'm writing a studio application, and i have to have the remote finder GET the path somehow. unfortunately in the examples I cited the remote finder apparently mistakenly gets the path to the local version of the application i want to open with set tp to path to....
|
What versions OS are you running?
|
Quote:
|
Is "Remote Apple Events" enabled in the Sharing Prefpanel?
|
Quote:
try this: move an application to a different location on a remote mac than the same application is on on your local mac. set remotemachine to "eppc://your.remote.mac.local" using terms from application "finder" tell application "finder" of machine remotemachine set tp to path to (application "YOUR_MOVED_APPLICATION") end tell end using terms from my guess is you'll also get the path to the local rather than the remote copy of the application. |
I found the syntax that works:
open (application file id "XXXX" as alias) -- xxxx is the creator code |
| All times are GMT -5. The time now is 10:35 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.