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

Emulate Firefox's type-ahead search in Safari Web Browsers
As input managers are in danger in Safari 3.0 and later versions, it might be useful to know that a type-ahead search feature that emulates Firefox can be enabled in Safari using a fairly simple hack that involves native OS X tricks.

To do so, quit Safari and go to System Preferences » Keyboard & Mouse » Keyboard Shortcuts. Click the '+' to add a new shortcut, select Safari as the Application, Find... as the Menu Title, and a temporary (and arbitrary) shortcut as Keyboard Shortcut. (Note that this field does not allow a simple entry, such as '/', but instead requires a modifier key like Command or Option.)

Now go to ~/Library/Preferences and edit com.apple.Safari.plist. (You may be able to just double-click and open the plist in Property List Editor if you have Xcode installed.) Find the NSUserKeyEquivalents entry and edit the string entry for Find..., replacing the arbitrary shortcut you entered earlier with /. This will remove the need for a modifier key, and allow / to activate search.

Now relaunch Safari and type /; you should see the Find box appear, emulating the type-ahead search in Firefox.

[robg adds: Queue user fds offers up a one-line Terminal alternative to creating this shortcut: defaults write com.apple.safari NSUserKeyEquivalents -dict-add Findů /. He also points out the downside of this modification: if you're in a text box, you won't be able to activate the search box, as the text box will accept all the '/' keystrokes, as it should. With the default of Command-F, you can use find even when a text field has focus.

If you'd like to undo this modification, and you used the long method above to create it, you can just delete the entry in the Keyboard Shortcuts list. If you used the Terminal shortcut, though, there won't be an entry there. You can either add it and then delete it, or this should work in Terminal: defaults write com.apple.safari NSUserKeyEquivalents -dict-add Findů @f.]
  Post a comment  •  Comments (5)  
  • Currently 1.63 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (8 votes cast)
 
[14,006 views]  View Printable Version
10.5: Safari's RSS feature remembers search terms Web Browsers
If you bookmark an RSS feed with Safari, and then enter some terms in the Search Articles box, Safari will remember what was in the box and hold that search, after navigating away from that feed and back to it, and even between restarts of Safari.

This could be useful for only ever seeing RSS articles from a feed with certain specific keywords.

This can also be annoying as you may wish to view new articles in a feed, but they don't show up because the last time you viewed the feed you left some search terms in the box.

[robg adds: I tested this one, and it only works in the 10.5 version of Safari. I'm not sure if it's a bug or a feature, but it could be useful.]
  Post a comment  •  Comments (1)  
  • Currently 1.57 / 5
  You rated: 5 / 5 (7 votes cast)
 
[3,836 views]  View Printable Version
10.5: Play Flash games in the Dashboard Web Browsers
If you use the Web Clip feature in safari, you can cut out a Flash game and play it with full functionality in Dashboard.

[robg adds: Just remember that there's no way to save your web clips as widgets -- so if you close the widget itself in Dashboard, you'll need to recreate it from the original website the next time you want to play.]
  Post a comment  •  Comments (3)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[6,299 views]  View Printable Version
Create a keyword search function for Safari Web Browsers
I really miss the keyword feature of Firefox when I use Safari. For those who don't know it, it allows to define keywords, like for example img and link it to a search engine, for example, images.google.com. You just have to type img dog in the address bar to get the results of Google Image directly, without even going to the query page. I have written the following AppleScript to get a similar behaviour using Safari.

When run, the script will ask you for a query string. The first word is the keyword, the rest are the parameters. For example, type gg Macos to search for Macos in Google, or img cats dogs to search for cats dogs on Google Images. Here's the code:
--    This program is free software; you can redistribute it and/or modify
--    it under the terms of the GNU General Public License as published by
--    the Free Software Foundation; either version 2 of the License, or
--    (at your option) any later version.

--    This program is distributed in the hope that it will be useful,
--    but WITHOUT ANY WARRANTY; without even the implied warranty of
--    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--    GNU General Public License for more details.

