Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Enthusiast Zone > Classic Macs and Mac OS > How do I make an Applescript for "Show Desktop" function?

How do I make an Applescript for "Show Desktop" function?
Thread Tools
Junior Member
Join Date: May 2001
Status: Offline
Reply With Quote
May 1, 2002, 12:24 AM
 
Hi,
One aspect of Windows I like (I know this is a Mac forum, please don't flame me ) is the "Show Desktop" button in the taskbar, which hides all apps and returns you to the desktop. I know very little about Applescript, but I'm sure it would be possible to make a script that would do this.

Does anyone have any tips about how to do this, or any websites for Applescript info that might have the commands I need? Thanks a lot!
     
Forum Regular
Join Date: Feb 2001
Status: Offline
Reply With Quote
May 1, 2002, 01:21 AM
 
Here:

tell application "Finder"
set visible of every process to false
activate
end tell

If that doesn't work, try this:

tell application "Finder"
try
set visible of every process to false
end try
activate
end tell

(146)
     
Dedicated MacNNer
Join Date: Apr 2002
Location: Chicago
Status: Offline
Reply With Quote
May 1, 2002, 07:48 AM
 
If you're original intent was to find out how to script that command, ignore this message.

Without scripting, all you have to do is this:
1. Select the Finder from the Application menu (make it the active application)
2. Once again, from the Application menu, select Hide Others.
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
May 1, 2002, 10:50 AM
 
Originally posted by AppleScript:
<STRONG>Here:

tell application "Finder"
set visible of every process to false
activate
end tell

If that doesn't work, try this:

tell application "Finder"
try
set visible of every process to false
end try
activate
end tell

(146)</STRONG>
That's not what the Wintel feature does, that one also hides all Finder windows. I suppose you could do something like

set minimized of front window to true

and have it go through all the windows. To just hide all other apps, hold command-option and click the Finder symbol in the dock. To also minimize Finder windows, use this freeware program
http://www.versiontracker.com/morein...d=10005&db=mac
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
Gerson  (op)
Junior Member
Join Date: May 2001
Status: Offline
Reply With Quote
May 1, 2002, 03:39 PM
 
Wow--thanks for the quick responses!

The first script:

tell application "Finder"
set visible of every process to false
activate
end tell

works, but gives an error message after minimizing all apps: "Finder got an error: can't continue". Any idea why?

The other script has some sort of syntax error on the "end try" line; it says it expects "on" instead of "end."


tell application "Finder"
try
set visible of every process to false
end try--THIS line here is causing the error
activate
end tell

One thing I've been looking for without success is a good website with basic Applescript vocabulary and tutorials...any suggestions?

Thanks again--the MacNN community is always so helpful, it's great.
     
<anonymous>
Guest
Status:
Reply With Quote
May 1, 2002, 05:34 PM
 
     
Forum Regular
Join Date: Feb 2001
Status: Offline
Reply With Quote
May 1, 2002, 07:33 PM
 
Use this one:

tell application "Finder"
try
set visible of every process to false
on error

end try
activate
end tell

(148)
     
Gerson  (op)
Junior Member
Join Date: May 2001
Status: Offline
Reply With Quote
May 2, 2002, 12:51 AM
 
Thanks for your suggestions--the website is great.

And AppleScript, the revised script works perfectly. Thanks a lot![/LIST]null
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 12:43 PM.
All contents of these forums © 1995-2014 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2014, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2