Roy McCoy AS: Scripting ID doc window positions [was: Scripting Finder list views]
Feb 12, 2010; 19:23
Roy McCoy
AS: Scripting ID doc window positions [was: Scripting Finder list views]
I wrote:
>> tell application "Safari" >> set Disp to (do shell script "system_profiler ¬ >> SPDisplaysDataType | grep Resolution | awk '{print $2, $4}'") >> if Disp = "1440 900" then --MBP screen 1440 x 900 >> set bounds of window 1 to {0, 22, 1400, 900} >> else --office screen 1920 x 1200 >> set bounds of window 1 to {0, 22, 1872, 1200} >> end if >> end tell > > Gah. But we shall overcome, Richard!
This is going surprisingly well, and Richard and I are having a great time with our windows. The above trick to get the screen is indeed geekish and I would never have come up with it myself, but once you have it it's easy to apply it to each individual script - though I've found I have to change "=" to "contains" to make it work. In a fairly brief period at home today, screwing off before coming into the office (where I'm continuing to screw off :-), I adapted all the Finder and Mail scripts to both screens, and then added the same ones with Script Editor in only a couple of minutes. (There's another good excuse not to buy Script Debugger: that I now have my window-resizing scripts in Script Editor. A further classic one on that account is that Script Editor now has find and replace, which it didn't before while Script Debugger did.)
I'm carrying on with the window resizing now owing to two hankerings: one for being able to do it with InDesign doc windows, and another for being able to send to quadrants and sides (maybe I shoulda done top and bottom too, so as not to have to add that later) of the laptop screen off to the side in the office.
I'm starting off with InDesign and will leave the second-screen zooms till later. Unless I want to create two versions and choose between them later, I need to choose between two alternatives relating to the panels at the right of the screen.
(1) The normal situation is that document windows zoom up to the left of the vertical row of collapsed panels:
These are as small as I can make them, and I wouldn't have them at all if I could get rid of them and still have the panels come up the way I want when I hit their keycode, e.g. cmd-opt-F11 for Scripts:
All the panels open in this column space, one at a time via their keycodes, and they obviously don't present a problem in this single- page case. It's different if I have a two-page spread, however:
Or is it? I thought the panels were covering text on the rectos, but they're not in the first three docs with two-page spreads that I've opened to check. They will when I reduce and zoom to the right, though, so I'll try keeping them totally out of the way....
But alas, I've wiped out! I have no idea why, but the InDesign resizing scripts are toggling on me when I don't want them to. When I run this:
tell application "Adobe InDesign CS4" tell layout window 1 of document 1 set bounds to {100, 50, 500, 400} end tell end tell
it toggles between the requested coordinates and the maximum zoom of the screen. Does it do that for you guys too? I would like to know. If the zoom generally works the first time it's applied I guess I could live with that... and it could even be useful a lot of times, I guess. And anyway I got them working with the cmd-opt-1/2/3/4/l/r/t/b keycodes, so mission accomplished. Maybe I'll do the second-screen quadrant zooms tomorrow.
Thanks,
Roy
-- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/InDesign/Browse/ Manage your subscription: http://www.ListSearch.com/InDesign/
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!