Hi Chris.  Thanks for the reply.  I hope you don't mind the top posting.  

Yep, I'd like to have a script that creates three new text windows on my 30" 
monitor.  Problem is, I have two 27" monitors to the left of the target 
monitor, and another one to the right of the target monitor, all standing 
vertical.  So, the 30 is third in a row.  I see that you measure the desktop 
width then divide it by three.  BTW nice approach.  

OK, here's what I got to help me:

try
        tell application "BBEdit"
                close every window
                set w to 800
                set s to 1
                set h to 1560
                set c to 5 -- a trip for troubleshooting
                
                (*      {1, 45, 800, 1560}, {801, 45, 1601, 1560}, {1602, 45, 
2402, 1560}               *)
                if c = 1 or c = 5 then
                        set d1 to make new text window
                        set the bounds of d1 to {1, 45, w, h}
                        bounds of d1
                end if
                
                if c = 2 or c = 5 then
                        set d2 to make new text window
                        set the bounds of d2 to {w + s, 45, w + s + w, h}
                        bounds of d2
                end if
                
                if c = 3 or c = 5 then
                        set d3 to make new text window
                        set the bounds of d3 to {w + s + w + s, 45, w + s + w + 
s + w, h}
                        bounds of d3
                end if
                
                set the files visible of every window to "false"
                beep
        end tell
        
on error errMsg number errNum
        set {cr, sep} to {return, "------------------------------------------"}
        set e to sep & cr & "Error: " & errMsg & cr & sep & cr & "Error Number: 
" & errNum & cr & sep
        beep
        display dialog e
end try

I liked your try wrapper.  I now have that kept filed away.  Excuse the 
troubleshooting conditionals.  My windows weren't rendering properly.  I 
actually spent a long time trying to set the bounds properties only to realize 
it might have to bet set afterwards.  Sometimes it doesn't work.  

But this works.  Thanks for your post.  I will see if I can measure my first 
finder/desktop window dimensions.  


On 2011-12-12, at 5:21 PM, Christopher Stone wrote:

> On Dec 12, 2011, at 14:37, Rich F wrote:
>> Trying to open 3 text windows vertically on a large monitor, with no 
>> drawers. I was told that the DocD property is the property to set, but not 
>> sure how this would be done. Getting properties doesn't show anything for 
>> this new text window for DocD.
> ______________________________________________________________________
> 
> Hey Rich,
> 
> You're trying to script this?
> 
> You want the script to open new text windows?  Or the 3 frontmost existing 
> text windows?
> 
> Uncomment the loop if you want the script to create the windows.
> 
> try
>   tell application "Finder"
>     set screenBounds to bounds of window of desktop
>   end tell
>   
>   set item 2 of screenBounds to 44
>   set {x1, y1, x2, y2} to screenBounds
>   set splitScreen to x2 div 3
>   set winBoundsList to {}
>   repeat with i from 0 to 2
>     set end of winBoundsList to {x1 + (i * splitScreen), y1, x1 + ((i + 1) * 
> splitScreen), y2}
>   end repeat
>   
>   tell application "BBEdit"
>     
>     #     repeat with i from 1 to 3
>     #       make new text document
>     #     end repeat
>     
>     if (count of windows) ≥ 3 then
>       set winList to name of windows 1 thru 3
>       set AppleScript's text item delimiters to return
>       set winList to winList as string
>       set winList to sort lines winList
>       set winList to text items of winList
>       repeat with i from 1 to 3
>         tell window (item i of winList)
>           set files visible to false
>           set bounds to (item i of winBoundsList)
>         end tell
>       end repeat
>     end if
>   end tell
> on error errMsg number errNum
>   set {cr, sep} to {return, "------------------------------------------"}
>   set e to sep & cr & "Error: " & errMsg & cr & sep & cr & "Error Number: " & 
> errNum & cr & sep
>   beep
>   display dialog e
> end try
> 
> --
> Best Regards,
> Chris
> 



_____________
Rich in Toronto

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to