Groups | Search | Server Info | Login | Register


Groups > alt.comp.lang.applescript > #7

Re: [Applescript/shell script] how could I change the images folder of the screen saver ?

From Jolly Roger <jollyroger@pobox.com>
Newsgroups alt.comp.lang.applescript
Subject Re: [Applescript/shell script] how could I change the images folder of the screen saver ?
Date 2015-09-25 15:30 +0000
Organization People for the Ethical Treatment of Pirates
Message-ID <d6l7k3Fm5j3U1@mid.individual.net> (permalink)
References <1mbaqiz.mlg4zx1jpm854N%blanc@empty.org>

Show all headers | View raw


On 2015-09-25, JiPaul <blanc@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

Back to alt.comp.lang.applescript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

[Applescript/shell script] how could I change the images folder of the screen saver ? blanc@empty.org (JiPaul) - 2015-09-25 09:45 +0200
  Re: [Applescript/shell script] how could I change the images folder of the screen saver ? Jolly Roger <jollyroger@pobox.com> - 2015-09-25 15:30 +0000
    Re: [Applescript/shell script] how could I change the images folder of the screen saver ? blanc@empty.org (JiPaul) - 2015-09-25 19:49 +0200
      Re: [Applescript/shell script] how could I change the images folder of the screen saver ? Jolly Roger <jollyroger@pobox.com> - 2015-09-25 18:37 +0000
        Re: [Applescript/shell script] how could I change the images folder of the screen saver ? blanc@empty.org (JiPaul) - 2015-09-26 00:06 +0200
          Re: [Applescript/shell script] how could I change the images folder of the screen saver ? Jolly Roger <jollyroger@pobox.com> - 2015-09-25 22:47 +0000
            Re: [Applescript/shell script] how could I change the images folder of the screen saver ? blanc@empty.org (JiPaul) - 2015-10-07 09:56 +0200
              Re: [Applescript/shell script] how could I change the images folder of the screen saver ? Jolly Roger <jollyroger@pobox.com> - 2015-10-07 16:20 +0000
                Re: [Applescript/shell script] how could I change the images folder of the screen saver ? blanc@empty.org (JiPaul) - 2015-10-07 21:15 +0200

csiph-web