Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Lock and unlock a Mac using Bluetooth detection' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Lock and unlock a Mac using Bluetooth detection
Authored by: puzzlebobble on Jan 05, '10 01:04:15PM

think I got it:

tell application "Keychain Scripting"
set thePW to the password of first key of current keychain whose name is "AdminPassword"
delay 1
try
do shell script "sudo pmset -a disksleep 15" password thePW with administrator privileges
on error
display dialog "Oops. Wrong password?"
end try
end tell

sets all setting for spindown to 15 minutes. Now to have different for battery power etc...



[ Reply to This | # ]
Lock and unlock a Mac using Bluetooth detection
Authored by: everkleer80 on Jan 06, '10 06:09:29AM

Cool. I don't think you need "sudo", as the "with administrator privileges" gives the script the same rights as sudo. I read here that using both can create some kind of security hole, though I'm not sure how and the article doesn't explain.



[ Reply to This | # ]