| Author |
Message |
|
cyberwoozle
Joined: Jan 05, 2010 Posts: 2
|
 launch/quit application on another machine
I'm trying to use apple events to launch or quit a video server on a machine that isn't my Indigo server. here's the code I'm using: - Code: Select all
tell application "Air Video Server.app" of machine "eppc://<user>:<pass>@helium.local" activate end tell
which works perfectly on "helium", but when I try it from my Indigo machine, I get an applescript error "Application isn't running" now, if I manually launch Air Video Server, then send: - Code: Select all
tell application "Air Video Server.app" of machine "eppc://<user>:<pass>@helium.local" quit end tell
It works like a charm. this seems like I'm missing something really basic (like how to tell an application to open, or how to tell Finder to open and app, or...) I've scoured around, but haven't found the magical cure. any assistance would be awesome.
|
| Wed Sep 22, 2010 8:54 pm |
|
 |
|
jay (support)
Site Admin
Joined: Mar 19, 2008 Posts: 6661 Location: Austin, Texas
|
 Re: launch/quit application on another machine
When an app on a remote machine isn't running, you have to tell the Finder to launch it. I don't have an example handy but you should be able to google it.
_________________ Jay (Indigo Support)
|
| Thu Sep 23, 2010 7:34 am |
|
 |
|
cyberwoozle
Joined: Jan 05, 2010 Posts: 2
|
 Re: launch/quit application on another machine
ok, so I've added this: - Code: Select all
tell application "Finder" of machine "eppc://<user>:<pass>@helium.local:3031" launch application "iCal" of machine "eppc://<user>:<pass>@helium.local:3031" end tell
and I see a log entry write to helium's Console, but now nothing happens, and I receive no errors on either system. (I also tried it with and without the port)
|
| Thu Sep 23, 2010 7:34 pm |
|
 |
|
jay (support)
Site Admin
Joined: Mar 19, 2008 Posts: 6661 Location: Austin, Texas
|
 Re: launch/quit application on another machine
Yeah, that isn't right. Something like this should work: - Code: Select all
tell application "Finder" of machine "eppc://USER:PASS@helium.local" open application file (POSIX file "/Applications/iCal.app") end tell
tell application "iCal" of machine "eppc://USER:PASS@helium.local" -- Do whatever you need to do here end tell
Substitute the full path to the application you want to launch and it should work. If the application is already running, it should become the active application. You can then target the application on that machine and do whatever you need.
_________________ Jay (Indigo Support)
|
| Thu Sep 23, 2010 9:02 pm |
|
 |
|
Matt
Joined: Aug 13, 2006 Posts: 390 Location: Northern Idaho
|
 Re: launch/quit application on another machine
I use the following scripts:
try tell application "Finder" of machine "eppc://Username:password@192.168.0.199:3031" using terms from application "Finder" if "TeamViewer" is not in (get name of processes) then open application file id "com.TeamViewer.TeamViewer" end using terms from end tell end try
try tell application "TeamViewer" of machine "eppc://Username:password@192.168.0.199:3031" quit end tell end try
_________________
|
| Fri Sep 24, 2010 7:36 am |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 Re: launch/quit application on another machine
Matt wrote:I use the following scripts: ... if "TeamViewer" is not in (get name of processes) then open application file id "com.TeamViewer.TeamViewer" ...
[Slight topic drift] Matt, specific to TeamViewer, how do you determine the TeamViewer password for the remote machine so you can open the actual TeamViewer connection (which is, presumably, why you are doing this)?
|
| Fri Sep 24, 2010 10:19 am |
|
 |
|
Matt
Joined: Aug 13, 2006 Posts: 390 Location: Northern Idaho
|
 Re: launch/quit application on another machine
It's pretty simple. I have Script Timer set up to launch a script when TeamViewer is started. This is very handy when I am at work and realize there is a bug or a setting I need to fix within my Indigo database.
It launches this script:
activate application "TeamViewer" tell application "System Events" delay 5 tell process "TeamViewer" set pword to (value of (get static text 2 of group 1 of window "TeamViewer") as integer) end tell end tell
tell application "IndigoServer" of machine "eppc://[EDITEDOUT]@192.168.0.197:3031" set value of variable "TeamServerPasswordOffice" to pword end tell
I also have a trigger in Indigo set to email me the password when the variable changes.
Just a side note: You can also set a permanent password from the Preferences within TeamViewer.
_________________
|
| Fri Sep 24, 2010 11:00 am |
|
 |
|
jay (support)
Site Admin
Joined: Mar 19, 2008 Posts: 6661 Location: Austin, Texas
|
 Re: launch/quit application on another machine
Hey Matt, I edited your post above to remove your password but I'm afraid Google probably has it in cache now so you might want to consider changing it...
_________________ Jay (Indigo Support)
|
| Fri Sep 24, 2010 11:17 am |
|
 |
|
Matt
Joined: Aug 13, 2006 Posts: 390 Location: Northern Idaho
|
 Re: launch/quit application on another machine
Thanks Jay, forgot to review my post before submitting.
_________________
|
| Fri Sep 24, 2010 11:28 am |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 Re: launch/quit application on another machine
Matt wrote:It's pretty simple... ...Just a side note: You can also set a permanent password from the Preferences within TeamViewer.
Thanks. The script timer is pretty clever. BTW, I just noticed the permanent password option while you were posting this information 
|
| Fri Sep 24, 2010 11:35 am |
|
|