AppleScript App to start a Slideshow in Finder I want to write an AppleScript App that starts a full screen slideshow with all pictures in the currently active folder in Finder (on Big Sur/Apple M1).
Manually, in Finder I would have to open a folder, press command ⌘+ A to select all pictures (or files) inside, then press option ⌥+ spacebar to start the slideshow.
I want to write a Script-App, that does all that for me (and which I then can put in Finder's toolbar). I am a newbie to this all, so please explain it for the dummy I am!
I figured it out and wrote a simple script, that does this: 1) opens the selected folder in Finder 2) selects all files in that folder 3) starts slideshow. Can be saved as an App and then put in the toolbar of Finder. Works on Big Sur/M1, however you have to allow Script Editor and this App 'Accessibility' and 'Automation' in System Preferences/Security&amp;Privacy.
Any improvements are highly welcome! Especially I couldn't figure out how to make the Script close the selected/opened Folder again and go one level up again. Key code for that would be &quot;key code 126 using {command down}&quot; (for COMMAND+ARROW UP); however, don't know how to integrate that into the script so that it actually works.
tell application &quot;Finder&quot;
    activate
    tell application &quot;System Events&quot;
        tell process &quot;Finder&quot;
            key code 31 using {command down}
        end tell
    end tell
    
    activate
    tell application &quot;System Events&quot;
        tell process &quot;Finder&quot;
            key code 0 using {command down}
        end tell
    end tell
    
    activate
    tell application &quot;System Events&quot;
        tell process &quot;Finder&quot;
            key code 49 using {option down}
        end tell
    end tell
end tell