Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Questions and Answers >> Resizing windows
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1289217887

Message started by Matt Cawood on Nov 8th, 2010, 7:04am

Title: Resizing windows
Post by Matt Cawood on Nov 8th, 2010, 7:04am

Does anyone have a solution for resizing windows?

As an Applescript dunce, I've tried Keyboard Maestro, but Tinderbox windows go haywire. I then resignedly turned to Applescript, and found to my delight that it records Tinderbox window sizes - but I don't know how to make AS identify the frontmost window. "Window 1" doesn't seem to suffice. Any tips?

Title: Re: Resizing windows
Post by Charles Turner on Nov 8th, 2010, 7:54am

Hi Matt-

Last time I checked, you have to ignore some of the windows which aren't document windows. Fortunately, these windows have no string name, or generate an error when you access them, so it's pretty easy to exclude them:


set scriptableWins to {}
set firstSet to false

tell application "Tinderbox"
     set countWins to count of windows
     repeat with i from 1 to countWins
           try
                 copy name of window i to end of scriptableWins
           on error errMsg number errNum
                 -- your error handler code goes here
           end try
     end repeat
     repeat with i in scriptableWins
           if i as string is not "" then
                 if firstSet is false then
                       -- For some reason menu clearance is 44, not 22
                       set bounds of window i to {0, 44, 565, 752} -- set the 1st window
                       set firstSet to true
                 else
                       set bounds of window i to {566, 44, 1130, 752} -- set the 2nd window
                       exit repeat -- if more than 2, sorry!
                 end if
           end if
     end repeat
end tell


The above is a basic script that positions the first two open windows.

HTH, Charles

Title: Re: Resizing windows
Post by Matt Cawood on Nov 20th, 2010, 4:40am

Charles - been away, so late in responding.

Thanks!

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.