Re: Hide/Show Invisibles
Re: Hide/Show Invisibles
- Subject: Re: Hide/Show Invisibles
- From: "Marc K. Myers" <email@hidden>
- Date: Mon, 8 Dec 2003 13:10:29 -0500
Date: Sun, 07 Dec 2003 20:08:46 -0800
Subject: Re: applescript-users digest, Vol 3 #2223 - 15 msgs
From: Paul Berkowitz <email@hidden>
To: AppleScript-Users <email@hidden>
On 12/7/03 7:53 PM, "Marc K. Myers" <email@hidden> wrote:
I've seen the "Connection is invalid" error several times but I still
have no idea what it refers to. Does anyone know?
It means that the application (process) targeted by 'tell' doesn't
exist, as you surmised. If the Finder quits before some command to it
completes, you get that error. It's a little odd here since the
Finder normally doesn't just go and quit by itself. I'd guess that
'quit' involves a few steps under the hood, and some of them hadn't
finished when the Finder went and finished quitting on its own.
Which OS are you in? In OS 10.3, 'quit' is supposed to have no error,
nor do a new activate-just-in-order-to-quit as it did in previous OS
versions.
I rearranged my script as suggested by Deivy Petrescu, putting the quit
to the Finder in front of the shell script commands. I left it wrapped
in the "ignoring" commands so that the script won't care if the Finder
sends an error on later steps of the quit, as you suggested. This
script makes my work much easier as I often need to see invisible files
but don't want to look at them all the time.
ignoring application responses
tell application "Finder" to quit
end ignoring
delay 1
-- get the value of the AppleShowAllFiles field
do shell script "defaults read com.apple.Finder | grep
AppleShowAllFiles"
-- toggle the value of the AppleShowAllFiles field
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
tell application "Finder" to activate
I'm running Mac OS X 10.2.8. I'm holding off on Panther until it
"matures" a little.
Marc [12/08/03 1:07:07 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.