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

10.6: An AppleScript to check complete page loading in Safari Web Browsers
Snow Leopard only hintThis code will basically run until the currently-loading page is done loading in Safari. This code is working in Safari 4.0.3 running on OS X 10.6; I haven't tested in other versions of Safari or the OS. [robg adds: To use this script, save it to your user's Library » Scripts » Applications » Safari folder (create any of those folders if they don't exist). I'm not positive, but I think the idea here is that you can use this script if you're on a very slow connection and/or trying to load a very slow-loading page. Just put the URL into Safari, press Return, then run the above script via the Script menu item. You can then just wait for your Mac to say loaded when the page is done loading.

I had trouble finding a site that would load slowly enough to let me invoke the script, but I eventually found one; the script works as described in 10.6 (it won't compile in 10.5).]
  Post a comment  •  Comments (4)  
  • Currently 1.79 / 5
  You rated: 2 / 5 (19 votes cast)
[10,037 views]  View Printable Version
Set default zoom level in Safari using a CSS file Web Browsers
In this post on Apple's discussion site, user dearlt posted a great tip on how to get Safari to use a default zoom level of your own choosing (instead of the standard 100%). I've edited the post a bit to make it clearer, but the basic instructions are unchanged.
  1. Create a file (using a pure text editor) named defaultzoom.css, or any name you like -- just make sure it has a .css extension.
  2. Copy and paste the following code into the file:
    body {
    zoom: 130%;
    Change 130 to whatever number suits you. Anything greater than 100 means zoom in; less than 100 means zoom out. Don't forget the % percent sign!

    If you're using TextEdit on a Mac, be sure to have it create .txt documents by default (not .rft) before copying and pasting the above text. You can set this by going to Preferences » New Document » Format. When you save the file, a warning will come up stating that .txt is the standard extension, but you will be given the option of .txt or .css.
  3. Save your file and close the editor.
  4. In Safari, go to Preferences » Advanced. Under Style Sheet, select Other, and point it to the file you created. You may need to restart Safari for the change to take effect.
Voila. Hope that helps someone. (Note that this should work on both OS X and Windows versions of Safari.
  Post a comment  •  Comments (20)  
  • Currently 3.71 / 5
  You rated: 5 / 5 (31 votes cast)
[80,757 views]  View Printable Version
10.6: Create an RTF-formatted link to current Safari page Web Browsers
Snow Leopard only hintTo copy a clickable hyperlink of the currently shown website from Safari (with the website title and its URL embedded in it) to the clipboard, in order to paste it somewhere else, you would have to: Open a rich text editor, drag the link from the Safari URL bar to the text editor, Control-click on the created hyperlink, and finally, click on Copy Link. This is tedious work. Safari should have a "copy hyperlink to clipboard" button.

Because it didn't, I wrote my own Service in 10.6 to get the job done. Here's how:
  1. Open Automator and create a new Service. In the Service Receives section, set the two drop-down menus to No Input and Any Application.
  2. Find and drag the Run AppleScript action into the work area.
  3. Paste the following AppleScript into the code box in the action item:
  4. tell application "Safari"
      set theURL to URL of document 1
      set theTitle to name of document 1
      set startEcho to "echo "
      set echoDelimiter to "'"
      set html_1 to "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"\">
        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
        <meta http-equiv=\"Content-Style-Type\" content=\"text/css\">
      set html_2 to "</title>
        <meta name=\"Generator\" content=\"Cocoa HTML Writer\">
        <meta name=\"CocoaVersion\" content=\"1038.11\">
          <style type=\"text/css\">
            p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
      <p class=\"p1\"><a href=\""
      set html_3 to "\">"
      set html_4 to "</a></p>
      set echoCommand to startEcho & echoDelimiter & html_1 & theTitle & html_2 & theURL & html_3 & theTitle & html_4 & echoDelimiter
      set textutilCommand to " | textutil -convert rtf -inputencoding UTF-8 -format html -stdin -stdout"
      set pbcopyCommand to " | pbcopy -Prefer rtf"
      set entireCommand to echoCommand & textutilCommand & pbcopyCommand
      do shell script entireCommand
    end tell
    This AppleScript sends a string that contains the website title and URL in html format to the terminal program textutil. textutil converts that HTML string into an RTF-formatted string and sends it to pbcopy, which copies the string to the Mac OS clipboard.
  5. Save this Service with any name you like.
  6. Open System Preferences » Keyboard, and select Services in the left-hand column.
  7. Select the Service you just created, and define a keyboard shortcut for it.
Now, every time you press that shortcut, from any Services-aware application, a clickable hyperlink with the title and the embedded URL of the currently-active Safari tab will be copied to the Mac OS clipboard, ready to be pasted in any other application. This works great with an app that keeps track of your recent clipboard items.

[robg adds: This works fine in 10.6, and can be used in 10.4 and 10.5 as well, though not as a Service. Because textutil was added in 10.4, this hint won't work in older system releases.]
  Post a comment  •  Comments (22)  
  • Currently 1.58 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (12 votes cast)
[7,353 views]  View Printable Version
Delete Safari cookies so they stay deleted Web Browsers
This is a very simple hint, but I haven't found the information anywhere else.

When you delete cookies in Safari 4, whether from within its Preferences dialog or in some other way, they will all mysteriously reappear anywhere from a few minutes to perhaps an hour later. I've seen several accounts of why this happens and how to prevent it, but none of them worked for me.

What did work is this: after deleting the cookies, quit Safari immediately, before it has time to restore them. When you relaunch Safari, the cookies will be gone for good. Apparently they're being cached in memory and written back to the Cookies.plist file periodically.
    •  Comments (11)  
  • Currently 3.11 / 5
  You rated: 1 / 5 (27 votes cast)
[33,544 views]  View Printable Version
10.6: Run Safari 4 Beta in Snow Leopard Web Browsers
I, like many others, really liked the tabs-on-top look the Safari 4 Beta had, and felt cheated when it was removed from the final version. It's not really devastating to be missing this, but as a laptop user, I want to have every centimeter of screen for something meaningful.

I forgot to back up the Beta application, but I did keep the installer. Using Pacifist, I unpacked the application, and tried to run it. However, at least as of 10.6, the Safari 4 beta won't launch.

Luckily, all you need to do is replace the Beta's info.plist and version.plist files with those from Safari 4 Final. These are found in the application bundle (Control-click and pick Show Package Contents from the pop-up menu). You might also want to replace useragents.plist from within Resources. For safety, back up your preferences before you run Safari 4 Beta.

I have not found any issues running this, and the only minor oddity was an initial lack of a URL entry box. I customized the toolbar and dragged it back on, and that worked fine. The best part? The Beta will use the most recently installed WebKit, and thus gets much of the same speed boost as the final version. I hope this helps someone; I know I'm happy.
  Post a comment  •  Comments (33)  
  • Currently 3.00 / 5
  You rated: 2 / 5 (18 votes cast)
[14,653 views]  View Printable Version
Create a floating Pandora Radio widget-app Web Browsers
After reading in MacWorld about creating a standalone video playback widget, I thought I could apply the same technique to create a Pandora radio widget that stays open all the time.

I created a web clip in Safari, selecting the relevant portion of the Pandora site. Then I followed the directions in the MacWorld article (also in this hint) to enable the removal of widgets from Dashboard. I then opened Dashboard and started dragging my Pandora widget around, and pressed F12 to close the Dashboard, which transferred the widget to the Desktop. The widget will now stay open whether Dashboard is running or not, and whether Safari is running or not.

[robg adds: Safari's Web Clip feature is quite useful for things such as this, though it suffers one near-fatal flaw: you cannot save widgets that you create with Web Clip. If you click the widget's close button, it's gone for good.]
  Post a comment  •  Comments (4)  
  • Currently 1.89 / 5
  You rated: 5 / 5 (9 votes cast)
[11,206 views]  View Printable Version
Recreate 'Page Snapback' feature in Safari 4 Web Browsers
I was unhappy when Safari lost the Page Snapback command from the History menu. This command would take Safari back to the very first History page for that window/tab. Well, here's a little javascript bookmarklet that does the same job.
Create a new bookmark, and enter that into the Address field. I keep mine on the bookmark bar, and it works fine for my needs. I wish I had thought of this sooner!
  Post a comment  •  Comments (14)  
  • Currently 1.73 / 5
  You rated: 4 / 5 (11 votes cast)
[7,646 views]  View Printable Version
Change the size of Safari's QuickTime controls Web Browsers
In the past, in-browser QuickTime controls were extremely awkward. Loading an MP3 track in Safari, for instance, would yield controls that were incredibly tiny. Things have gotten a little bit better with the latest Safari release.

You can now use the zoom feature, via the View » Zoom In (or Out) menu items (and their keyboard shortcuts), or by using "pinch-to-zoom" if you're on a laptop.

The controls can now be much larger, although the scrobbling icon is at a fairly poor resolution.

[robg adds: As submitted, this hint discussed QuickTime X as the source of zoomable controller, but it seems to be based on Safari's page zoom feature. Although Firefox also has a page zoom feature, it won't zoom the QuickTime controller. This hint should work in both 10.5 and 10.6.]
  Post a comment  •  Comments (2)  
  • Currently 1.63 / 5
  You rated: 3 / 5 (8 votes cast)
[5,099 views]  View Printable Version
Zoom out to see more of a Google Docs spreadsheet Web Browsers
One of the features of version 4 of Safari is that it preserves the layout of a webpage when you zoom in or out (Command-Plus and Command-Minus, or use the View menu bar item). This is because, unlike previous versions, any element on the webpage is also zoomed, not just the text.

One pleasant side effect of this is that you can emulate Excel's Zoom Out/In feature on Google Doc's spreadsheets with version 4 of Safari. This allows you to see more of your spreadsheet when required.

[robg adds: This also works in Firefox, and probably any other browser that supports full-page zoom.]
  Post a comment  •  Comments (2)  
  • Currently 2.00 / 5
  You rated: 1 / 5 (9 votes cast)
[12,562 views]  View Printable Version
Search Gmail with keyboard shortcut in Safari with Glims Web Browsers
With Glims for Safari it is possible, among other things, to add custom search engines to Safari. You can also search within your Gmail inbox this way. With a keyboard shortcut assigned, it proves a quick way to search and acces your inbox.

Add this query URL for the custom search engine:,#query#
[robg adds: I haven't tested this one. If you're using Snow Leopard, you'll either have to run Safari in 32bit mode, or wait for an updated version of Glims (which is apparently in the works, based on comments the Glims developers have made).]
  Post a comment  •  Comments (0)  
  • Currently 1.45 / 5
  You rated: 1 / 5 (11 votes cast)
[5,810 views]  View Printable Version