I will like to be able to set and start the macOS screensaver via the Finder's selection using Applescript. I will also like to be able to choose which screen saver pattern will be displayed. For example: Sliding Panels, Shifting Tiles, Reflections, Origami, etc...
I will also like the screen saver to be randomized (or as shown in System Preferences, "Shuffle slide order").
I have searched the Internet on how to do this and I have not had any luck on finding a solution.
Here is the initial code I came up with but I am having issues making the screen saver start with the selected images randomized:
tell application "Finder"
set theSelection to selection as alias
end tell
set searchOne to "find " & theSelection's POSIX path's quoted form & " -iname '*.jpg'"
set theImages to paragraphs of (do shell script searchOne)
tell application id "com.apple.systemevents"
set current screen saver to theImages
end tell
I am currently using macOS High Sierra. Any help is appreciated. Thanks!