On 2015-09-25, JiPaul <
bl...@empty.org> wrote:
> Hello everybody,
>
> The question is in the subject.
> I've found how to start a screen saver with AS :
> ---------------------------
> tell application "System Events"
>
> set ss1 to screen saver "Arabesque"
> set ss2 to screen saver "Flurry"
> set ss3 to screen saver "Shell"
> set ss4 to screen saver "iLifeslideshows"
> set ss5 to screen saver "Word of the Day"
> set ss6 to screen saver "iTunes Artwork"
> set ss7 to screen saver "Computer Name"
> set ss8 to screen saver "BOINCSaver"
> start ss3 # (or ss1 or ss2...)
>
> end tell
> --------------------------------
> But that I wish to do, for pictures-based sc savers (like
> "iLifeslideshows"), is changing (by AS or shell script) the images
> folder.
>
> And also how to change the style of "iLifeslideshows" (origami, mosaic,
> pictures wall, floating pictures, Ken Burns, and so on...) ?
Unfortunately, you can't do that with pure AppleScript since Apple does
not provide AppleScript interfaces to change those properties. Here is
what Apple allows (found in the System Events dictionary):
screen saver n : an installed screen saver
elements
contained by application.
properties
displayed name (text, r/o) : name of the screen saver module as
displayed to the user
name (text, r/o) : name of the screen saver module to be displayed
path (alias, r/o) : path to the screen saver module
picture display style (text) : effect to use when displaying
picture-based screen savers (slideshow, collage, or mosaic)
responds to
start, stop.
screen saver preferences object n : screen saver settings
properties
delay interval (integer) : number of seconds of idle time before the
screen saver starts; zero for never
main screen only (boolean) : should the screen saver be shown only on
the main screen?
running (boolean, r/o) : is the screen saver running?
show clock (boolean) : should a clock appear over the screen saver?
responds to
start, stop.
Using the defaults command to read defaults for com.apple.screensaver
shows just two properties:
# defaults read com.apple.screensaver
{
askForPassword = 1;
askForPasswordDelay = 5;
}
I had a look at these screen saver preference files:
~/Library/Preferences/com.apple.screensaver.plist
~/Library/Preferences/ByHost/com.apple.screensaver.5387F4CD-305A-54DE-B565-463EEBFCF270.plist
(The "5387F4CD-305A-54DE-B565-463EEBFCF270" portion of the name of the
second file will differ on your system.)
The first property list file contains:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>askForPassword</key>
<integer>1</integer>
<key>askForPasswordDelay</key>
<real>5</real>
</dict>
</plist>
Not much there...
The second property list file contains:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CleanExit</key>
<string>YES</string>
<key>PrefsVersion</key>
<integer>100</integer>
<key>idleTime</key>
<integer>300</integer>
<key>moduleDict</key>
<dict>
<key>moduleName</key>
<string>iLifeSlideshows</string>
<key>path</key>
<string>/System/Library/Frameworks/ScreenSaver.framework/Resources/iLifeSlideshows.saver</string>
<key>type</key>
<integer>0</integer>
</dict>
</dict>
</plist>
So it appears the settings you want are stored elsewhere - not sure
where, though.
If you can find where OS X stores these settings, and if they are stored
in a property list (plist) file or another suitable text format, you
might be able to use a shell/Perl/whatever script to modify that file.
After making any change "under the hood" like this, you'd likely need to
restart the cfprefsd daemon with this command to make the changes take
effect:
# killall cfprefsd
--
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.
JR