[X4U] Re: hidden files

John Baltutis baltwo at san.rr.com
Mon Feb 6 14:50:53 PST 2006


On 02/06/06, Daly Jessup <jessup at san.rr.com> wrote:
> At 4:24 AM -0800 2/6/06, Sean Collins wrote:
>>There's this nifty applescript that was posted a few years ago,
>>which toggles Finder visibility on/off.  I keep it in my window
>>sidebar for easy access.
>>
>>Copy this text into a script editor document, compile and save as a
>>stand-alone  application.
>>-------------------------------------------------------------
>>do shell script "if [ `cat
>>~/Library/Preferences/com.apple.finder.plist | grep -A 1
>>AppleShowAllFiles | grep string | cut -c10-11` == 'ON' ]; then
>>defaults write com.apple.finder AppleShowAllFiles OFF
>>else
>>defaults write com.apple.finder AppleShowAllFiles ON
>>fi"
>>
>>tell application "Finder" to quit
>>delay 1
>>tell application "Finder" to launch
>>-------------------------------------------------------------
>
> That was an interesting exercise, but I'm wondering if AppleScript
> has changed in the intervening years? This script successfully  made
> my invisible files visible, but then would not toggle them back to
> invisible. Luckily, I remembered the freeware, "Tinkertool", and was
> able to toggle them back off in the Finder tab of  Tinkertool.
> -------------------------------------------------------------
This works in Tiger:

set x to do shell script "defaults read com.apple.finder AppleShowAllFiles"
if x is "0" then do shell script "defaults write com.apple.finder
AppleShowAllFiles 1"---show invisibles
if x is "1" then do shell script "defaults write com.apple.finder
AppleShowAllFiles 0"---hide invisibles

tell application "Finder"to quit
delay 1
tell application "Finder"to launch


More information about the X4U mailing list