• 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: Automatic login
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automatic login


  • Subject: Re: Automatic login
  • From: Axel Luttgens <email@hidden>
  • Date: Thu, 7 May 2009 14:41:15 +0200

Le 7 mai 09 à 14:14, Jess McKenzie a écrit :

Hi,
I'm trying to write a script that sets the automatic login on a mac to the currently-logged-in user. I have written the script below, and it seems to work... but not always.
If automatic login is already set to another user on that computer, when you run the script it succeeds in changing it to the current user. However, if automatic login is disabled, the script will run with no errors, but it takes no affect on the autologin preference, leaving it as disabled. Does anyone know if i am doing something wrong in my script?


Thanking in advance...


property shortName : ""

try
	do shell script "echo $USER"
end try

set shortName to result

display dialog "This application perceives that you are currently logged in as: " & shortName buttons {"Deny", "Confirm"} cancel button "Deny" default button "Confirm"

try
do shell script "sudo defaults write /Library/Preferences/ com.apple.loginwindow autoLoginUser " & shortName with administrator privileges
end try

Hello Jess,

It seems there's also a boolean "com.apple.userspref.DisableAutoLogin" to be updated into /Library/Preferences/.GlobalPreferences.plist.

Also, there should no need to invoke sudo (may even be problematic), since "with administrator privileges" already provides the needed functionality.

HTH,
Axel


_______________________________________________ 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: Automatic login
      • From: Jess McKenzie <email@hidden>
    • Re: Automatic login
      • From: Ronald Hofmann <email@hidden>
References: 
 >Automatic login (From: Jess McKenzie <email@hidden>)

  • Prev by Date: Automatic login
  • Next by Date: Re: Automatic login
  • Previous by thread: Automatic login
  • Next by thread: Re: Automatic login
  • Index(es):
    • Date
    • Thread