--    You should have received a copy of the GNU General Public License
--    along with this program; if not, write to the Free Software
--    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

-- Copyright Olivier Croquette 2007 ocroquette at free dot fr

on keywordToURL(theKeyword, theParameters)
  set p to theParameters as text
  if theKeyword is equal to "gg" then
    return "http://www.google.com/search?q=" & p
  else if theKeyword is equal to "yt" then
    return "http://youtube.com/results?search=Search&search_query=" & p
  else if theKeyword is equal to "img" then
    return "http://images.google.com/images?btnG=Recherche+d%27images=2=" & p
  end if
  return ""
end keywordToURL

on openTab(theURL)
  tell application "Safari"
    -- Open a new window if none available
    if (count of every window) is equal to 0 then
      make new document
    end if
    
    set isUrlEmpty to true
    try
      if URL of document 1 is not equal to "" then
        set isUrlEmpty to false
      end if
    end try
    
    if not isUrlEmpty then
      tell window 1
        -- Open a new tab in the existing window
        set theTab to make new tab
        set current tab to theTab
      end tell
    else
      set theTab to current tab of window 1
    end if
    set URL of theTab to theURL
  end tell
end openTab

on run
  set AppleScript's text item delimiters to " "
  set theURL to ""
  set theQuery to "gg " -- set your default keyword here
  set theErrorText to ""
  set theDialogText to "Enter your query:"
  set theDialogText to "Enter your query:"
  repeat while theURL is equal to ""
    tell application "Safari"
      activate
      set theQuery to text returned of (display dialog theErrorText & theDialogText default answer theQuery)
      set theErrorText to "Bad keyword. Try again.
"
    end tell
    set theQueryList to text items of theQuery
    try
      set theKeyword to item 1 of theQueryList
      set theParameters to (items 2 thru -1 of theQueryList)
      set theParametersString to theParameters as text
      set theURL to my keywordToURL(theKeyword, theParameters)
    end try
  end repeat
  openTab(theURL)
end run
To install it, open the AppleScript Editor (from /Applications/AppleScript), copy/paste the script, and save it in your user's Library/Scripts folder as MySearch. Then, you should bind the script to a hot key (a shortcut). I personally use FastScripts to bind the key Command-Shift-K, but there are probably other solutions. With this configuration, a difference with the Firefox keywords (which is also a feature) is that Safari doesn't need to be in the foreground. Just press the hot key from whereever you are, and it will bring Safari to the front and ask you for your query.

To add search engines, you will have to edit the function keywordToURL at the beginning, which contains already some examples, and is hopefuly easily understandable. First, use the browser normally to search for (on the desired site), for example, xyz123. Have a look at the resulting URL. Notice where your xyz123 is in it. We will call everything before the search term PREFIX, and everything after it SUFFIX. Add a new section to the script similar to the existing ones:
  else if theKeyword is equal to "YOURKEYWORDHERE" then
    return "PREFIX" & p  "SUFFIX"
The p will be replaced by your parameters. [robg adds: This worked as described for me when I tested it.]
  Post a comment  •  Comments (10)  
  • Currently 1.17 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[11,024 views]  View Printable Version
An AppleScript to Google search the current site in Safari Web Browsers
After I updated to Safari 3, AcidSearch stopped working properly, so I uninstalled it. I got Inquisitor instead, but I missed the ability to do a Google site search on whatever site I was visiting. So I put together this AppleScript, mostly assembled from other people's scripts: [robg adds: To use this, save it as a Script in ~/Library/Scripts/Safari, and make sure the Scripts Menu is enabled. Then just select it while visiting any page in Safari, enter the search term in the box, and you'll run a Google search restricted to that site. It worked fine for me when testing.]
  Post a comment  •  Comments (6)  
  • Currently 1.83 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[9,599 views]  View Printable Version
10.5: View cached content for some browsers Web Browsers
Many people may not be aware that when visiting web pages that feature graphics, audio, and video, that much of this stuff ends up in an oddly-numbered file in your browser's cache folder. (You can find these folders in your user's Library/Caches folder.)

