How to toggle a compiled script name?
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.