Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Left Side Dock' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Left Side Dock
Authored by: Anonymous on Nov 27, '01 12:31:22PM

edit the following lines:

set the bounds of this_window to {0, (monitor_height * 0.7) div 1, monitor_width, monitor_height}

set the bounds of this_window to {0, (monitor_height * 0.04) div 1, monitor_width, (monitor_height * 0.68) div 1}

to:

set the bounds of this_window to {100, (monitor_height * 0.7) div 1, monitor_width, monitor_height}

set the bounds of this_window to {100, (monitor_height * 0.04) div 1, monitor_width, (monitor_height * 0.68) div 1}

or whatever value (in pixels) you want in place of 0

Y



[ Reply to This | # ]
This is rather fun!
Authored by: james_sorenson on Nov 27, '01 03:25:51PM

Nice piece of work! I gave it a hot-key using DragThing. I modified it to make space for (and activate) Drag Thing down the left-column and to close all existing Finder windows first. Now, with a press of a couple keys, DragThing comes forward, and my top window spans across and goes to my Home folder. Since I'm using the hack that removes the preview panel, my bottom window goes to my Temporary directory and leaves space for the Get Info window. The Get Info window moves to the bottom-right.

Ahhhhh...my screen is filled with DragThing, two Finder Windows, the Get Info Window, and the Dock. I've wasted too much time playing with this script, but your script was an inspiration. Thanks!



[ Reply to This | # ]
This is rather fun!
Authored by: DragonsBane on Nov 27, '01 09:53:31PM

Care to share? Would love to see your revised script =)



[ Reply to This | # ]
This is rather fun!
Authored by: james_sorenson on Nov 28, '01 02:00:49PM

Okay, here is my revised script. I didn't compile it as an application, but just
assigned it a hot-key. Using the script menubar item is also rather nice.
Here it is:

--FinderInit.scpt
--This script activates DragThing, opens two finely positioned Finder Windows, and opens the Info Window

--True Monitor size
property monitor_width : 1152
property monitor_height : 870
--Thicknes of titlebars (to prevent overlapping)
property menubar : 23
--Margins to make room for DragThing, Dock, Desktop items, etc
property leftmargin : 138
property rightmargin : 0
property topmargin : 0
property bottommargin : 54
--Height and width of the Info Window (will be placed to the right of the bottom window)
property infowidth : 280
property infoheight : 335


--Bring DragThing to the front (delete if you don't have it)
tell application "DragThing"
activate
end tell


tell application "Finder"
--set default directory (Notice that "home" represents your home directory)
set folder1 to home
--This is how you can refer to a subdirectory in your Home directory
set folder2 to ((home as string) & "Documents") as alias
--Use this if you'd prefer your bottom folder to go to root
--set folder2 to the startup disk

--clean up
activate
close every Finder window

-- BOTTOM WINDOW
set bot_window to make new Finder window
set the target of bot_window to folder2
--monitor origin is upper-left corner
--{left,top,right,bottom}
set the bounds of bot_window to {leftmargin, (monitor_height - infoheight - bottommargin),
(monitor_width - rightmargin - infowidth), (monitor_height - bottommargin)}
set the current view of bot_window to column view

-- TOP WINDOW
set top_window to make new Finder window
set the target of top_window to folder1
--monitor origin is upper-left corner
--{left,top,right,bottom}
set the bounds of top_window to {leftmargin, topmargin + (menubar * 2),
(monitor_width - rightmargin), (monitor_height - infoheight - bottommargin - menubar)}
set the current view of top_window to column view

-- INFO WINDOW
--Applescript currently can't set the position or bounds of the Info Window.
--Just move it to where you want it, close it, then open it. From then on, it will open in the proper place.
open information window of folder1
--set info_window to the information window
--set the position of info_window to {(monitor_width - rightmargin - infowidth), (monitor_height - infoheight - bottommargin)}

--Reactivate TOP WINDOW
select top_window
end tell



[ Reply to This | # ]
This is rather fun!
Authored by: Anonymous on Nov 28, '01 11:37:44PM

Great script!

Have you figured out how to tell the inspector to go to preview mode?

Your margin system is excellent.

I'm using a variation of your script now.

Cheers,

Y



[ Reply to This | # ]
Left Side Dock
Authored by: chadders on Nov 28, '01 03:12:03AM
set the bounds of this_window to {100, (monitor_height * 0.7) div 1, monitor_width, monitor_height}

set the bounds of this_window to {100, (monitor_height * 0.04) div 1, monitor_width, (monitor_height * 0.68) div 1}


Could someone please talk through these lines of the script that obviously position the windows on the screen, but which bits affect which elements of a window?

I think I've got most of it, but I am not sure about the * 0.7 type bits?

[ Reply to This | # ]
New easier script
Authored by: Anonymous on Nov 28, '01 09:15:24PM

This one just uses pixel numbers and is optimized for a 1024x768 screen with the dock at the bottom.

I have replaced the variables and functions to calculate window bounds with pixel values.

The bounds appear to be an array of the following values:

(left edge at # of pixels from left, top edge at # of pixels from top, right edge at # of pixels from left, bottom edge at # of pixels from bottom)

where the titlebar of the window is ignored.

Just change these numbers to change the window placement. Experiment for yourself until you get it the way you like it.

Cheers,

Y
___________________

set the startup_disk to (path to startup disk)

tell application "Finder"
activate
set visible of (every process whose visible is true and frontmost is false) to false
-- BOTTOM WINDOW
set this_window to make new Finder window
set the target of this_window to the startup_disk
set the bounds of this_window to {0, 400, 1024, 700}
set the current view of this_window to column view
-- TOP WINDOW
set this_window to make new Finder window
set the target of this_window to the startup_disk
set the bounds of this_window to {0, 46, 1024, 375}
set the current view of this_window to column view
end tell



[ Reply to This | # ]
New easier script
Authored by: chadders on Nov 29, '01 03:30:46AM

Thanks for the modified script... I can follow that logic! I am interested in what the other script was actually doing however... if you can spare the time a brief explanation would probably help me understand it better. Your modified script is working great on my system here, and I like it's functionality a great deal. Excellent, thank you.



[ Reply to This | # ]
New easier script
Authored by: james_sorenson on Nov 29, '01 02:10:16PM
Alas, although the Finder dictionary shows the syntax to change the
inspector panel, it refuses to do so. According to the dictionary,
the syntax would be:

set the current panel of the information window to Preview panel

But, it says:

"Can't set <<class panl>> of <<class iwnd>> to <<consant ipnlvpnl>>."

Oh well, I guess it hasn't been implemented yet.

[ Reply to This | # ]