Split display first two scripts

I write alot of script with a ‘reference’ script on onside of the screen, ie reusing code that I dont fully understand that Shane wrote :wink:

And for literally years I have been placing the two windows side by side neatly on screen. Then this morning it dawned on my that a few lines of code could do this for me, Oh the hours I spend writing scripts to make others more efficient without looking at myself!!

Anyway save this as a scpt and place in the SD script folder and then with a click the first two windows arrange them selves.

set theFrame to current application's NSScreen's screens()'s firstObject()'s visibleFrame()
set {screen1, screen2, screen3, screen4} to {item 1 of item 1, item 2 of item 1, item 1 of item 2, item 2 of item 2} of theFrame

tell application "Script Debugger"

set the bounds of first window to {screen1, 0, screen1 + screen3 / 2, screen4}
set the bounds of second window to {screen1 + screen3 / 2, 0, screen3, screen4}

end tell

I just tried it with FastScripts to launch it via a keyboard shortcut. Seemed to work for me.

1 Like