[b]tell application “Terminal”
do script “/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background &”
end tell
tell application “System Events”
set visible of first process whose name is “terminal” to false
end tell[/b]
to set my screensaver as the wallpaper. My problem is that if i close the terminal window the process terminates and i lose the screensaver as my wallpaper. I don’t like the terminal icon sitting in the dock. Is there a way to either run terminal without it showing up in the dock or a way to run the process without the terminal actually being open?
As written, AppleScript will wait for the process to terminate before exiting the script. Depending on how you launch this, it could mean you have to keep the script editor or your script applet open.
To fix it:
do shell script "/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background > /dev/null 2>&1 &"
The addition of ’ > /dev/null 2>&1’ suppresses command output, so AppleScript doesn’t hang around waiting for the process to finish.