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

An AppleScript to check complete page loading in Safari Web Browsers
Here is an AppleScript to check if the foremost window in Safari has finished loading the requested page. Some people have suggested using a do javascript solution way, and I know there are hints like this out there, but this seems to be the only bulletproof way to do things.

How does it work? Well, when you click on a link or request a page in Safari, the Safari status bar will always display the text Contacting... and subsequently Loading.... However, it seems not everyone knows how to access that text within AppleScript. So, here's how I did it:
--check if page has loaded
  repeat
    delay 0.5
    tell application "System Events" to 
    tell application process "Safari"
      if (name of static text 1 of group 1 of window 1 as text) 
      begins with "Contacting" or (name of static text 1 of group 1 
      of window 1 as text) begins with "Loading" then
      else
        exit repeat
      end if
    end tell
  end repeat
That code will basically run until the page is done loading in Safari -- hooray for infinite loops! You can make it into a subroutine, if you'd like. I'm sure there are other ways to use the status bar information, too.

[robg adds: This worked as described for me...]
  Post a comment  •  Comments (14)  
  • Currently 2.38 / 5
  You rated: 5 / 5 (8 votes cast)
 
[17,107 views] Email Article To a Friend View Printable Version
Quickly and easily clear selective data in Safari 3 Beta Web Browsers
Haven't seen this anywhere, so in case you haven't noticed: Safari 3 Public Beta has a quick way to purge those pesky website icons or "favicons" that show up in the address bar. Just select Reset Safari. . . and a nice dialog box pops up with check boxes giving you the ability to not only clear your favicons, but your cache, Google searches, cookies, and more.

In other words, you can now choose to only reset certain elements of Safari, not the entire thing. This enables you to quickly clear only your cookies and cache, for instance, but not loose your bookmarks and saved passwords. The also is a much faster way to clear you favicons than the old method of navigating to your Library » Safari » Icons folder and deleting the icons.db.

[robg adds: I hadn't even thought to look at Reset in the beta; this is a much nicer option than the current 2.x version's "reset everything" approach.]
  Post a comment  •  Comments (2)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[7,473 views] Email Article To a Friend View Printable Version
Fix broken Safari RSS article count updates Web Browsers
I have experienced this problem several times in the past few years, both on a G4 PowerBook and Intel iMac. For no reason, Safari will stop updating my RSS feed counts in the Bookmarks bar. RSS still functions and will update whenever a particular feed is selected, but the parenthetical numbers for each feed or folder do not change.

The fix is simple and doesn't hurt any of your RSS subscriptions. Just quit Safari, remove the Database3 file located in ~/Library » Syndication, and then launch Safari again. I move mine to the Desktop and trash it only after I've successfully restarted Safari and confirmed the problem is fixed. Safari will create a new file in its place.

Easy enough, but I've never seen it anywhere else online, and have forgotten it myself a few times.
  Post a comment  •  Comments (7)  
  • Currently 1.25 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[13,873 views] Email Article To a Friend View Printable Version
Open typed URLs in new tabs in Firefox Web Browsers
If you type the name of a website in Firefox, i.e. apple.com, then hit Option-Return instead of Return, it will open up apple.com in a brand new tab. You must have tabs activated for this to work.

[robg adds: I thought we had mentioned this before, but I can only find this hint regarding Safari. You can also do this in Camino via Command-Return (the same shortcut as Safari). In Safari and Camino, the new tabs open in the background, leaving you on the current tab. In Firefox, regardless of the settings on the Tabs page of its preferences, new tabs created in this manner jump to the foreground (using Firefox 2.0.0.4 on my machine).]
  Post a comment  •  Comments (2)  
  • Currently 2.17 / 5
  You rated: 3 / 5 (6 votes cast)
 
[7,396 views] Email Article To a Friend View Printable Version
View feed counts for bookmarked RSS feeds in Safari Web Browsers
I don't know how many people are suffering this, but whenever I add an RSS bookmark to my Safari 3.0 bookmark bar, it never updates with the number of new RSS articles against the name. Yet if I look at the bookmark in the bookmark manager, it happily shows the number of new articles, as seen in this screenshot.

I found that if you create a folder in your bookmark bar, then add your RSS feeds to that folder, it actually works as expected. The number of new articles appear as you would expect next to the site name within the folder, as seen in this image.

[robg adds: I think this is probably expected behavior, as adding the article count to bookmarks directly in the URL bar would cause the entries to change position as the message counts changed for each bookmarked RSS feed.]
  Post a comment  •  Comments (3)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[3,931 views] Email Article To a Friend View Printable Version
Easily open a URL from Safari in Firefox Web Browsers
I've seen other ways to go about this, but here's a nice and clean way to switch from Safari to Firefox on a misbehaving page. First, make sure you have the Safari debug menu enabled.

On the Debug menu in Safari, the Open Page With menu item will list your installed browsers; assuming you have Firefox installed, you'll see an entry for Open Page With » Firefox.app. Now quit Safari, and go to the Keyboard & Mouse System Preferences panel, click on the Keyboard Shortcuts tab, and create a new keyboard shortcut. Choose Safari as the application and enter Firefox.app as the menu title. I chose Command-Option-R as my shortcut, but feel free to choose whatever you think logical. Relaunch Safari and try your new shortcut. Note the same trick works with any browser in the Open Page With sub-menu.

