Quarter Life Crisis

The world according to Sven-S. Porst

« PracticeMainScrambled »

Selecting Words

278 words

John Gruber lives up to his earlier promise to give an example for the use of whose in AppleScript. His discussion of the example makes clear the main drawback of whose: due to the non-intelligent nature of most programs its performance can deteriorate easily.

Although I understand this example is mainly intended to teach about Apple Script, let me just point out that a Option-← Shift-Option-→ sequence should achieve the same result without any need for any AppleScript in any application.

Furthermore, for the Cocoa lovers out there, let me remind you that any Cocoa application would love do this for you – if Apple hadn't deactivated the feature. To activate it, make sure you have a folder named KeyBindings in your Library folder. In this folder you can have the file DefaultKeyBinding.dict which contains a property list, containing a dictionary with your choice of additional key bindings. To bind word selection to Control-L, say, you'll have to add the string selectWord: (including the colon) for the key ^L.

Or simply download my key binding dictionary. That will also give you the binding Control-T for 'toggle' which swaps the characters left and right of the cursor around and is quite handy for fixing typos like thsi one.

P.S. A question for the technically inclined readers to answer: What's a good MIME type to use for the dictionary file I linked to above. Currently it's served as text/xml which seems appropriate to my ignorant self. However, Safari will display the file without the XML tags rather than downloading it, which could be confusing to the receiver. What would be the best way to do this?

September 23, 2003, 22:45

Comments

Comment by Dave Clarke: Gravatar image

Apropos your P.S. - I’m not sure whether this will work for Safari and you may need to experiment a little with your mime type but adding a content-disposition header may help, e.g (from ASP page):

Response.AddHeader(“Content-Disposition”, “attachment;filename=somefile.xml”);

Browsers will tend to interpret this information in different ways and even different versions of the same browser will behave differently, however it does seem to work in most cases.

Dave

September 26, 2003, 2:53

Comment by Marc Nothrop: Gravatar image

Re the XML file; I guess to state the obvious, you could simply compress the file, and rely on the browser either auto-decoding it (as Safari does by default), or trust that users can do it themselves..?

Admittedly not the question asked.

BTW thanks for the reminder re Cocoa Key Bindings… this rings a bell as one of the many features I looked forward to, when Apple acquired NeXT, way back when.

As an aside, I wonder when we’ll get fully useful Services, and more Bundle plugins (Omni/Saft and PithHelmet are the only one’s I’m aware of…)

October 7, 2003, 15:03

Comment by Marc Nothrop: Gravatar image

Re the XML file; I guess to state the obvious, you could simply compress the file, and rely on the browser either auto-decoding it (as Safari does by default), or trust that users can do it themselves..?

Admittedly not the question asked.

BTW thanks for the reminder re Cocoa Key Bindings… this rings a bell as one of the many features I looked forward to, when Apple acquired NeXT, way back when.

As an aside, I wonder when we’ll get fully useful Services, and more Bundle plugins (Omni/Saft and PithHelmet are the only one’s I’m aware of…)

October 7, 2003, 15:07

Comment by Marc Nothrop: Gravatar image

Sorry ‘bout the double post, form timed out 1st time

October 7, 2003, 15:12

Comment by ssp: Gravatar image

Thanks for all the hints.

Marc: Unfortunately our server has this bad habit of being slow and generating errors.

Other fun bundles I use regularly are GPGMail and MailPictures for Mail and the immensely useful TextExtras.

Aren’t Services sort of OK since X.2? I use them regularly with WordLookup and (beware, shameless self-promotion follows) UnicodeChecker. IceCoffee is very useful as well.

October 7, 2003, 22:29

Comment by marcn: Gravatar image

It’s been a while since this original post!

Thanks for pointers to those Services and bundles; I’d heard of IceCoffee, but not been using it — now I don’t know why I wasn’t (esp. as Cmd-click from Internet Config was so useful in its day.) I especially like having the Services menu in the contextual menu, this is something I’d wanted, but didn’t think any software offered this feature.

For me, that feature alone makes IceCoffee worth the price! ; )

This is also made all the more useful, by the Service Manager, which gives you finer control over the Services that are available across your system (some of them I just don’t want, others are invaluable!)

I’m looking at GPGMail, and a few others for Mail that look good are: MailPriority and SpamCop.

Mail.app plugs and suggestions has a good list.

As for my comments on Services, I was mainly decrying the fact that there are still a bunch of Carbon apps that aren’t Service-aware, and even Apple’s support is spotty (note the iCal notes field that isn’t Services-aware, nor does it have Spell Check.)

Thanks

November 5, 2003, 4:49

Add your comment

« PracticeMainScrambled »

Comments on

Photos

Categories

Me

This page

Out & About

pinboard Links

♪♬♪

People

Ego-Linking