Screensaver variation

I realize the screensaver topic has been discussed many times in other posts but as I can’t find the answer I’m looking for I’ll start a new one. Sorry.
As we all know by now you can start up the screensaver directly by using either:

do shell script “/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -true”
or
tell application “ScreenSaverEngine” to activate
or
activate application “ScreenSaverEngine”

But how do you go about changing the screensaver to the one you want? Let’s say you want to be able to choose between “cosmos” or “forest”. Or maybe even a couple of screensavers you make on your own.
Where/how do you put in the name of your desired screensaver? I though I remember reading somewhere about using the do shell script and inserting your desired name like:

set DesiredScreensaverName to “Forest”
set ThePathVar to “/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -module " & DesiredScreensaverName & " &”
do shell script ThePathVar

but this doesn’t seem to work. (I’m sure I’ve seen something like this work before but I must be missing something.) It makes the screen go black, but it doesn’t start up the screensaver. I realize also that in another post the moderator “Kai” gave a very detailed script for choosing between screensavers. I was looking for something a little simpler like the above do shell script where you can just set the “DesiredName” variable.

So my question is:

  1. What is the code for starting up a screensaver using the name you choose?
  2. What folder do you put your screensavers in that you make up?

Any help would be appreciated.

bwDreams

Dear Jacques,

Thanks for the quick reply. Is there any slight modification I’m supposed to be making to your example? Does this example work for you as is? I’ve put the “Forest” screensaver into the 3 folders you indicated but it still doesn’t work… as in nothing happens. In Script Editor I get a “” as a result. Is this just me or am I still missing something?

Thanks in advance.

bwDreams

Dear Jacques,

I appologize for making you post another reply due to my carelessness. As it turns out, you’re right, the script you posted works perfectly. Because I used it ‘as is’ I forgot the very important step of activating the screensaver using the ‘activate application “ScreenSaverEngine”’ afterwards. Once I added this step the screensaver I had set worked like a charm. You even added in some extra details and code to help me out further. I truly appreciate it.

Sincerely,

bwDreams