• 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: Telling remote Finder to sleep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Telling remote Finder to sleep


  • Subject: Re: Telling remote Finder to sleep
  • From: Chris Page <email@hidden>
  • Date: Thu, 25 Jun 2009 18:57:53 -0700

On Jun 25, 2009, at 12:18 PM, Steve Mills wrote:

On Jun 25, 2009, at 14:05:25, Deivy Petrescu wrote:

"sleep" is an System Events event.

It's also a Finder event in the Legacy suite.

On Jun 25, 2009, at 9:44 AM, Deivy Petrescu wrote:

Actually, using the Finder and the bonjour name of the Mac works fine here.
System Events does not!

Interesting, because few OS's ago (I really can't remember which OS!), System Events was the way to go for remote scripting.
Now it will not work.
It complains that the app is not running.
May be this was brought upon us by security reasons.
Both Chris's can elaborate on that

Here’s the scoop:

• “sleep” and some other events were originally handled by Finder. Now they are handled by System Events.

• If you send one of these events to Finder, it returns an error that tells AppleScript to send the event to System Events instead. If you run the script in Script Editor and look at the event log, you should see this sequence of events.

• Unlike local events, when you send an event to a remote machine, it will not automatically launch applications that aren’t running. They must already be open, or you must explicitly tell Finder to open them. System Events is not always running, so you may need to have your script explicitly tell Finder to open it when it isn’t already open, if you can’t arrange for it to always be open on the target machine.

• When you send an event to Finder on a remote machine and it is redirected by AppleScript to System Events, AppleScript automatically tells Finder to open System Events if it isn’t already open, then attempts to send the event to System Events again. Script Editor’s event log will contain a series of events reflecting this.

If this isn’t working for you, please reproduce the problem in a short script and post the script and the event log here.

Note that the details of these behaviors changed over time, and you indicated that you’re working with two different Mac OS X versions, so this automatic behavior may not work for your situation and you may need to arrange for System Events to be open, as I mentioned above.

-- 
Chris Page

 The other, other AppleScript Chris

 _______________________________________________
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: Telling remote Finder to sleep
      • From: Deivy Marck Petrescu <email@hidden>
References: 
 >Re: Telling remote Finder to sleep (From: Matt Neuburg <email@hidden>)
 >Re: Telling remote Finder to sleep (From: Steve Mills <email@hidden>)
 >Re: Telling remote Finder to sleep (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: Re: Mac OS X 10.4: using osascript to interact with users
  • Next by Date: Re: Mac OS X 10.4: using osascript to interact with users
  • Previous by thread: Re: Telling remote Finder to sleep
  • Next by thread: Re: Telling remote Finder to sleep
  • Index(es):
    • Date
    • Thread