Re: Toggle invisible files
Re: Toggle invisible files
- Subject: Re: Toggle invisible files
- From: Phil Stokes <email@hidden>
- Date: Thu, 10 Nov 2016 10:52:41 +0700
On 10 Nov 2016, at 07:20, Shane Stanley < email@hidden> wrote:
there are several values other than "1"
‘Yes’, ‘true’ and ‘1’ - you’re right I was a bit hasty there. I could have put all three in the conditional but balked at the verbosity of it. I like your boolean trick - I didn’t know you could do that - but in my script SD chokes on the conditional, returning
—> Error: Can’t make ‘0’ into type boolean.
set _show to "defaults write com.apple.finder AppleShowAllFiles 1; killall Finder" set _hide to "defaults write com.apple.finder AppleShowAllFiles 0; killall Finder" set _readCurrent to "defaults read com.apple.finder AppleShowAllFiles"
set _state to do shell script _readCurrent if not _state as boolean then # FAILS HERE do shell script _show else do shell script _hide end if
|
_______________________________________________
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