strange behaviour of QT Player 7.5 when setting window bounds
strange behaviour of QT Player 7.5 when setting window bounds
- Subject: strange behaviour of QT Player 7.5 when setting window bounds
- From: Skeeve <email@hidden>
- Date: Tue, 24 Jun 2008 21:13:57 +0200
Hi!
The applescript shown at the end used to run perfectly pre QT 7.5. It
centers the current (or dropped) movies and scales them by 1.4.
But since QT 7.5 the windows are completly garbage after scaling.
I found that setting the bounds and reading them afterwards gives very
strange results.
I experimented a bit and found, with one .mov movie I used for testing,
that setting the bounds to 2 pixel less than before (decrementing the
lower right coordinates, gives me a constantly shrinking QT Player window.
I sure think this is a bug.
Do you know of any workaround?
This is the code:
on open someFiles
repeat with aFile in someFiles
try
tell application "QuickTime Player"
open aFile
end tell
end try
end repeat
centerMovie()
end open
on run
centerMovie()
end run
on centerMovie()
set windowFound to false
tell application "Finder" to set {foo1, foo2, screenX, screenY} to
desktop's window's bounds
tell application "Finder" to log window of desktop's bounds
tell application "QuickTime Player"
repeat with theWindow in windows
set windowFound to true
tell theWindow
set {x1, y1, x2, y2} to bounds
set {wdth, hght} to dimensions of (document of theWindow)
set wdth to x2 - x1 - wdth + (wdth * 1.4) as integer
set hght to y2 - y1 - hght + (hght * 1.4) as integer
set {newX, newY} to {(screenX - wdth) div 2, (screenY -
hght) div 2}
set bounds to {newX, newY, newX + wdth, newY + hght}
end tell
end repeat
if windowFound then activate
end tell
end centerMovie
And here is the code I experimented with, which gave me the shrinking
window. replace the "tell theWindow" content with
set d to 2
set {x1, y1, x2, y2} to bounds
set bounds to {x1, y1, x2 + d, y2 + d}
set {xa, ya, xb, yb} to bounds
return {xa - x1, ya - y1, xb - x1, yb - y1}
This should give you as a result {0, 0, 2, 2} but gives you something
very far from that. Like {0, 0, 1008, 675}
The Movie I tested with is (legally!) available via torrent
http://www.mybittorrent.com/torrent/675889/bigbuckbunny1080ph264_mov.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden