Friday, January 06, 2006

Non-contiguous selections in 10.4 Cocoa apps

macosxhints - Create non-contiguous selections in Cocoa apps:

Discontinuous selections were introduced in 10.4 ('Tiger'). Hold alt and drag for a 'rectangular' selection (only truly rectangular with monospace fonts); Hold command and drag for discontinious selections.
Select then command click on items in selection may also make the selection discontinuous, but the comments are confusion. Need to test it myself.

Paste with current style (Cocoa only)

I do this all the time on my XP apps, but it's an annoying trip to the menu. I didn't know of the OS X kb shortcuts. Another reason to use Cocoa apps ... (Firefox, time to go Cocoa!):
macosxhints - Automatically reformat text pasted into Cocoa apps:

... Edit menu in Tiger, the 'Paste and Match Style' option, invoked by the Command-Option-Shift-V shortcut. It does exactly what it says, and I've used it in TextEdit, iChat, and Mail.

This feature is very helpful for pasting things from websites that generally have weird formatting and colors (and require a lot of clicking to remove).

... It's not new to Tiger, though -- in Panther, it was called 'Paste With Current Style,' and accessed via the same shortcut.

Cool OSX Apps great picks: Including Google Earth for Mac

Cool OSX Apps has several great picks today, all relevant to me:
TextWranger update

TinyAlarm: handy for limiting those "quick" sessions at the screen.

GoogleEarth for Mac
has been released!

Not!I misread the note. This is an unreleased copy. I wouldn't touch it. Sigh.

AppleJack has been updated (I really need this installed)

Mail.app hang when mail images from iPhoto - fixed

I have had a very annoying bug with sending images from iPhoto. If Mail.app were not running, my system would hang with a spinning beachball of death (aka SBOD, spinning pizza of death, SPOD) for at least 5 minutes. Then I would get this error message: "mail got an error: apple event timed out". If Mail.app were running, there was no problem.

I tried various fixes such as cleaning caches, testing with different iPhoto libraries, etc. I began to feel the problem was in Mail.app. Stupidly, however, I forgot the standard fix for OS/X problems -- delete the preferences (.plist) file. I did ask on Apple's discussion forum, and I received a helpful response from Robert K:
Apple - Support - Discussions - iPhoto and Mail.app hand on email images ...

> I was having the same problem. Others have advised
> to delete the following file: com.apple.iphoto.plist
> in /users/library/preferences/. This had no effect
> on the freeze. I then deleted com.apple.mail.plist.
> This cured my problem. I did have to set up my mail
> accounts again in mail, but no more freezes when
> sharing a photo from IPhoto and Mail.

Your advice fixed the problem. There were some interesting twists.

I was pretty sure the problem was in Mail.app, not iPhoto, since switching iPhoto libraries had no effect. First I opened com.apple.mail.plist in a plist editor and saved it externally. I figured that would fix any true corruption. Interestingly when copied this file to the Prefs folder and tested I only got the beachball for about 1-2 minutes, then the images appeared. HOWEVER, I then remembered I'd recently set my CPU to higher performance. I suspect there's some odd race condition here and what happened was the race condition resolved before the AppleEvent messages timed out.

Then I deleted my mail prefs file and restored the settings. On testing if Mail.app was running the image appeared instantaneously, if it was not running I got a beachball for five seconds.

So evidently there's some prefs value in com.apple.mail.plist that causes this problem. I have my old prefs file if Apple should want a copy!
So the problem is gone for now, until I do something in Mail.app to alter the preferencess in such a way that the problem recurs. I wonder if it's somehow related to having once had a .Mac account then having discontinued it.

Update 1/9/06:

I may have identified the cause of this bug. We know that deleting com.apple.mail.plist fixes it. But why? What was "wrong" with the original.

I think the trick is to delete the default .mac account for both sending and receiving. When you do that, and try mailing an image, you'll get the beachball and the appleevent error.

I have to guess for some reason Mail.app is trying to do something with the .Mac account, and when it's missing it hangs.

It doesn't matter whether the .Mac account is active or not, it simply has to exist.

Thursday, January 05, 2006

Hamachi - free secure VPN for Windows

Gibson podcast about Hamachi, a "free" personal Win32/Linux VPN solution, in December:
This week Leo and I discuss and describe the brand new, ready to emerge from a its long development beta phase, ultra-secure, lightweight, high-performance, highly-polished, multi-platform, peer-to-peer and FREE! personal virtual private networking system known as "Hamachi". After two solid weeks of testing and intense dialog with Hamachi's lead developer and designer, I have fully vetted the system's security architecture and have it running on many of my systems. While I am travelling to Toronto this week, Hamachi is keeping my roaming laptop securely and directly connected to all of my machines back home. Don't miss this one!
I went to the web site, from which I could figure out approximately nothing. In particular, I can't see how they plan to make money. Gibson says a Mac version is coming:
Steve: It's www.hamachi.cc. Alex is up in Vancouver, and so he's got a .cc on the end of his URL. You'll go to his site, download his client, currently for Windows or Macintosh - I'm sorry, Windows or Linux, and then Mac is coming soon. Installing couldn't be any easier. You simply run the setup, you go through a little wizard-based install to basically, you know, tell it where you want to load it on your hard drive. It sees that it's being installed in a system that it hasn't installed before. There's a negotiation with the server where it assigns it a unique IP. Your client produces its own asymmetric key pair, which it then uses to perform strong authentication. You do that on a couple other systems. Now, one trick is, he is assigning IPs sequentially. When I installed it on my second machine, for example, one of mine was 5.11.66.114. That was the first one I installed. What's very cool is I can tell you the IP. It doesn't matter. You can't get to 5.
I still haven't quite figured it out. If they produce a Mac client I'll give it a try.

Update: The key to figuring this out is to click on the screenshots and read them. I think I get it. I am also now inclined to believe a Mac client may appear. This is very interesting.

Finally I discover a use for Expose

Lord, but this set of Kelby tips is good. I'd never quite figured out the use of Expose, except for hitting F11 to show my desktop. What was the advantage over hitting Cmd-Tab and cycling between apps? Ahh, but what if an app has many windows ...
Apple - Pro - Tip of the Week - Switching Apps Within Expos�:

Once you have Expose invoked (you pressed either F9 or F10), you can toggle through your open applications and Finder windows by pressing the Tab key. Press the Tab key once and the next open application and its miniaturized windows come to the front. Press Tab again, it goes to the next open app. Want the previous app? Press Shift-Tab.
When I use Firefox I have multiple tabs in windows, but also multiple windows. The tab/window sorting problem is very annoying (only OmniWeb tried to fix that and I didn't like their vertical tabs, IE 7 is supposed to tackle it better) and this doesn't entirely fix that, but using Expose this way is indeed more efficient than using Cmd-Tab to find a desired window. F9 arranges all the windows, F10 leaves one in the background. I'm not sure which I prefer.

So now I'll be using Expose. Heavens, I might end up using Widgets -- if they put the darned things on the desktop where they belong.

Creating a multi-item archive in OS X

More things I never knew, and the first use I've had for the "Action menu". OS X has a clever way to put multiple items into a zip, without having to put them in a folder first.
Apple - Pro - Tip of the Week - Making ZIP Files (Compressed Files) in One Click:

...the Action menu (the button that looks like a gear up in the Finder window’s toolbar)...

... You can also compress several different files (like three, for example) into one single archive file — just Command-click (or Shift-click contiguous files) on all the files you want included, then choose Create Archive of X Items from the Action menu. A file will be created named “Archive.zip”...