[robg adds: On my machine, Firefox was listed without the .app extension, so that's what I used for the new keyboard shortcut. Just match what you see in the menu on the shortcut panel and it should work fine. Note that if you have Saft installed, you'll have to remove it to add new shortcuts -- at least I had to. With Saft installed and active, newly assigned shortcuts didn't show in the Debug menu. They did appear when I launched Safari after removing Saft, though.]
  Post a comment  •  Comments (6)  
  • Currently 1.80 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[13,365 views] Email Article To a Friend View Printable Version
View iPhoto '08 Web Galleries in Safari's RSS reader Web Browsers
One maddening feature of iPhoto '08 and Web Galleries is that (please correct me if I'm wrong) if you subscribe to a gallery using the button at the top of the gallery, and you are in Safari and have iPhoto installed, the subscription assumes that you want to subscribe to the feed as a photocast in iPhoto -- it doesn't bring it up as a regular Safari RSS feed.

I keep my friend's Flickr photostreams as RSS feeds that are bookmarked, and Safari is great for viewing and seeing if there are new entries. It seems that the only method I have found for achieving a "plain old RSS" feed from the new web galleries in Safari is to open the gallery in Firefox and subscribe there. When Firefox asks for what reader to use for the RSS, select Safari in the pull down (or select Choose Application and navigate to Safari) and voila -- the feed will show up in Safai. From there, you can bookmark it however you like.

Maddening ... does anyone know how to stop Safari and iPhoto from working this way and just let me have the RSS in Safari instead of iPhoto?

[robg adds: In looking at the URL for a gallery, and the URL for the RSS feed that you see in Camino or Firefox, it looks like a pretty simple substitution to get the RSS URL. For instance, here's a fake gallery URL:
http://gallery.mac.com/joeuser#12345&bgcolor=black
To convert that to an RSS URL, replace the # with a /, and then add this at the end:
?webdav-method=truthget&feedfmt=photocastrss
So the final RSS URL for our fake example would be:
http://gallery.mac.com/joeuser/12345/?webdav-method=truthget&feedfmt=photocastrss
Within Safari, you could just edit the URL for the gallery to match the above, and then load that page. Safari will then display it in its built-in RSS reader (assuming that's what you've set as your RSS reader in its preferences). I'm not sure what URL they're using for the Subscribe button, but it's definitely not the RSS URL.]
  Post a comment  •  Comments (2)  
  • Currently 1.71 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
 
[27,375 views] Email Article To a Friend View Printable Version
Disable Safari 3's warning about closing multiple tabs Web Browsers
Inspired by the Disable Safari 3 warnings about unsubmitted forms hint, I did my own digging, and found how to turn off the warnings about closing a window with multiple tabs. Just quit Safari>, go to Terminal, and type this:
defaults write com.apple.Safari ConfirmClosingMultiplePages 0
To revert, simply replace 0 with 1.
  Post a comment  •  Comments (5)  
  • Currently 1.86 / 5
  You rated: 2 / 5 (7 votes cast)
 
[10,792 views] Email Article To a Friend View Printable Version
10.4: Disable Safari 3 warnings about unsubmitted forms Web Browsers
Since installing Safari 3.0, I've found the confirmation boxes for unsubmitted forms to be quite annoying. Now that Web 2.0 is so popular and so many sites send content via AJAX, having unsubmitted forms is not uncommon, and these confirmations are just a pain. The fix? After digging around with...
strings /Applications/Safari.app/Contents/MacOS/Safari
...I found the DebugConfirmUnsubmittedFormText preference. To disable the confirmations, quit Safari, open up Terminal, and type this command:
defaults write com.apple.Safari DebugConfirmTossingUnsubmittedFormText 0
To re-enable confirmations, just do the same with a 1 instead of a 0 at the end. Enjoy your much-improved Safari!
  Post a comment  •  Comments (9)  
  • Currently 2.00 / 5
  You rated: 1 / 5 (8 votes cast)
 
[11,081 views] Email Article To a Friend View Printable Version
Use AppleScript to select specific tabs in Safari 3 Web Browsers
One thing that really bugs me about Safari is the inability to have a keyboard shortcut for each tab. In Firefox, you can use Command-1 to get the first tab, Command-2 to get the second tab, and so on. (You can cycle between all open tabs with Command-{ and Command-}, but you can't just to a specific tab.) With the release of Safari 3, there is now AppleScript support for selecting tabs. To select tab 1 you can do this:
tell front window of app "Safari" to set current tab to tab 1
I wrote nine similar scripts for tabs one through nine, and a script for activating the last tab. These go in ~/Library » Scripts » Applications » Safari. Then I assigned each script to a trigger in Quicksilver that is only available when Safari is active. If you have the scripts menu active, you should be able to assign keyboard shortcuts to each file. However, these shortcuts don't work for me within Safari for some reason. Perhaps someone else can figure this one out.
read more (158 words)   Post a comment  •  Comments (2)  
  • Currently 2.50 / 5
  You rated: 4 / 5 (8 votes cast)
 
[16,653 views] Email Article To a Friend View Printable Version