• Re: How to deep-sleep via command line?

    From Frederick Cheung@fglc2@srcf.DUH.ucam.org to comp.sys.mac.system on Wednesday, July 23, 2003 18:35:58
    From Newsgroup: comp.sys.mac.system

    On Wed, 23 Jul 2003, Sandman wrote:

    In article <b133d89.0307221621.3fdc7968@posting.google.com>,
    steven@kan.org (Steven Kan) wrote:

    sudo osascript -e 'tell application \"Finder\" to sleep'

    this only works if the Finder is running (i.e. someone is logged in).
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    Does this mean logged in graphically, or would my SSH login qualify?

    No, the Finder needs to be running, which it doesn't if no one is logged in 'grapichally'

    Is there any way I can trigger a graphical login from my SSH session
    and _then_ tell it to go to sleep?

    I don't think so no.

    you can send a sleep appleevent to the loginwindow process but you can't
    talk to it via applescript, so writing a small program that does that
    might work. However i seem to recall that sending applevents from a
    process not run by a graphically logged in user is kinda icky.

    Fred

    --- Synchronet 3.18b-Win32 NewsLink 1.113