Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'View maximized Cover Flow window via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
View maximized Cover Flow window via AppleScript
Authored by: jonn8n on May 16, '08 08:29:21AM
You can get the bounds of the desktop from the Finder and use that for the maximum expanded size. Also, if you use one script for this, you can set it so that on subsequent runs it reverts the Finder window to its previous size and view without hard coding these values. I would use something like this:
property original_bounds : missing value
property original_view : missing value

if original_bounds = missing value then
	my expand_window()
else
	my revert_window()
end if

on expand_window()
	tell application "Finder"
		activate
		try
			if class of window 1 is not Finder window then return
			set desktop_bounds to (get bounds of window of desktop)
			tell Finder window 1
				set original_bounds to (get bounds)
				set original_view to (get current view)
				
				set bounds to desktop_bounds
				set current view to flow view
			end tell
		end try
	end tell
end expand_window

on revert_window()
	tell application "Finder"
		activate
		try
			if class of window 1 is Finder window then
				tell Finder window 1
					set bounds to original_bounds
					set current view to original_view
				end tell
			end if
		end try
	end tell
	set original_bounds to missing value
	set original_view to missing value
end revert_window
Save this as a script and call it to expand the front Finder window. Calling it a second time will revert the window.

Jon

[ Reply to This | # ]