• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: tell app, name in string var
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: tell app, name in string var
      • From: Ron Hunsinger <email@hidden>
  • Prev by Date: Re: Load Script
  • Next by Date: Filmier to ical
  • Previous by thread: Re: tell app, name in string var
  • Next by thread: Re: tell app, name in string var
  • Index(es):
    • Date
    • Thread