Welcome to MacBoardz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Changing Security Setting of Screensaver in 10.5

 
   Macintosh computer (Home) -> Apple Scripts RSS
Next:  External HD Doesn't Mount Automatically  
Author Message
Florian

External


Since: Mar 18, 2008
Posts: 9



(Msg. 1) Posted: Sun Dec 07, 2008 3:50 am
Post subject: Changing Security Setting of Screensaver in 10.5
Archived from groups: alt>comp>lang>applescript (more info?)

Hello

i am trying to write a toggle for the security setting of the
screensaver in Mac OS X.
I know i could do that by User-Interface scripting but thats not the
way i want to solve my issue.

From Sys-Prefs point of view the following code-snippet seems to work,
but it seems just to change the User-Interface -> so if the checkbox
is selected or not -> without doing what a user would expect.

Code-Snippet Start:

-- check setting
set output to do shell script "defaults -currentHost read
com.apple.screensaver askForPassword -int"
--
if output is "0" then
do shell script "defaults -currentHost write
com.apple.screensaver askForPassword -int 1"
tell application "System Events"
set value of property list item "askForPassword" of
property list file plistFile to 1
end tell
-- quick debug message
display dialog "pw enabled"
else
do shell script "defaults -currentHost write
com.apple.screensaver askForPassword -int 0"
tell application "System Events"
set value of property list item "askForPassword" of
property list file plistFile to 0
end tell
-- quick debug message
display dialog "pw disabled"
end if

-- start the screensaver to check if the setting which worked for
the UI in Sys-Prefs does what i would expect to do.
tell application "ScreenSaverEngine"
activate
end tell

Code-Snippet End:

Reached that point i started to take a look on fseventer which showed
me another plist to check in
/Users/myusername/Library/Preferences/ByHost/
com.apple.screensaver.SOMECRYTIC_MACHINE_SPECIFIC_THING_HERE_I_GUESS
which contains the askForPassword element too.

Im somehow wondering what i dont understand here and why my user-
interface displays something which is does not do in case of
screensaver start.

I hope my description is ok, if not feel free to ask and i'll try to
add as muchdetails as needed.
My target is to use this applescript code in a small Cocoa project as
part of a NSAppleScript if that matters.


Best regards
fidel

 >> Stay informed about: Changing Security Setting of Screensaver in 10.5 
Back to top
Login to vote
Simon Slavin1

External


Since: May 16, 2004
Posts: 543



(Msg. 2) Posted: Sun Dec 21, 2008 7:27 pm
Post subject: Re: Changing Security Setting of Screensaver in 10.5 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 07/12/2008, Florian wrote in message <72349d99-d5e3-45a0-bc9a-
5b926d0ae571 RemoveThis @33g2000yqm.googlegroups.com>:

> I hope my description is ok, if not feel free to ask and i'll try to
> add as muchdetails as needed.
> My target is to use this applescript code in a small Cocoa project as
> part of a NSAppleScript if that matters.

I understand your description, but I hope it's not possible to do what you
want, since this would allow someone to mess with admin settings without
knowing the admin password.

Simon.
--
http://www.hearsay.demon.co.uk

 >> Stay informed about: Changing Security Setting of Screensaver in 10.5 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
network apple events & security - Well, I finished my first project and am preparing for the second, and I just want to float an idea and get an opinion: How secure or network apple events on the public internet, compared to say, a web cgi via ssl? I have some code that manages an app...

Setting the Computer Name in OS X - We are in the process of setting up the disk image for our public Macs but as part of the cleaning up process post install we would like to change the Computer Name to hostname so that Apple Remote Desktop gets the correct name and not 200 instances of..

Setting the clipboard - Hi, I run a AS from Quickeys that get's info from the user and places it into the clipboard. Then quickeys uses that clipboard info for pasting into a application (Pro Tools). I found out that I need to clear the clipboard before I set it to make the..

setting AppleTalk configuration - I loaded Akua Sweets on my Powerbook 520 running 7.5.5 or 7.1. I wrote a "location and usage chooser" startup script setting TCP/IP, AppleTalk, FreePPP and FileSharing settings. One of my AppleTalk configurations is named NoNet. When trying to ...

setting startup disk on OS 9 - Any idea why this script won't work: tell application "Startup Disk" activate set startup disk alias to "Macintosh HD:" as alias end tell Couldn't Apple make things simple in Applescript and just have the command be something ...
   Macintosh computer (Home) -> Apple Scripts All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]