I use Safari and browse with tabs. I like having everything in one window. Sometimes however, I come across a page that I am already viewing that I want to be in a separate window. So I made an Automator app to take care of it for me.
Its a simple three step app. Start with the Get Current Webpage from Safari action in the Safari library, then add the Display Webpages (also in the Safari library) action (this will open your URL in a new window), and finally, add a Run AppleScript action with this script:
on run {input, parameters}
activate application "Safari"
tell application "System Events"
tell process "Safari"
-- GUI Scripting statements:
keystroke "m" using {command down}
end tell
end tell
return input
end run
Save this as an application somewhere on your hard drive. It takes about three seconds to run the app on my G5, which I think is worth it for not cycling through a tab that I know isn't related to my current surfing activities. I also invoke the app through a trigger in Quicksilver, so that it is readily available.
The Applescript portion of the Automator app was modified from a previous hint submitted by meanbone, since I am not that great with AppleScript.
As the PDF plugin is currently PowerPC only, it does not work on Intel Macs. The only workaround is to run the browser within Rosetta. For Safari and Firefox, this is not a huge problem as both are able to view inline PDFs (the first with its own engine, and both via Adobe Reader 8). Sadly, this doesn't work with Camino which is quite annoying.
As QuickTime is able view PDFs, I tried to change the MIME type settings in order to let the QuickTime plug-in handle PDF files. Sadly, the necessary setting in the QuickTime Preference Pane doesn't seem to stick, or Camino seems to ignore it.
I finally discovered (through the help of the Camino Mailing List) that Camino also stores this information in the file pluginreg.dat (to be found at ~/Library -> Application Support -> Camino). So if you add an entry which forwards PDFs to the QuickTime plug-in, you're finally able to view PDFs inline again.
The line has to be added to the end of the QuickTime Plug-in section, and looks like this:
nn:application/pdf:PDF image:pdf:$
Where nn is the next free number within this section. In my case, that was 62. You also have to increase the counter at the beginning of the section by one (in my case to 63, as the list starts with 0).
Sadly nothing is without disadvantages: You will only see the first page of the PDF, as the QuickTime controller is not shown, and zooming is not possible. Hopefully Adobe will include Camino support in future releases of Adobe Reader, or the PDF Browser Plug-in will be released as a Universal Binary.
If you're downloading a lot of large audio or video files in Safari, you may want to preview them while downloading. Normally you need to right-click the ".download" file, select "Show Package Contents", then double-click the actual file. But an AppleScript can make things quicker:
tell application "Finder"
repeat with selected_file in (selection as list)
if ((selected_file as text) ends with ".download") then
set plist_path to (selected_file as text) & ":Info.plist"
if (exists file plist_path) then
tell application "System Events"
set partial_file_path to value of property list item ¬
"DownloadEntryPath" of contents of ¬
property list file plist_path
open partial_file_path
end tell
end if
end if
end repeat
end tell
Assign this to a keyboard command using a utility like Spark or Butler, and call it with the file selected in the Finder.
A friend recently switched to Mac, and asked me if Safari had an equivalent of the "Tile" function on a PC. After asking a few people and poking around, I decided to write a quick script to do just that. With some tweaking it can be used for other applications, and/or multiple apps.
[robg adds: I tested the script, and it works as described. Run it with a number of Safari windows open, and it places them all side-by-side, even spanning across multiple monitors. Each window is sized such that all of them will exactly fill the available horizontal space.]
One of the new features of Firefox 2.0 is the ability to scroll through your open tabs using arrows on either side of the tab bar. Today I noticed that if you have two-finger scrolling enabled on your MBP, after hitting either of the arrow keys, you can two finger scroll horizontilly to scroll through the open tabs. This only works when there are more open tabs than can be seen in the current window. I don't know how useful this is (I generally don't have 15 tabs open) but hopefully someone will be able to use it.
Note that this scrolling keeps the current tab selected, but you will be able scroll through the open tabs and see the name of the page opened in that tab. I also used this on a MacBook Pro using an Intel-optimized build of Firefox 2.0. I would assume that this would work the same in the standard Firefox 2.0.
In the Windows version of Firefox, if the user selects the "Open with..." option for a file on a webpage, the file is downloaded to the system Temporary files directory before being opened. In the Mac version of Firefox, the file is downloaded to the system downloads directory (The download directory one specifies in Safari and some others browsers, not the one specified in Firefox). This generally means that after viewing the file, you must manually delete it from your drive if you do not wish to keep it.
You can mimic the Windows behaviour simply by changing Safari's download directory to /tmp. To do this, open Safari's General preferences pane and, under Save Downloaded Files To, select Other.... In the dialog that appears, hit Shift-Command-G to bring up the Go to Folder dialog. In this dialog, simply type /tmp, hit OK, then hit Select in the main window.
From this point on, all files for which you select "Open with..." in Firefox will be downloaded to the invisible /tmp directory before being opened. The system clears this directory regularly, so there is no need to worry about manually deleting files you don't want. If you wish to move a file from this directory, you can either enter /tmp in the Finder's Go to Folder" field, or you can command-click in the title bar of an opened file in that directory to see the hierarchy.
[robg adds: Obvious but worth pointing out: if you make this change and then use Safari again, anything you download will also go into /tmp.]
Sometimes when I have many pages loaded as tabs in one Safari window, I would like to look at two of those pages at once. So I wrote an AppleScript called Load Tab in New Window (view source, download compiled script) that re-opens the frontmost tab in a new window and closes the original tab, effectively popping the page out into its own window. It's not perfect, but I find it handy.
If you need a bit more detail on the script, you can read about it here. This is somewhat similar to this hint, but much simpler.
Firefox users trying to view pdf files from a web link are greeted with a dialog box asking if they'd rather open the file with a given application, or save it to disk. If they choose to save it to disk, it will be saved to their defined downloads location, as set in Firefox's Preferences. However, if they select Open With, and leave the application set to Preview (default), then Firefox will download the PDF to another location. Which location, exactly? The one specified in Safari's preferences.
To redirect the PDF download to a specific location, launch Safari and open its Preferences panel, click on General, and set the 'Save downloaded files to' selection box to the spot where you'd like those PDFs to land.
[robg adds: I'd never noticed this behavior, as I usually have all the browsers set to download to the same location. But some quick experimentation proved that Firefox does indeed use Safari's save-to location setting when opening a file from the "do what with this file?" dialog box.]
In the latest version of Gmail, they introduced a more compact menu system for Reply (All), Forward, Delete, etc. via a drop down menu. Unfortunately, this menu does not work in the latest version of Safari under 10.4.8).
However, the keyboard shortcuts still work, so you can just hit reply, reply all, and forward. Note that you have to have the shortcuts enabled in Gmail's Settings screen for this to work.
Normally I use OnyX or Terminal to view hidden files. By accident today, I dragged a folder from the Finder onto my Firefox window, and it showed all the files in that folder (including the hidden ones). If you click on a file, it will download, or you can drag the links to an application in the Dock, etc. to open them.
For instance, I normally need to view hidden files if I need to edit a text file. You can just drag the text file straight onto a text editor like TextEdit, and it will open the file directly.
[robg adds: This also works in Camino, but not in Safari or OmniWeb. Since an application is nothing more than a fancy folder, you can also drag and drop an application into either browser's window to reveal the files in that application's bundle. This technique was mentioned back in 2002 in this hint, but since the browser landscape has changed dramatically since then (and the ability to see hidden files wasn't previously mentioned), I felt it worth publishing.]