I don't have an account password set on my machine, and I sometimes use sudo -s in the Terminal to do advanced stuff. Since 10.6, Apple has required an account password to use sudo, which requires me to open the Accounts preference pane and reset my account password to a dummy password (I just use the number 1) to enable the sudo shell. Then I have to trek back there to reset it to nothing after my sudo business is finished. I was looking to make an AppleScript that would enable me just to double-click an app-ified AppleScript to change the password to "1" and back to nothing again. So far, I've found this script:
That's great, but it doesn't work the other way around:
gives me an error: "Please enter the user's old password."
My original idea was to use this script as a starting point, but I'm not well-versed enough in AppleScript to adapt it successfully:
Does anyone have any ideas that would help me out? Thanks!
Code:
do shell script "dscl . -passwd /Users/[username] 1"
Code:
do shell script "dscl . -passwd /Users/[username] "
My original idea was to use this script as a starting point, but I'm not well-versed enough in AppleScript to adapt it successfully:
Code:
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
click menu item "Sharing" of menu "View" of menu bar 1
delay 2
tell window "Sharing"
click checkbox 1 of row 11 of table 1 of scroll area 1 of group 1
delay 1
if (exists sheet 1) then
if (exists button "Turn AirPort On" of sheet 1) then
click button "Turn AirPort On" of sheet 1
delay 1
end if
click button "Start" of sheet 1
end if
end tell
end tell
end tell
Does anyone have any ideas that would help me out? Thanks!