Você pode simplesmente desativar o fechamento de janelas quando sair do Finder:
defaults write com.apple.finder NSQuitAlwaysKeepsWindows -bool true
Eu uso este script para alternar a exibição de arquivos ocultos:
do shell script "[[ $(defaults read com.apple.finder AppleShowAllFiles) = 1 ]] && b=false || b=true
defaults write com.apple.finder AppleShowAllFiles -bool $b"
tell application "Finder"
quit
delay 0.1 -- without this delay Finder was not made frontmost
launch
delay 0.5 -- without this delay there was sometimes a "connection is invalid" error
activate -- make Finder frontmost
reopen -- open a new default window if there are no open windows
end tell