Thoughtful, detailed coverage of the Mac, iPhone, and iPad, plus the best-selling Take Control ebooks.

 

 

Pick an apple! 
 
Open Files with Finder's App Switcher

Say you're in the Finder looking at a file and you want to open it with an application that's already running but which doesn't own that particular document. How? Switch to that app and choose File > Open? Too many steps. Choose Open With from the file's contextual menu? Takes too long, and the app might not be listed. Drag the file to the Dock and drop it onto the app's icon? The icon might be hard to find; worse, you might miss.

In Leopard there's a new solution: use the Command-Tab switcher. Yes, the Command-Tab switcher accepts drag-and-drop! The gesture required is a bit tricky. Start dragging the file in the Finder: move the file, but don't let up on the mouse button. With your other hand, press Command-Tab to summon the switcher, and don't let up on the Command key. Drag the file onto the application's icon in the switcher and let go of the mouse. (Now you can let go of the Command key too.) Extra tip: If you switch to the app beforehand, its icon in the Command-Tab switcher will be easy to find; it will be first (or second).

Visit Take Control of Customizing Leopard

 

 

Related Articles

 

 

Other articles in the series MacsBug!

 

 

MacsBug for the Merely Geeky, Part Three

Send Article to a Friend

Previous parts of this article explored MacsBug, Apple's free low-level debugger. First, we covered installing MacsBug and using it to recover from application crashes - we also established MacsBug as possibly the least friendly software you'll ever encounter on a Macintosh. Next, we discussed common MacsBug commands that reveal detailed information about your Mac, applications, and memory, and how to make logs of problems you encounter. Although MacsBug isn't for the faint of heart, it can be useful even for people who don't program for a living.

<http://db.tidbits.com/series/1057>

Now that you're familiar with MacsBug, you can put your knowledge to good use for automatically restarting crashed servers.

Poor Man's Server Restart -- You may have noticed the StdLog command discussed in the second part of this article contains output from several other MacsBug commands. That's because StdLog is actually a MacsBug macro, or a sequence of other commands separated by semicolons. You can use the help command to see what commands are in a macro: type "help stdlog" to see the full expansion of the StdLog macro.

Generally, non-programmers don't need to define macros. However, MacsBug has two reserved macro names - FirstTime and EveryTime - that can be useful for people running unattended servers. If they exist, the FirstTime macro is executed when MacsBug is loaded at startup, and the EveryTime macro is executed every other time MacsBug is invoked, whether by the user or as the result of a system error. Here are some common strategies for defining these macros:

Simple restart:
FirstTime: G
EveryTime: RS
Smarter restart:
FirstTime: DX OFF;G
EveryTime: STDLOG;RS

The first example tells MacsBug to resume execution when it's invoked at system startup, then has MacsBug restart the machine in the event of a system error. The second example is identical, except that it turns off user breaks in the FirstTime macro (see the DX command, in part two of this article), and tries to make a standard log and restart the machine in the event of a system error - that way there's a record that the machine is having problems. Note that commands are separated by semicolons.

<http://db.tidbits.com/article/05130>

You can use the RB command instead of RS in these macros, if you like. Be sure the last command in the FirstTime macro is G, or the Mac will never continue starting up. Also, don't end the EveryTime macro with G, or you'll never be able to get into MacsBug.

The FirstTime and EveryTime macros must be defined as permanent macros before you can use them to restart a machine. To do this, you use a resource editor like Apple's free ResEdit to define the macros and store them in a file.

<ftp://ftp.info.apple.com/Apple_Support_Area/ Apple_SW_Updates/US/Macintosh/Utilities/ ResEdit_2.1.3.sea.bin>

Although I can't give complete instructions about using ResEdit in this article, here are the steps for creating these macros:

  • Make a copy of MacsBug. (You can throw it away later.)

  • Using ResEdit, create a new, empty file, naming it clearly. (Mine is called "MacsBug Cheapo Restart".)

  • Leaving your new file open, use ResEdit to open the copy of MacsBug. Find and open the TMPL resources, select the mxbm resource (it should be the first one listed), then choose Copy from the Edit menu.

  • Paste the mxbm template into your empty file, then close the copy of MacsBug. The only file ResEdit should have open now is your new file.

  • Choose Create New Resource from the Resource menu. You can either type mxbm (all lowercase) or select mxbm from the scrolling list, then click OK. ResEdit creates the new resource and immediately opens it for editing.

  • Click the resource entry, 1) *****, then choose Insert New Field(s) from the Resource menu.

  • In the Macro name box, type FirstTime. In the Expansion box, type your FirstTime macro. (You can just type the letter G for now - you can always edit this later with ResEdit.)

  • Click the second entry, 2) *****, and choose Insert New Field(s) from the Resource menu.

  • In the Macro name box, type EveryTime. In the Expansion box, type your EveryTime macro. (Again, you can just type RS for now, and change it later if you like.)

  • Choose Save from the File menu, and quit ResEdit.

  • Move the file to the MacsBug Preferences folder inside your System Folder's Preferences folder. It will probably be the only file in that folder.

  • You're done! The macros will start working when you restart the machine. If you want to disable them, move the file out of the MacsBug Preferences folder and restart.

Beyond Merely Geeky -- I still won't pretend that using MacsBug is for everyone. However, I hope you can see that its utility isn't limited to code-heads who drink too many carbonated beverages. Knowing the basics of using MacsBug can help you understand and troubleshoot software problems, which in turn makes your Mac more stable and using you Mac more productive. In the end, that's what everyone wants.

 

CrashPlan is easy, secure backup that works everywhere. Back up
to your own drives, friends, and online with unlimited storage.
With 30 days free, backing up is one resolution you can keep.
Your life is digital; back it up! <http://tid.bl.it/code42-tb>