Re: tell app, name in string var
Re: tell app, name in string var
- Subject: Re: tell app, name in string var
- From: John Baltutis <email@hidden>
- Date: Sun, 29 May 2011 13:18:03 -0700
On 5/27/11, Jon Pugh <email@hidden> wrote:
> At 6:21 PM -0700 5/27/11, Jon Pugh wrote:
>>defaults write com.apple.finder AppleShowAllFiles ON
>>
>>Wrapping it in a do shell script or pasting it into Terminal is left as ...
>>you know.
>
> Oh wait, I already had it done.
>
> -- turn invisibles on and off in the Finder, requires restarting the Finder
> tell application "Finder" to quit
> set inOff to do shell script "defaults read com.apple.finder
>AppleShowAllFiles"
> if inOff = "NO" or inOff = "OFF" then
> set onOffCmd to "ON"
> else
> set onOffCmd to "OFF"
> end if
> set onOffCmd to "defaults write com.apple.finder AppleShowAllFiles "& onOffCmd
> do shell script onOffCmd
> delay 1
> tell application "Finder" to launch
I like this one:
if (do shell script "defaults read com.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"
Saved as an app, dragged to the Dock, and single-click to toggle.
_______________________________________________
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