I'm using automator with applescript (no text, in finder) to toggle hidden folders on/off. I'm trying to do this without relaunching finder, so I just want to refresh every finder window. I want to apply the refresh to the entire finder/every window, NOT just the top-most window.
With the script as it currently is, I have to manually go to a different folder and return to show hidden files. I want to automate the refresh. Right now I have it asking for permission > if yes, then toggle hidden files > (And here's where I want to refresh all finder.)
Code:
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
return input
end run