An EyeTV Script that proportionally resizes the live TV window

Anyone who’s used elgato’s EyeTV software knows that it limits you to four live TV window sizes: max, normal, half, and small. Well, while I was bored watching TV tonight I decided to write an AppleScript around this. It was slow going at first, as it took me a while to figure out that the index numbers for EyeTV windows are somewhat inexplicably assigned both positive and negative integers. EyeTV also refused to report lists of object properties, or even a list of available objects.

Anyway, I’m pretty confident with where I’ve left the script tonight, but I wanted to give you the chance to test it out and comment on it before I make it 1.0 and subject the teeming millions to it.

(*
Zoom TV 0.5 (23Jul05)
written by Michael Henley (mike.com@mac.com)

This script provides a simple interface for 
precisely re-sizing EyeTV's Live TV window. 
*)

-- Resize Increment: (4:3 aspect ratio)
set HAspect to 40 -- 20 / 32 / 48 / etc.
set VAspect to 30 -- 15 / 24 / 36 / etc.

-- Zoom dialog's initial state:
set zoomFactor to 1
set zoomButton to "+"

tell application "EyeTV"
	activate
	repeat with x from -4 to 4
		try
			if name of window x starts with "EyeTV -" then
				set windowName to name of window x
				exit repeat
			end if
		end try
	end repeat
	repeat
		repeat
			display dialog "Zoom Factor:" default answer zoomFactor buttons {"x", "-", "+"} ¬
				cancel button 1 default button zoomButton with icon note with title "Zoom TV"
			copy the result as list to {zoomFactor, zoomButton}
			try
				if zoomFactor as integer > 0 then
					exit repeat
				else
					error
				end if
			on error
				display dialog "The Zoom Factor must be a positive integer" & ¬
					return & "(e.g. 1, 5, 10, etc.)"
			end try
		end repeat
		set HStep to zoomFactor * HAspect
		set VStep to zoomFactor * VAspect
		set theSize to bounds of window windowName
		if zoomButton is "+" then
			set item 1 of theSize to (item 1 of theSize) - HStep
			set item 2 of theSize to (item 2 of theSize) - VStep
			set item 3 of theSize to (item 3 of theSize) + HStep
			set item 4 of theSize to (item 4 of theSize) + VStep
		else
			set item 1 of theSize to (item 1 of theSize) + HStep
			set item 2 of theSize to (item 2 of theSize) + VStep
			set item 3 of theSize to (item 3 of theSize) - HStep
			set item 4 of theSize to (item 4 of theSize) - VStep
		end if
		if ((item 3 of theSize) - (item 1 of theSize)) > HAspect then
			set bounds of window windowName to theSize
		end if
	end repeat
end tell

Edit: Okay, I get the award for most tortured solution to a non-issue. Apparently the new version of EyeTV includes a proportional resizing tool. [smacks head] oh well, it was fun.