|
|
Toggle show or hide hidden files
Same thing but without all the mouse clicks (Watch the line wraps obviously)...
Toggle show or hide hidden files
For some reason, for me, this one doesn't relaunch the finder when done.
Toggle show or hide hidden files
I really like the idea behind this particular Script; however, for
Toggle show or hide hidden files - FIXED
Try this:
tell application "Finder" to quit set OnOff to do shell script "defaults read com.apple.finder AppleShowAllFiles" if inOff= "NO" or inOff= "OFF" then set OnOffCommand to "defaults write com.apple.finder AppleShowAllFiles ON" else set OnOffCommand to "defaults write com.apple.finder AppleShowAllFiles OFF" end if do shell script OnOffCommand delay 1 tell application "Finder" to launch
Wierd....
Strange. I pasted in the above code, but something on the web site decided to change it just a little bit.
Wierd....
Yes it works now, nice!
Wierd....
I haven't seen that myself, and I'm not enough of an Apple Script expert to know anything about it. Sorry.
Beat me to the punch
I wasn't at my Mac when I read this hint, so I couldn't test anything until just now. I merged two of the concepts above and came up with something very similar to yor fix, but I included a "try" statement that may alleviate some of the "connection failed" errors.
Beat me to the punch
This only works once the preference is once set. So it is needed
to at least once type "
defaults write com.apple.finder
AppleShowAllFiles ON" in the Terminal (or set it with
TinkerTool,
or any other utility that does this...)
Another way
Just a thought, but you can get around problems with quitting and launching the finder mid-script by setting the default the killing the finder:
!!! THIS IS THE MOST ELEGANT CODE !!!
DanCleaver (above) posted the simple (elegant) answer, but I also liked the idea of a "Cancel" button mentioned by one of the other posters.
Following the general rule of Least Harmful by Default...
display dialog "¿ Show Hidden Files ?" buttons {"Yes", "No", "Cancel"} default button 3
copy the result as list to {buttonpressed}
try
if the buttonpressed is "Cancel" then quit
if the buttonpressed is "No" then do shell script ¬
"defaults write com.apple.finder AppleShowAllFiles OFF"
if the buttonpressed is "Yes" then do shell script ¬
"defaults write com.apple.finder AppleShowAllFiles ON"
end try
do shell script "killall Finder"
Thanx DanCleaver.
!!! OF COURSE YOU COULD COMBINE !!!
the second if statement of the try thus...
if the buttonpressed is "No" then do shell script ¬ "defaults write com.apple.finder AppleShowAllFiles OFF" else do shell script ¬ "defaults write com.apple.finder AppleShowAllFiles ON" end if |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.10 seconds |
|