I’ve been trying to write a simple script that goes:
tell application “Finder” to quit
tell application “Finder” to launch
The script quits Finder okay, but then doesn’t launch it again. A script with just the 2nd line in it alone will happily launch Finder once it’s been quit, but I can’t get both lines to work consecutively in the same script - aragh…
So what am I doing wrong? Do scripts drop themselves out after Finder is quit, or is there maybe some syntax I’m missing here to get the launch to happen after the quit?
try
tell application "Finder" to quit
end try
delay 2
tell application "Finder" to activate
works the best - it’ll work from e.g. YoupiKey (or iKey as it’s now known) but it won’t work from e.g. Big Cat as a CMM-run script, presumably because quitting the Finder shuts down the CMM scripting capability. When I say ‘work’ I mean both quit AND relaunch Finder - just quitting it is no problem!