Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Resizing windows (Read 3296 times)
Matt Cawood
Full Member
*
Offline



Posts: 109
New England, Australia
Resizing windows
Nov 08th, 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?
Back to top
 
 
  IP Logged
Charles Turner
Full Member
*
Offline



Posts: 180
New York, USA
Re: Resizing windows
Reply #1 - 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
Back to top
 
 
WWW   IP Logged
Matt Cawood
Full Member
*
Offline



Posts: 109
New England, Australia
Re: Resizing windows
Reply #2 - Nov 20th, 2010, 4:40am
 
Charles - been away, so late in responding.

Thanks!
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print