screensaver with password and different to default

Hi everybody,
I 'm using this script to run a screen saver different to default.

do shell script "/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -module MyScreenSaver &"

Now I would like to run the same script with password. I found this script, but I don’t know how to mix both

set previousState to SsaverPwordState({})
SsaverPwordState(1)
tell application "ScreenSaverEngine" to run
delay 5
SsaverPwordState(previousState)


on SsaverPwordState(parameter)
	set {previousDelimiter, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ""}
	set macAddress to (words 2 thru -1 of (do shell script "ifconfig en0 | grep ether")) as string
	set preferenceFile to "" & POSIX path of (path to preferences as string) & "ByHost/com.apple.screensaver." & macAddress
	if parameter is not {} then
		do shell script "defaults write " & preferenceFile & " askForPassword " & parameter
	end if
	set PwordState to "defaults read " & preferenceFile & " askForPassword "
	set AppleScript's text item delimiters to previousDelimiter
	return (do shell script PwordState) as integer
end SsaverPwordState

I appreciatte any help

You could try to add ‘with administrator privileges’ to the do shell script

I use a different method of returning the MAC address, the ‘tr -d :’ delimits out the colons. Your method of getting the MAC address works too.

I used this code, and run with both options ok