Show/ Hide hidden files in Finder
Hi All,
I am creating a script with which I can hide and unhide hidden files, I want to make a setup like if hidden files are hidden then script will start with a dialog
"Show all hidden files in this Mac" & if hidden files were unhide then start with a dialog "Hide all hidden files in this Mac"
rest of the script is as below
display dialog"Show all hidden files in this Mac ?"buttons{"Show Hidden Files","Cancel"}default button2with title"/MSN/"with icon0
display dialog"Hide all hidden files in this Mac ?"buttons{"Hide Hidden Files","Cancel"}default button2with title"/MSN/"with icon0
copytheresultaslistto{buttonpressed}
try
ifthebuttonpressedis"Cancel"thenquit-- it will cancel the process/script
-- below line will hidden files will be hidden
ifthebuttonpressedis"Hide Hidden Files"thendo shell script¬
"defaults write com.apple.finder AppleShowAllFiles OFF"
-- below line will show hidden files
ifthebuttonpressedis"Show Hidden Files"thendo shell script¬
"defaults write com.apple.finder AppleShowAllFiles ON"
endtry
do shell script"killall Finder"
Mac Book Pro 2.66 GHz,I-Mac Intel, Mac Pro DP,PowerMac G5 DP 2.0GHz,E-mac 1Ghz, Mac OS X (10.5.8)