Re: Property immutability
Re: Property immutability
- Subject: Re: Property immutability
- From: Paul Skinner <email@hidden>
- Date: Thu, 27 Feb 2003 20:12:34 -0500
On Thursday, February 27, 2003, at 03:13 PM, Paul Skinner wrote:
Snip
No the handler's aren't included. None of them contain any references
to lastSaverlaunched. I'll gladly post them if it helps. I'm hoping
I'm missing something obvious.
Paul Skinner
The missing handlers for those who are interested...
on getRunningSavers()
try
set ssInstances to do shell script "top -l1 | grep ScreenSave"
on error number 1
set ssInstances to {}
end try
set AppleScript's text item delimiters to return
set ssInstances to (text items of ssInstances) as list
repeat with i from 1 to length of ssInstances
set item i of ssInstances to (word 1 of (item i of ssInstances))
end repeat
return ssInstances
end getRunningSavers
on chooseSaver()
set defaultSaver to do shell script "defaults -currentHost read
com.apple.screensaver moduleName "
set chosen to choose from list (ListScreenSavers()) with prompt
"Choose a ScreenSaver to run on the Desktop" default items defaultSaver
return chosen as string
end chooseSaver
on ListScreenSavers()
set sssp to quoted form of (POSIX path of "System:Library:Screen
Savers:")
set lssp to quoted form of (POSIX path of "Library:Screen Savers:")
set ussp to quoted form of (POSIX path of (((path to current user
folder) as string) & "Library:Screen Savers:"))
set ssList to {}
repeat with d in {sssp, lssp, ussp}
set ssList to ssList & paragraphs of (do shell script (" cd " & d as
string) & " ; ls")
end repeat
set AppleScript's text item delimiters to "."
repeat with i from 1 to length of ssList
set item i of ssList to (text item 1 of contents of item i of ssList)
end repeat
return ssList
end ListScreenSavers
on runSaver(chosen)
set saverPID to BGScreenSaver(chosen)
return saverPID
end runSaver
on quitSaver(pid)
set RunningSavers to getRunningSavers()
if RunningSavers contains pid then
try
do shell script " kill " & pid
end try
end if
end quitSaver
on BGScreenSaver(parameters)
if parameters is {} then
set parameters to do shell script "defaults -currentHost read
com.apple.screensaver moduleName "
end if
set processID to do shell script
"/System/Library/Frameworks/ScreenSaver.framework/Resources/
ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background
-module " & parameters & " > /dev/null 2>&1 &" & (ASCII character 10) &
"echo $!"--my thanks to Chris Nebel for this tip!
return processID
end BGScreenSaver
Paul Skinner
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.