• 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: New to AppleScript, looking to login as a different user...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New to AppleScript, looking to login as a different user...


  • Subject: Re: New to AppleScript, looking to login as a different user...
  • From: "John C. Welch" <email@hidden>
  • Date: Thu, 24 Aug 2006 10:24:45 -0500
  • Thread-topic: New to AppleScript, looking to login as a different user...

On 8/24/06 01:09, "Joseph Trexler" <email@hidden> wrote:

> So, I've discovered VNC and want to use it during the day while I'm
> at work.  The problem is that my wife uses the computer at home under
> her account.  Most of the time, she doesn't launch my account, then
> fast user switch to her account.  I'm trying to figure out how to
> write a script to be triggered when she logs in that does the following:
>
> Triggering action: User B logs into the machine.
> Script actions:
> 1) Login as User A
> 2) Optional - Launch OSXVnc - (this is configured to fire when I
> login, but I'm not sure if that still happens when logging in via
> script)
> 3) Launch iPhoto (to share libraries)
> 4) Fast User switch back to User B
>
> Since this is all on the same machine, I'm not worried about
> passwords being passed in clear text as it's just the two of us.

This is done via a rather obscure command line application, cd
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/
CGSession

There's no real man page, so most of what I've doped out is via the strings
command on the executable, with trial and error

To Fast User Switch to the login screen:

sudo /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/
CGSession -suspend

I'm guessing that

sudo /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/
CGSession -switchToUserID

with the correct UserID is what you need here.

--
"With over 50 cars already on sale here, the Japanese auto industry isn't
likely to carve out a big slice of the U.S. market for itself."

commentary in Business Week magazine, 1968


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: New to AppleScript, looking to login as a different user...
      • From: Joseph Trexler <email@hidden>
References: 
 >New to AppleScript, looking to login as a different user... (From: Joseph Trexler <email@hidden>)

  • Prev by Date: Re: New to AppleScript, looking to login as a different user...
  • Next by Date: Re: Post to Exchange Public Folder Using Entourage 2004
  • Previous by thread: Re: New to AppleScript, looking to login as a different user...
  • Next by thread: Re: New to AppleScript, looking to login as a different user...
  • Index(es):
    • Date
    • Thread