Re: Show/Hide invisibles
Re: Show/Hide invisibles
- Subject: Re: Show/Hide invisibles
- From: Laine Lee <email@hidden>
- Date: Sun, 21 Dec 2003 21:48:03 -0600
Here's an update. I prefer the empirical method. These lines may wrap badly.
This also hacks your 10.3 Finder prefs file, but seems to work.
if word 2 of (do shell script "sw_vers | grep -w ProductVersion") < 10.3
then
do shell script "defaults read com.apple.Finder | grep
AppleShowAllFiles"
if (result as string) contains "= 1;" then
do shell script "defaults write com.apple.Finder AppleShowAllFiles
'0'"
else
do shell script "defaults write com.apple.Finder AppleShowAllFiles
'1'"
end if
else
try
do shell script "defaults read com.apple.Finder | grep
AppleShowAllFiles"
on error
do shell script "defaults write com.apple.Finder AppleShowAllFiles
'0'"
end try
do shell script "defaults read com.apple.systempreferences | grep
ShowAllMode"
if (result as string) contains "= 1;" then
do shell script "defaults write com.apple.systempreferences
ShowAllMode '0'"
do shell script "defaults write com.apple.Finder AppleShowAllFiles
'0'"
else
do shell script "defaults write com.apple.systempreferences
ShowAllMode '1'"
do shell script "defaults write com.apple.Finder AppleShowAllFiles
'1'"
end if
end if
delay 1
--- quit and reactivate the Finder to use the new preferences.
tell application "Finder" to quit
delay 1
tell application "Finder" to activate
--
Laine Lee
email@hidden
http://lonestar.utsa.edu/llee
>
From: Deivy Petrescu <email@hidden>
>
Date: Sun, 7 Dec 2003 13:51:47 -0500
>
To: "Marc K. Myers" <email@hidden>, email@hidden
>
Cc: "Marc K. Myers" <email@hidden>
>
Subject: Re: Show/Hide invisibles
>
>
At 1:08 PM -0500 12/7/03, Marc K. Myers wrote:
>
> I find myself opening Tinkertool several times a
>
> day in order to show invisibles in Finder
>
> windows and then hide them again. Is there a
>
> way to script the Finder or through Unix
>
> scripting to do the same thing? I haven't
>
> ventured into the mysteries of UI scripting yet
>
> but I might have to use it with Tinkertool if
>
> there isn't an easier way to accomplish the same
>
> thing.
>
>
>
> Marc [12/07/03 1:08:04 PM] _______________________________________________
>
>
I use this script to turn on/off the visibility of invisible files
>
>
___
>
do shell script "defaults read com.apple.Finder | grep AppleShowAllFiles"
>
if (result as string) contains "= 1;" then
>
do shell script "defaults write com.apple.Finder AppleShowAllFiles '0'"
>
else
>
do shell script "defaults write com.apple.Finder AppleShowAllFiles '1'"
>
end if
>
delay 1
>
>
--- quit and reactivate the Finder to use the new preferences.
>
tell application "Finder" to quit
>
delay 1
>
tell application "Finder" to activate
>
____
>
>
--
>
Regards
>
Saudagues
>
>
Deivy
>
http://www.dicas.com
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.