• 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: Joseph Trexler <email@hidden>
  • Date: Thu, 24 Aug 2006 20:14:06 -0500

You Rock!!  Thanks a bunch!!!!!!!!

-JB
On Aug 24, 2006, at 10:24 AM, John C. Welch wrote:

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 (Applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com


This email sent to email@hidden

_______________________________________________ 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
References: 
 >Re: New to AppleScript, looking to login as a different user... (From: "John C. Welch" <email@hidden>)

  • Prev by Date: Re: Warnings from Terminal and problems running an AppleScript with osascript
  • Next by Date: iTunes and persistent ID
  • Previous by thread: Re: New to AppleScript, looking to login as a different user...
  • Next by thread: Printing Microsoft Word to a PDF
  • Index(es):
    • Date
    • Thread