Smart iPhoto exports
Do you use a third-party program to create your Web-based slide shows or to export batches of images for presentations? Here’s a little trick that can make it less tedious to export a large and varied selection of images from Apple’s iPhoto 6 (part of iLife ’06, $79). Instead of hunting and clicking, use smart albums and keywords to automatically gather your images.
Start by creating a new keyword. Go to iPhoto: Preferences and click on Keywords. In the window that appears, click on the plus sign (+). A new text field will appear. Type whatever new keyword you like—
ToExport, for example. Close the window.
Next, create a new smart album (File: New Smart Album). Name the new album whatever you like; I called mine _To Export (the underscore character [_] forces this smart album to show up above any others I have). In the condition section of the dialog box, add only one: Keyword Is ToExport (see top screenshot). Now you can gather photos from all different parts of your library by assigning the ToExport keyword to each one. All of the photos will appear in the _To Export smart album.
The one glitch in this plan is that assigning keywords is a pain. You do it by dragging images to the Keywords area in the lower left corner of the iPhoto window. (If you don’t see this list, just click on the small key icon at the bottom of the window.) That’s where Ken Ferry’s Keyword Assistant, a free plug-in for iPhoto, comes into play. (A version that fully supports iPhoto 6 should be out by the time you read this.) You can assign a keyword simply by typing its first few letters into Keyword Assistant’s floating window—a huge time-saver.
Text-dragging tricks
You might be aware that in OS X you can drag and drop bits of text—say, from your e-mail application to a word processing document. But did you know that if you’re running OS X 10.4, you can drag text onto Dock icons—with interesting results?
For example, if the text snippet you drag is a URL (in other words, it starts with
http://or
ftp://, for instance), you can drop it on any Web-browser icon in the Dock to open it. This is a handy feature if you’d like to open a site in something other than your default browser. (If you click on the link in an e-mail message, for instance, it will open in your default browser.)
To experiment, drag a chunk of text and move it across the Dock. If an application can accept the text, its icon will darken. Based on some of my own experiments, as well as comments from MacOSXHints.com readers, here are some favorites:
Dictionary Tiger’s Dictionary displays the definition for the dropped word. If you drop a phrase, you’ll get a definition for the first word in the phrase.
Mail Apple’s e-mail program opens a new message with the dropped text as the body.
Safari Apple’s Web browser runs a Google search on the dropped text. Granted, this isn’t terribly useful if you can already control-click on words or phrases in the source application and choose Google Search from the contextual menu. But if the text comes from an application that doesn’t support that feature—say, Microsoft Word or Excel—it’s a handy shortcut.
Script Editor The AppleScript editor (/Applications/AppleScript) opens a new script that includes the dropped text—and even tries to compile it!
Skype The Internet telephone (VoIP) program Skype dials the dropped number or the number associated with the dropped nickname.
Stickies A new Stickies note opens with the text as the contents.
Tex-Edit Plus Trans-Tex Software’s scriptable text editor, Tex-Edit Plus ($15), places dragged text in the topmost window where your cursor is. If no windows are open, it opens a new window and places the text in it.
TextEdit OS X’s text editor opens a new document containing the dropped text.
To learn more, read a longer version of this tip.
Make Tiger’s Dictionary roar
Tiger’s Dictionary goes the extra mile to help you find just the right word. Select a word and press Command-control-D in many OSXapplications, and you can instantly see the word’s definition. You can even continue to hold down Command-control, move your mouse around, and get the definitions of other words as you roll over them. This works in most of Apple’s applications, including Safari, Mail, and TextEdit, and many third-party apps. Try it in your application of choice.
Of course, it’s not perfect. Holding down the Command and control keys simultaneously isn’t easy. Also, this keyboard shortcut is quite close to Mail’s Send Message shortcut (Command-shift-D). If your finger slips as you’re finding the right word for a private rant, you’ve suddenly committed a career-ending move!
Thankfully, you can reassign the keyboard shortcut. Open the Keyboard & Mouse preference pane and click on the Keyboard Shortcuts tab. Scroll down the list until you get to the Dictionary section. You’ll see the Look Up In Dictionary entry in the Description column, with the shortcut next to it. Double-click on the shortcut to make the text field editable. Now you’re ready to assign a new shortcut.
Don’t pick just any old key combo. Instead, pick an unused function key—F7 or F13, for example. Press the function key you wish to use, and you should see it listed in the Shortcut column (see middle screenshot). The best thing about using a function key is that you’ll no longer have to keep pressing the Command-control-D combo for on-the-fly definitions—a quick tap turns the pop-up dictionary on or off.
Users of portable Macs may have to use the fn key in combination with the function keys. By default, portable Macs are set to use the function keys to control hardware features, such as volume. If you’d rather use those keys for software features, such as this shortcut, visit the Keyboard tab of the Keyboard & Mouse preference pane and select Use The F1-F12 Keys To Control Software Features.
Unzoom Spotlighted PDFs
Looking for a specific phrase in a PDF document? When you search for a word in Spotlight and then open a PDF that it finds, Spotlight highlights the matching terms. This makes it much easier to find what you were looking for. (Note that you’ll see the highlighting only if your exact phrase exists in the body of the document, or if you searched for just one word.)
But here’s the annoying part. Preview zooms in to show your highlighted term—and zooms in to a ridiculously high level. Sure, you can see the matched search terms very well, but you can’t see a whole lot else (see bottom screenshot). Thankfully, some enterprising individual discovered the secret to toning this down. All you need to do is alter the line, in Preview’s preferences (.plist) file, that controls the zoom level; this line is
PVPDFSpotlightSelectionSize. By default, the zoom value is set to 28, or a 280 percent zoom.
First, make sure that Preview isn’t running; the changes won’t stick if it is. Next, go to the /Applications/Utilities folder and launch Terminal. Type the following code (better yet, copy and paste it from here ):
defaults write com.apple.Preview Preview -dict-add PVPDFSpotlightSelectionSize 10
Make sure there’s a space between
Previewand
-dict. Press return when you’re done—and you’ve just changed the zoom value to 10, or 100 percent (actual size). You won’t see any output in Terminal, but don’t worry—you’ve changed that preferences file. If 100 percent is too small for your eyes, you can use almost whatever value you’d like. Just remember to enter a decimal numeral, not a percentage, for the zoom value—for instance, to set the zoom to 125 percent, you’d use a value of 12.5; for 150 percent, it would be 15. Unfortunately, it doesn’t seem to be possible to set the zoom below 100 percent; any value below 10 in the preferences file results in a level of 100 percent.
Easily open URL lists in Safari
If you’re like me, friends and coworkers occasionally send you e-mail messages that contain lists of URLs—for instance:
Hey, Rob: check out these interesting Mac-related sites:
http://osx.hyperjeff.net www.aqua files.com http://crazyapplerumors.com http://daringfireball.net www.command-tab.com http://www.hicksdesign.co.uk/journal/
If you’re lucky, all of the URLs show up as clickable links, meaning that you can open each one with a simple click in your e-mail program. But even that can be a bit of a pain, depending on how you’ve set up your browser to open new links. If you’re not lucky, the list appears as a simple block of text. Never fear: if you use Safari as your Web browser, there’s an easy way to open these URLs—as long as they appear in plain text and are separated by line breaks, and as long as each starts with
http://.
Start by selecting and copying all of the text in the e-mail message—you don’t need to isolate the URLs. Once you have the text in the Clipboard, follow these steps to open all the URLs at once:
1. Switch to Safari and click on the Bookmarks button (it looks like an open book) in the toolbar.
2. Click on the plus sign (+) at the bottom of the window to add a new bookmarks folder.
3. Click on the Bookmark column (to the right of the Collections column) to activate it; then press Command-V to paste the Clipboard’s contents. This is where the magic occurs. Safari is smart enough to strip out all the non-URL text, leaving you with a set of brand-new bookmarks pointing to the pasted URLs.
4. Back in the Collections column, control-click on the newly created folder and choose Open In Tabs from the pop-up menu. Presto! All the pasted URLs are now open, each in its own tab.
Using a smart album and a unique keyword in iPhoto, you can easily store images for export at a future date. You can alter the Tiger Dictionary’s behavior just by changing its keyboard shortcut. When you open a PDF that Spotlight finds for you, Spotlight tries to help you locate the terms you searched for by highlighting the terms and zooming in—perhaps too far (left). All it takes is a simple change in Terminal to make Preview default to a more reasonable zoom level (right) when Spotlight opens files.Use Automator to open folders in Terminal
If you work with Terminal (/Applications/Utilities), you probably find yourself switching back and forth between it and the Finder a lot. For instance, what if you want to do some Terminal work in the folder you’re looking at in the Finder? You could switch to Terminal, type
cd, press the spacebar, switch to the Finder, and then drag and drop that folder onto the Terminal window. But that’s a pain.
Enter OS X 10.4 and Automator. Using a very simple Automator workflow, you can create a Finder plug-in (contextual menu item) that lets you control-click on an object in the Finder and navigate to it in Terminal. If you choose a file, the plug-in will open the folder that contains it; if you choose a folder, the plug-in will open the folder itself. Since it’s a contextual menu, it requires much less mouse movement.
Open Automator and click on the Finder entry in the Library column. Drag Get Selected Finder Items from the Action column into the blank work area to its right. Next, click on the Automator entry in the Library column, and then drag the Run AppleScript entry from the Action column into the work area—drop it below the action you’ve already moved there.
OK, now for the actual AppleScript code that does the work. Thankfully, MacOSXHints.com reader Greg Spence has created a script for us. Type this code into the script area of the Run AppleScript action you just placed in the work area. Replace all the existing text (you can copy and paste this code ):
on run {input, parameters} tell application "Finder" set myWin to window 1 set theWin to (quoted form of POSIX path of (target of myWin as alias)) tell application "Terminal" activate tell window 1 do script "cd " & theWin -- do script "cd " & theWin & ";ls -al | more" end tell end tell end tell return input end run
Now choose File: Save As Plug-in from Automator’s menus. In the Save Plug-in As box, give your new workflow a meaningful name, such as Open In Terminal. Make sure the Plug-in For pop-up menu says Finder, and then click on Save. Switch to the Finder, select any item, and control-click on your selection. Choose Automator: Open In Terminal (or whatever you named your action), and you should see a new Terminal window open. Then the
cdcommand will execute, switching you to the folder you’ve selected.
[ Senior Editor Rob Griffiths is the author of Mac OS X Power Hound, Panther Edition (O’Reilly, 2004), and runs MacOSXHints.com.]