Restore Safari’s Downloads Keyboard Shortcut
July 22nd, 2011I’m pretty excited about most of the enhancements in OS X Lion, and in Safari 5.1, which was released along with it. But one of the most annoying changes in the version of Safari that ships with Lion is the removal of any keyboard shortcut for showing and hiding the active downloads list.
Downloads used to be shown in a completely separate window, which could be toggled using the keyboard shortcut Cmd-Opt-L. In Lion, they appear in a popover panel attached to the toolbar of whatever browser window you happen to be using. Unfortunately, there is no keyboard shortcut to toggle the appearance of this popover.
Using FastScripts and a simple UI Scripting script, I was able to restore this functionality, so that Safari on Lion toggles the panel using the familiar Cmd-Opt-L shortcut.
Download the “Toggle Downloads Popover” script
Download the script, and copy it to:
[Home] -> Library -> Scripts -> Applications -> Safari
Here it will show up in FastScripts (or Apple’s script menu) only when Safari is the front-most app. You can also assign it a keyboard shortcut, like Cmd-Opt-L, that will only be active when Safari is active.
Important: If your Mac is not configured to run with English as the primary language, the script will not work without a minor adjustment. You will need to open up the script and change the text string “Downloads” to the language-specific description for the downloads panel in your language. For example, to make it work with Safari running in Spanish, you would change the string to “Descargas”.
I find it very useful to be able to popup the panel when I am checking on the status of a long download, or when I want to check quickly whether I already downloaded something I had intended to. Hope this script works well for you as well!
July 22nd, 2011 at 3:18 pm
Thanks, Daniel, this is great. One issue: is it just me, or does full-screen mode break AppleScript? Neither this script nor the typical “Open URL in Chrome” scripts seems to work in full-screen mode, even though both still work in normal mode…
July 22nd, 2011 at 3:41 pm
Same here: does not work in full-screen mode. But great idea otherwise– thanks!
July 22nd, 2011 at 3:42 pm
Interesting observations about Full Screen Mode. I’m seeing the same thing, but not for all scripts. Maybe apple disables GUI scripting in full screen mode?
July 22nd, 2011 at 4:12 pm
Thanks Daniel!
July 22nd, 2011 at 4:29 pm
Thanks, I was missing this shortcut. Finding a little icon on the toolbar is a pain.
July 22nd, 2011 at 5:29 pm
I previously thanked for this, but it only works when the Downloads icon is in the menu bar. If you’ve switched away to another window or closed the window with the download, you’re out of luck with this shortcut. Maybe someone can come up with a more general solution.
July 23rd, 2011 at 2:00 am
For those of us who prefer the toolbar hidden occasionally:
try
click (first button of tool bar of window 1 whose accessibility description is localizedDescription)
on error
click menu item “Show Toolbar” of menu 1 of menu bar item “View” of menu bar 1
click (first button of tool bar of window 1 whose accessibility description is localizedDescription)
end try
July 23rd, 2011 at 9:41 pm
“You can also assign it a keyboard shortcut, like Cmd-Opt-L, that will only be active when Safari is active.”
I’m finding the keyboard shortcut active in all apps, not just safari. I think this is just me, because I saw that once before (and was why I removed keyboard shortcuts from my FastScripts).
July 23rd, 2011 at 11:05 pm
@Rob – Did you put the script in the “Applications/Safari” subfolder of your scripts folder? If it’s not in that “magic” application-specific directory, then the keyboard shortcut will be considered global instead of application-specific.
Daniel
July 24th, 2011 at 4:17 pm
That would be it, wouldn’t it! What a noob! Have only been using this for how many years and I missed that.
Thanks, Daniel.
July 24th, 2011 at 7:55 pm
Would still prefer Apple to put this back in. Even the internal help file lists CMD-OPT-L for downloads…
July 24th, 2011 at 8:04 pm
@Chris – I agree, and I have reported a bug to Apple asking for the shortcut to be restored.
July 27th, 2011 at 4:40 am
Here’s to hoping Firefox puts their download window in a popover panel soon, there were designs for this last year. Great that people can enjoy this feature in Safari though!
August 6th, 2011 at 3:59 pm
Nice script, Daniel! Any chance you could add a test for whether Safari currently has a window open? I often close all windows while downloading something. Right now when you run the script with no windows open you get:
Error Number:System Events got an error: Can”™t get window 1 of application process “Safari”. Invalid index.
-1719
I tried to do it myself but my AppleScript foo isn’t up to it. (Read: I have no AppleScript foo.)
August 6th, 2011 at 4:00 pm
Hi Zev – yeah, it should be reasonably easy to do something like that, but I have to admit I’m a little overwhelmed with other stuff now, so I might not get to revising the script for some time. Glad you like it!
September 2nd, 2011 at 12:13 am
Mahalo for your tip.
This is probably a basic question, but I’d like to know how to reverse this process as well.
September 2nd, 2011 at 6:37 am
Great!
I added an if focus statement before acting, just in case other application use the same shortcut.
Instade of Fast Script, I recommend using Apptivate from the App Store.
It’s just all you ever wanted from an keyboard activation app, and it’s cheeper.
September 2nd, 2011 at 8:49 am
Michael: It all depends on how you decide to set up the keyboard shortcut. If you’re using my FastScripts tool, you could reverse the process by deleting the keyboard shortcut setting for the script.
Elad: One of the nice things about FastScripts is if you set a keyboard shortcut for a specific application, it will only make the keyboard shortcut active while the application is active. I haven’t had a chance to check out Apptivate yet.
November 6th, 2011 at 5:40 pm
In 5.1.1 “Show Downloads” has been added to the View menu, and the old shortcut restored. I recently discovered this by accident when I forgot I wasn’t on my older machine.