Today, I discovered that Leopard's Finder can now actually display much of this cached content in the Preview area of a Finder window (or via Quick Look), rather than just showing a generic document icon.

[robg adds: This works for cache files from Camino and Firefox, but not Safari -- Safari now stores its cache in a single .db file, instead of a number of independent files. Many cache files won't preview, but those with graphics, audio, or video seem to work fine.]
  Post a comment  •  Comments (2)  
  • Currently 1.20 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[4,645 views]  View Printable Version
10.5: Easily create a personalized widget with Safari 3 Web Browsers
Here's a unique way to use Safari's web clip feature to create your own widget. I set up a countdown timer and generated the HTML, using this countdown generator. I then copied the HTML source, pasted it into TextEdit, added <html><head></head><body> at the top, and </body></html> at the bottom, and saved it to the Desktop as an HTML file.

Then I opened it in Safari, and used Web Clip to make my own widget from the output. Bingo -- a customised widget!

[robg adds: The theory here is more interesting than the actual example of a countdown widget, given the number of such widgets that are already available. Basically, grab an HTML snippet from a page that generates such things, add the basic HTML tags around it, then create a widget from the output.]
  Post a comment  •  Comments (5)  
  • Currently 1.88 / 5
  You rated: 2 / 5 (8 votes cast)
 
[7,128 views]  View Printable Version
Safari, .zem files, and other Plone/Zope features Web Browsers
For .zem files, sometimes offered by Plone content management systems, to be treated as safe by Safari and similar applications, you may add three strings to your DownloadAssessment preferences file. Here's how:
  1. Launch Terminal, and convert the plist into editable form:
    plutil -convert xml1 ~/Library/Preferences/com.apple.DownloadAssessment.plist
  2. Edit the file:
    pico ~/Library/Preferences/com.apple.DownloadAssessment.plist
  3. Include the following three defintions:
    <key>LSRiskCategoryExtensions</key>
    <array>
        <string>zem</string>
    </array>
    <key>LSRiskCategoryContentTypes</key>
    <array>
    
        <string>com.urbanape.zopeeditmanager</string>
    </array>
    <key>LSRiskCategoryMIMETypes</key>
    <array>
        <string>application/x-zope-edit</string>
    </array>
    Here's an example of the full file. After making the changes, save and close the plist.
  4. Get ZopeEditManager. In the app, go to Preferences » Helper Apps, and you may wish to add helpers such as these:
    application/msword | NeoOffice | .doc
  5. Quit then re-launch Safari.
read more (75 words)   Post a comment  •  Comments (0)  
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[7,264 views]  View Printable Version
Create new tabs from dragged text in Safari 3 Web Browsers
When using Safari 3 in 10.4 or 10.5, you can select a URL from a source (Safari, TextEdit, another browser, whatever), and drag it to an empty space in Safari's tab bar. When you drop the URL, Safari will then open another tab with this URL.

[robg adds: If you drop the text in Safari's main window, instead of the tab bar, the URL will open in the current tab.]
  Post a comment  •  Comments (7)  
  • Currently 1.38 / 5
  You rated: 2 / 5 (8 votes cast)
 
[4,545 views]  View Printable Version
Save Safari-loaded password-protected PDFs Web Browsers
When viewing a password-protected PDF from within Safari, or by selecting Open in Preview from Safari's Contextual Menu, the option to save the PDF doesn't exist, nor does the Print to PDF option exist within the Print Dialog box.

However, if you copy the PDF's URL, open the Downloads window (Command-Option-L within Safari) and then paste the URL, the PDF will start to download (i.e. be saved).

[robg adds: A comment on the queue site notes no copy is required; just drag the icon next to the URL into the Downloads window. Note that this hint doesn't defeat the password protection; it merely allows you to download the document.]
  Post a comment  •  Comments (4)  
  • Currently 1.57 / 5
  You rated: 1 / 5 (7 votes cast)
 
[8,731 views]  View Printable Version