I've been working around a strange bug in the Mac OS X Finder with an AppleScript for quite some time now. Most users don't notice the bug at all, but I do. Rather than describe it, follow these steps and see it for yourself:
Read the rest of the article for the script...
Here's the script. It works best when run at login automatically:
I wish the script were smarter, obviously. I'd like to fix that problem I just noted, as well as add the reindexing of the window so it goes to the z-axis position it was at before it was closed [e.g., if it was the bottom-most window, put it back there]. I'd also like to be able to combine the opening and positioning of the new Finder window into one line, but can't figure out how to do it while attaching a variable to that window so I can reset its target. Oh well, I suppose. I'm sure someone can hack it if they need to fix something they don't like! Go open source!
Anyway, the script gives me back some of my sanity, so perhaps it'll do the same for some other Mac OS X users bothered by this Finder shortcoming.
- Make a new Finder window
- Set its view style to column
- Adjust the column width/s with the slider, making them wider together
- Leave the window open and log out
- Log back in. At this point, your window will be open, but its columns will be at OS X's default widths.
- Close that window
- Open a new Finder window (should default to column view now)
Read the rest of the article for the script...
Here's the script. It works best when run at login automatically:
on runThe script used to be even dumber, but at least now it identifies the topmost window set to column view (really, it doesn't, but luckily, the first item put into daWindows is the topmost window set to column view), opens a new window set to column view, takes that window to wherever it was before it was closed, and repositions it to wherever it was before it was closed. The only drawback is that the line "set current view of arf to column view" resets your default window to column view. I don't use this line at all, myself, 'cause my new Finder window (command-n) is already in column view when it appears.
tell application "Finder"
activate
if (count of windows) is greater than 0 then
set daWindows to (every Finder window whose current view is column view) as list
set dork to (item 1 of daWindows)
set {dorkTarget, dorkPosition} to {(target of dork), (position of dork)}
close dork
set arf to (make new Finder window)
-- you can remove the next command if your default command-n window is a
-- window set to column view, or if you don't like your command-n window
-- reset to column view
set current view of arf to column view
set {(target of arf), (position of arf)} to {(dorkTarget), (dorkPosition)}
else if (count of windows) is equal to 0 then
set fix to (make new Finder window)
close fix
end if
end tell
end run
I wish the script were smarter, obviously. I'd like to fix that problem I just noted, as well as add the reindexing of the window so it goes to the z-axis position it was at before it was closed [e.g., if it was the bottom-most window, put it back there]. I'd also like to be able to combine the opening and positioning of the new Finder window into one line, but can't figure out how to do it while attaching a variable to that window so I can reset its target. Oh well, I suppose. I'm sure someone can hack it if they need to fix something they don't like! Go open source!
Anyway, the script gives me back some of my sanity, so perhaps it'll do the same for some other Mac OS X users bothered by this Finder shortcoming.
•
[6,218 views]

