Re: applescript-users digest, Vol 3 #2223 - 15 msgs
Re: applescript-users digest, Vol 3 #2223 - 15 msgs
- Subject: Re: applescript-users digest, Vol 3 #2223 - 15 msgs
- From: "Marc K. Myers" <email@hidden>
- Date: Sun, 7 Dec 2003 22:53:58 -0500
Date: Sun, 7 Dec 2003 13:51:47 -0500
To: "Marc K. Myers" <email@hidden>,
email@hidden
From: Deivy Petrescu <email@hidden>
Subject: Re: Show/Hide invisibles
Cc: "Marc K. Myers" <email@hidden>
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
Thank you. That almost does it except that I get an error at random
intervals when I trigger the script. The word "quit" is highlighted
and the error message says "Finder got an error: Connection is
invalid". At the time of the error the Finder has already quit. When
I reactivate it by clicking the Finder icon in the dock the appropriate
change has taken place. I found that I could get it to work
consistently by wrapping the two Finder tells in "ignoring application
responses" and "end ignoring".
I've seen the "Connection is invalid" error several times but I still
have no idea what it refers to. Does anyone know?
Marc [12/07/03 10:53:46 PM]
_______________________________________________
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.