I'm not sure if this has been posted before, but a quick search didn't turn up any matches, so here's the hint...
If you select some text in Safari and then press Command-Shift-L, Safari will open a new tab (or window, depending on if tabs are enabled in your preferences) with the Google search results for your selected text.
[robg adds: An earlier hint covered Google-searching on selected text via the contextual menu, but didn't mention a keyboard shortcut. I check Safari's Keyboard shortcut list, and command-shift-L is shown as blank, so this appears to be a hidden shortcut...]
[robg apology addendum: As has been pointed out in the comments, this is just Safari's built-in Search service -- sorry for the "obvious hint" posting ...]
This AppleScript will save selected text from the current Safari window to a text file on your desktop. It uses UI Scripting, so it will only work with "enabled" versions of Panther (see Activating UI Scripting). You can use the script repeatedly and new text will be appended to the existing file. The URL and a timestamp are included to help you keep track of where the snippets came from.
tell application "Safari"
activate
set myURL to URL of document 1
end tell
tell application "System Events"
tell process "Safari"
keystroke "c" using {command down}
delay 2
set myData to (the clipboard) as text
end tell
end tell
set myDate to current date
set fPath to path to desktop
set fName to (do shell script "date \"+%Y-%m-%d\"") & ".txt"
set myFile to open for access file ((fPath as string) & fName) ¬
with write permission
write "=== " & return & "Date: " & myDate & return & ¬
"Text from: " & myURL & return & return & myData to myFile starting at eof
close access myFile
Save it to ~/Library/Scripts/Applications/Safari/ so that you can access it easily while browsing.
In Safari v. 1.2 (build v125), once you have downloaded a file, you can double-click on the icon in the Downloads window to open the file with its default application. Saves a step of clicking on the magnifying glass to display the file in a finder window before opening.
Back in December, before Safari 1.2 was released, David Hyatt wrote a post about outline highlights in Safari. Now that we have Safari 1.2, I have noticed that it no longer gives you a dotted outline (or anything for that matter) when you click on a link. So what I have found is that if you take the outline code that David Hyatt posted in December and make Safari use a custom Cascading Style Sheet, then all links will have an IE-like glowing outline when you click on links.
To do this, Open any text editor that is able to save a .css file (basically a pure text file), and paste the below code.
Save the file somewhere, and name it something ending in .css. Then go into your Safari Preferences and click on the Advanced icon. From there, you can set a custom CSS file for Safari to use; point it to the file you just created. Of course you can take out the color: lightblue;, and Safari will use the same color of the link on each site. Or you can even change it to the color of your choice. To see the effects, you'll have to open a new web page; it won't change any already loaded pages.
This hint can also be used in Net News Wire and any other app that is able to use custom CSS files w/ webcore.
If you are having trouble with a popup error window in Safari due to a Keychain error, it is due to a problem with the "Other forms" selection in Autofill. To fix, go to /Applications -> Utilities, then launch Keychain Access. In the Keychain menu, choose Window, then Keychain First Aid. Repair your Keychain file, and all should be better with Safari.
I load a lot of pages with Safari and it can take a long time to load pages from time to time. I wrote an AppleScript that toggles appearance so that pages load faster. When I read a page that I am really interested in reading, I can then toggle appearance again and reload page.
The script is as follows:
tell application "Safari"
activate
tell application "System Events"
tell application process "Safari"
key down command
keystroke ","
delay 1
key up command
end tell (* end application process Safari *)
end tell (* end System Events *)
tell application "System Events"
click button "Appearance" of tool bar 1 of window 1 of ¬
application process "Safari"
delay 1
click checkbox "Display images when the page opens" of ¬
group 1 of group of window "Appearance" of application process "Safari"
delay 1
click menu item "Close Window" of menu "File" of ¬
menu bar 1 of application process "Safari"
end tell
end tell (* end Safari *)
That's it. Load 'um Safari!
[robg adds: Save this script in your user's Library -> Scripts folder for easy access from the Scripts menu.]
There is a known issue with using Novell Groupwise WebAccess with Safari. There is a toolbar that is supposed to appear on the left hand side of the screen that fails to appear when using Safari. I've found that if you click and hold on the brown strip on the left portion of the screen and then drag down, the toolbar will appear from the bottom of the screen.
I've never noticed this before, I think this is new to either Safari v1.1 or Safari v1.2. Anyway, if you've ever wanted to know the size of an image on a web page without downloading it and looking at it in Preview (something I do every now and then), there's a really easy way to do it.
If you open the image in a new window in Safari (which can be done through the contextual menu if it's on an open web page), the title of the window (or tab) now shows the image size in pixels.
[robg adds: I believe this is new in Safari 1.2, and it basically makes this hint somewhat redundant, although the referenced script will also tell you the file size of the displayed image.]
This was something I was missing from IE. If you put a file URL in the location bar and hit option-return, it will download the file to your specified Downloads folder. No fuss, no muss.
Safari 1.2 finally adds support for full keyboard navigation, which allows to Option-Tab (by default) between links and tab between all form elements. You might notice, however, that unless you have "Full keyboard access" turned on, the latter of the two doesn't work as expected.
To enable tab navigation of all form elements in Safari 1.2, you'll need to open System Preferences and click on the Keyboard & Mouse icon. Then, in the Keyboard Shortcuts tab, check the "Full keyboard access" checkbox. After doing this, you'll be able to use your keyboard to truly navigate all form fields (which includes checkboxes, menus, et al).
You should note, however, that turning this option on enables keyboard access system-wide, which might be something you're not used to. Full keyboard access will allow you to tab between OS X interface objects (like buttons and such), and might alter your behaviour slightly.
It might be nice if in the future Safari had the keyboard access feature on its own without having to enable it system-wide, but in the meantime it's still a great feature.