• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Remote AppleScripting oddness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Remote AppleScripting oddness


  • Subject: Re: Remote AppleScripting oddness
  • From: Stan Cleveland <email@hidden>
  • Date: Wed, 12 Jan 2011 18:57:29 -0800

On Jan 12, 2011, at 6:03 PM, Alex Zavatone wrote:

I've been back (finally) into remote AppleScripting and am starting form the basics again with getting applications to launch and seeing what's permitted.

It seems that there are serious limitations on messaging remote applescript applications and even System Events.

For example, If I have an AppleScript that launches another app on a remote mac like so:

using terms from application "Finder"
tell application "Finder" of machine "eppc://fred:email@hidden"
set myApp to ("/Applications/Hi.app" as POSIX file) --as alias)
open myApp

end tell
end using terms from

Then my app will launch on the Stones mac just fine.  However, if I try this:

using terms from application "System Events"
tell application "System Events" of machine "eppc://optimizer:email@hidden"
return "Hi."

end tell
end using terms from

I'll get an error -600, "Application isn't running".  But of course System Events is running.  With the "of machine" section, the script runs just fine on the target machine and System Events is in the process list.

tell application "System Events"
return the name of every process as list
end tell

Is there some new security model that prevents apps like System Events from being remotely executed, yet never gives you the correct error message?  

Hi Alex,

While I'm not experienced at remote scripting, I have noticed that System Events is not running all the time. In fact, if not accessed by a script, after awhile it will self-quit. So it's very possible that it's NOT running on your remote Mac. 

Your local script (on that remote Mac) is not very helpful, since it causes System Events to launch (if it wasn't already running) and THEN it returns the list of running processes. Instead, try the 'top' command in Terminal to get a list of running apps. (There may be other, better ways, but 'top' will do the trick.)

Is there a way to launch an app on the remote machine? That's what you need, I believe.

HTH,
Stan C.

Who thinks that waking someone up to ask them if they're awake will always result in the same response—"yes."

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Remote AppleScripting oddness
      • From: Alex Zavatone <email@hidden>
References: 
 >Remote AppleScripting oddness (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Remote scripting 10.6.x calling 10.5.x
  • Next by Date: Re: How to delete extraneous plist files via AppleScript
  • Previous by thread: Remote AppleScripting oddness
  • Next by thread: Re: Remote AppleScripting oddness
  • Index(es):
    • Date
    • Thread