View Single Post
jsherk

 
Member Since: Dec 24, 2011
Posts: 8
jsherk is on a distinguished road

jsherk is offline
Hi

I am new to Mac (Lion 10.7.2), and am playing around with AppleScript. I have the following script that minimizes all visible windows:
Code:
tell application "System Events"
	--Get all the available applications that can be visible
	repeat with appProc in (every application process whose visible is true)
		--From the available applications above, click on the minimize
		-- button of every window that has a minimize button
		click (first button of every window of appProc whose role description is "minimize button")
	end repeat
end tell
Here are my problems and quesions...

The script does work, except it is kind of slow, meaning instead of instantly minimizing all the windows, you watch each one get minimized one by one. I tried saving it as an application from AppleScript Editor, but then it is really really slow (takes about 5 to 10 seconds before it even starts doing anything).

QUESTION #1
How can I create an alias on the desktop (to the .scpt file), that when clicked, will run the script instead of opening it up in AppleScript Editor? I do not want to the Script Menu in the menu bar to run the script.

QUESTION #2
Can this script be imported into either Automator or Xcode and be converted to an app that will run much faster?

QUESTION #3
I was looking for other ways to do this instead of "click button", and I found references to the miniaturized property of the window, but this property and the miniaturizable property both do not appear to exist when I view the properties of applications and windows. I have searched google for hours about this, and cannot figure out why it is not availble.

Thanks
QUOTE Thanks