joh, I would change James Nierodzik’s first script to this…
set state to do shell script "defaults read com.apple.finder AppleShowAllFiles"
if state is not "Yes" then
quit application "Finder"
do shell script "defaults write com.apple.Finder AppleShowAllFiles Yes" -- ;KillAll Finder;"
delay 0.25
launch application "Finder"
else
quit application "Finder"
do shell script "defaults write com.apple.Finder AppleShowAllFiles No" -- ;KillAll Finder;"
delay 0.25
launch application "Finder"
end if
The reason for the change is that if you use ;KillAll Finder; the folder(s) you have open will close.
Using quit application “Finder” then a short delay with launch application “Finder” the folder(s) should stay open (they do for me).
Just my 2 cents.