A versão do Apple Script funciona bem:
on run {input, parameters}
set cur_state to do shell script "defaults read com.apple.finder AppleShowAllFiles"
if cur_state = "TRUE" then
do shell script "defaults write com.apple.finder AppleShowAllFiles FALSE"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles TRUE"
end if
do shell script "killall Finder"
return input
end run