Workaround #2
My preferred solution uses applescript to access "Downloads.plist" directly (no shell scripting), and places a link in Safari's favorites bar for your convenience.
First you save these scripts into "~/Library/Scripts/Folder action scripts/" folder, next you attach them
(context menu: configure folder actions) to a new "Folder1" somewhere deep down on your Mac.
To activate them, you will address a (meaningless) dummy "Folder2" inside "Folder1" thru this bookmark:
file:///Path/to/first/Folder1/Folder2 [place link in your favorites bar!]
Now, what's happening:
- The clicked-on toolbar link will open "Folder1" because the called upon "Folder2" is inside.
- Thus BOTH attached scripts are launched, #-1 closing the bookmarked "Folder2" window...
- ... next ordering "System Events" to get all of Safari's "DownloadEntryPath" items.
- These paths are shortened to name plus parent-folder and collected into a "dialog alert".
- (Waiting for "dialog window":) #-2 script immediately on pop-up moves it to the top-right.
on opening folder this_folder
tell application "Finder" to close front window
tell application "System Events"
set the plist_path to "~/Library/Safari/Downloads.plist"
set the plist_file to property list file plist_path
set downloadItems to property list items of property list item ¬
"DownloadHistory" of plist_file
set DL_display to ""
set AppleScript's text item delimiters to {"/"}
repeat with i from 1 to number of items in downloadItems
set DL_item to (get text items -2 thru -1 of ((value of ¬
property list item "DownloadEntryPath" of property ¬
list item i of property list item 1 of plist_file) as string))
set DL_display to DL_display & return & "[" & ¬
text item 1 of DL_item & ":]" & return & text item 2 of ¬
DL_item & return
end repeat
tell application "Finder" to display dialog DL_display as string ¬
buttons {"Close"} default button 1 -- NEW: tell appl. "Finder" to
end tell
end opening folder
If you attach this 2nd "folder action script", it'll move the "dialog" to the right/top of your screen:
on opening folder this_folder
tell application "Finder"
set screenRgt to bounds of the window of desktop
set rightEdge to (item 3 of screenRgt) - 425
end tell
tell application "System Events" to tell process "Finder"
repeat while not (exists window "Recent downloads")
end repeat
delay 0.1 -- wait (and make sure...) for "dialog window" !
set position of window "Recent downloads" to {rightEdge, 61}
end tell
end opening folder
The only drawback to this solution IMO is, that for a moment each the opened folder and the alert "flash" over your screen...
downloads://
(like bookmarks://)