• 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
How to toggle a compiled script name?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to toggle a compiled script name?


  • Subject: How to toggle a compiled script name?
  • From: bill <email@hidden>
  • Date: Wed, 05 Jun 2002 00:36:50 +0800

Hello,

Is it possible to rename a compiled script according to the value it makes?

In detail, I use script menu to run the following compiled script, is it
possible to change the name of the script to 3show invisible in Finder2 when
AppleShowAllFiles is set to false; toggle the name to 3hide invisible in
Finder2 when AppleShowAllFiles is set to true.

Hard code the path, or path to me (well, it doesn9t work using script menu,
returns SystemUIServer). Any suggestion?

-- script starts

tell application "Finder" to activate
try
if word -1 of (do shell script "defaults read com.apple.finder | grep
AppleShowAllFiles") = "true" then
do shell script "defaults write com.apple.finder AppleShowAllFiles
false"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles
true"
end if
on error
do shell script "defaults write com.apple.finder AppleShowAllFiles true"
end try

tell application "Finder" to quit
tell application "Finder" to activate

-- script ends

TIA
bill
_______________________________________________
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.

  • Prev by Date: Re: Pausing a script
  • Next by Date: files in a folder
  • Previous by thread: Re: Sending Email from AppleScript Without Garbling It
  • Next by thread: files in a folder
  • Index(es):
    • Date
    • Thread