Re: Simple script used to work, not now
Re: Simple script used to work, not now
- Subject: Re: Simple script used to work, not now
- From: John Baltutis <email@hidden>
- Date: Tue, 27 Nov 2012 13:51:21 -0800
On 11/26/12, Dave C <email@hidden> wrote:
>
> I used this script successfully under 10.6.8 for more than a year. Now I
>bought a new hard drive, installed 10.6.8 onto it, and am in the process of
>moving over everything to the new drive.
>
> I run this script (it toggles all Finder files between visible and invisible)
>and this time it freezes up. I open the AS Editor and run it there. It seems
>to hang up at the end when activating the previously-quit Finder:
>
> "Finder got an error: Connection isinvalid." number -609
<snip>
> - - -
>
> set dotVisible to do shell script "defaults read com.apple.Finder
>AppleShowAllFiles"
> if dotVisible = "0" then
> do shell script "defaults write com.apple.Finder AppleShowAllFiles 1"
> else
> do shell script "defaults write com.apple.Finder AppleShowAllFiles 0"
> end if
> tell application "Finder" to quit
> delay 1
> tell application "Finder" to activate
> - - -
I use this and it works w/SL, Lion, and ML.
try
do shell script "defaults readcom.apple.finder AppleShowAllFiles"
on error
do shell script "defaults write com.apple.finder AppleShowAllFiles 0"
end try
if (do shell script "defaults readcom.apple.finder AppleShowAllFiles") is equal
to "0"then
do shell script"defaults write com.apple.finder AppleShowAllFiles 1"
else
do shell script"defaults write com.apple.finder AppleShowAllFiles 0"
end if
do shell script "killall Finder"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden