ICeCoffEE 1.4a1 [DO NOT REDISTRIBUTE]
10 June 2003

Open URLs and email addresses in Cocoa applications by ⌘-clicking. Access the Services menu from contextual menus or the menu bar.

Written by Nicholas Riley <mailto:icecoffee@sabi.net>.
Obtain updates from <http://web.sabi.net/nriley/software/>.

What is it?

Perhaps you're a Mac user used to the behavior of ICeTEe in Mac OS 9.

Or maybe you're a new Mac OS X user looking for a faster way to open and bookmark URLs and email addresses in text documents, Stickies, source code, and more.

Either way, ICeCoffEE is for you!

Installation

Follow the instructions in the installer. If an earlier version of ICeCoffEE is installed, it will be moved to the Trash.

Removal

To temporarily disable ICeCoffEE, use APE Manager (see the “Configuration” section below). To remove ICeCoffEE completely, use the “Uninstall” button in the installer, or drag “ICeCoffEE.ape” to the Trash.

Usage

To test ICeCoffEE:

	1.	If TextEdit is open and was open when you installed ICeCoffEE, quit TextEdit.  ICeCoffEE is only available in applications you open after installing it.  If you want to be sure ICeCoffEE is active, log out and log back in.
	2.	Open TextEdit (normally in the Applications folder).
	3.	Type an Internet location (URL), for example http://www.google.com/.
	4.	Hold down the Command (⌘) key and click anywhere inside the address. Your preferred Web browser will open and display Google’s Web site, assuming your Internet connection is otherwise functioning.

To use ICeCoffEE:

⌘-click on a URL or email address in a Cocoa application's text area. Some Cocoa applications that come with Mac OS X include Stickies, TextEdit, Mail, iChat and Network Utility. In addition, ⌘-clicking works in Terminal and SimpleText windows, and on text in a Safari browser window if you select the URL or email address first (currently, Safari support is disabled pending Safari bug fixes).

⌥⌘-click to select from a menu of applications which can open the location, similar to the “Open With” submenu in the Finder.

Like ICeTEe 2, ICeCoffEE 1.3 can work with a bookmark manager such as Alco Blom’s URL Manager Pro. ICeCoffEE uses the helper application defined for the “bookmark” protocol. For instructions, see:

	<http://web.sabi.net/nriley/software/icecoffee-bookmark/>

Control (⌃)-click (or if you have a multi-button mouse, click with the right button) on text in a Cocoa application's text area, and notice a “Services” submenu at the bottom.  This menu works the same way as the Services submenu of the application menu.

ICeCoffEE also adds the Services menu to the contextual menus of Terminal windows, Project Builder source windows, and Web pages viewed with Safari.

Services which are not available (for example, because they operate on selected text and no text are selected) are hidden in contextual menus, instead of being disabled as they are in the menu bar Services menus.

Configuration

To change ICeCoffEE’s settings, open System Preferences (in the  menu). Click “APE Manager”, then select ICeCoffEE under the list of Application Enhancers.

The Settings tab allows you to turn on and off various features of ICeCoffEE.  Your changes take effect immediately for all applications in which the current version of ICeCoffEE is active.

If ICeCoffEE is interfering with the normal behavior of an application, use the Exclude List tab to stop ICeCoffEE from doing anything in that application. If the application is currently open, you must quit and reopen it before your changes take effect. Also, please report the abnormal behavior to me so I can address it in a future version of ICeCoffEE.

Where else does this work?

Some Carbon applications which provided ICeTEe-like behavior under Mac OS 9 continue to do so in Mac OS X.  A few I am aware of are:

BBEdit 	<http://www.barebones.com/products/bbedit.html>
Tex-Edit Plus	<http://www.nearside.com/trans-tex/>

Apple has provided ⌘-click URL opening in Mac OS X 10.2 and later in two places.

Apple’s Multilingual Text Editor (MLTE) service lets you ⌘-click URLs to open them. WorldText, which is installed with the OS X Developer Tools in /Developer/Applications/Extras, is an example of an application which uses MLTE.

Terminal lets you use ⌘-double-click URLs to open them. (ICeCoffEE preempts this mechanism by acting on a single ⌘-click.)

Neither of these Apple-provided URL opening mechanisms work as well as ICeCoffEE. They appear to be independently written, as Terminal accepts many things that MLTE doesn't. For example, MLTE refuses to open a URL as commonly delimited by <>. A future version of ICeCoffEE may intervene in MLTE as a replacement.

Frequently asked questions

Q. Why isn't ICeCoffEE a service?

A. I think services are a good idea. But in my opinion, services are poorly implemented in Mac OS X. Compare:

•	⌘-click with insertion point or selection anywhere in URL

with:

•	carefully select text of URL
•	go to application menu
•	find "Services" item (it isn't in the same place each time)
•	(possibly) find hierarchical menu item for the application you want to launch the URL with
•	select service item

Which one would you rather use? Which one does Apple provide systemwide? To improve the situation, unavailable services could be hidden, and the Services menu could be promoted to a top-level menu (as it was in NeXT OSes and Mac OS X Server 1.x) or made available as a contextual menu. ICeCoffEE 1.1 and later support services in contextual menus, 1.3 and later support services in the menu bar, and 1.3.3 and later hide unavailable services.

Q. What about assigning keyboard equivalents to services?  Then you'd only have two steps above.

A. There's no set of service keyboard equivalents that is not overlapped by some application or other.  This is especially true when Apple reserves more ⌘ keys than ever for its own use in OS X. It's unlikely that I could pick a key combination that was memorable, easy to press, and yet didn't conflict with any application.

Also, the current implementation of services returns only the selection, not any context surrounding the selection.  This is an essential feature for programs such as ICeCoffEE to work seamlessly.

Finally, the current implementation of services in Mac OS X requires that the Services menu be pulled down in an application before the service keyboard equivalents can be used, making them almost useless. (ICeCoffEE 1.3.3 and later work around this bug.)

Q. Do I still need ICeTEe?

A. If you use ICeTEe in Classic, keep it installed.  Unfortunately, no information is shared between Internet Config in Classic and Mac OS X, so you will have to configure your helper information twice.

Q. Why doesn't ICeCoffEE support my favorite app?

A. Please send me suggestions. At this point ICeCoffEE works everywhere I want it to work, with the exception of MLTE text areas which already support rudimentary URL launching.

You can also request that your favorite application support ⌘-clicking of URLs directly, as several applications on Mac OS X already do. Implementing this functionality for an individual application should only be an hour or so of work.  (In comparison, it was over 30 hours of work for me to add URL launching support to the Mac OS X 10.1 version of Terminal, and it was all for nothing because Terminal was rewritten for Mac OS X 10.2, which required an additional 6 hours of work.)

Q. What does ICeCoffEE stand for?

A. Internet Config Carbon/Cocoa Editing Extension.  Or something like that.

Q. My question isn't answered here.

A. That's not a question.  But if you have a question about ICeCoffEE, a suggestion or a bug to report, please email it to me at <icecoffee@sabi.net>. See the known bug list in the version history below so you don’t report a bug I already know about. Please try to keep your messages short and to the point, and I'll get back to you as soon as my schedule will allow.  Thanks!

Version history

1.4 / unreleased
•	Updated to Application Enhancer (APE) 1.3 [incomplete]
•	Modified ⌥-drag copy with same Terminal window is now an option in APE Manager
•	Services displayed in contextual menus are selectable in APE Manager [UI still under construction]

Known bugs:
•	⌘-clicking email addresses in Apple Mail message headers selects too much (NSSelectByWord is overridden)
•	⌘-clicking wrapped URLs in Terminal may select too many lines of text
•	⌘-clicking URLs in Proteus is ineffective

1.3.3 / 31 May 2003
•	No longer accidentally display debug message “range of string {x, y}” in Console when opening URLs in Terminal
•	Non-ASCII characters act as URL boundaries instead of yielding confusing “conversion to cString failed” error
•	Respond to ⌘-click in non-ASCII text with “no URL was selected” instead of “conversion to cString failed”
•	Fixed small memory leak in contexual Services menu [Sven-S. Porst]
•	Remove disabled items and collapse single-item submenus in Services contextual menus [Sven-S. Porst]
•	Enable service keyboard shortcuts at application launch time [Sven-S. Porst]
•	Fixes text dragging behavior in Terminal: now ⌥-drag to copy within the same window, and ⌥ doesn't function as a toggle elsewhere
•	Added German localization [Sven-S. Porst]

1.3.2 / 13 March 2003
•	Fixed small memory leak in bookmark addition
•	Fixed appearance of ⌥⌘-click menu on non-Roman systems
•	⇧⌘-click or ⌥⇧⌘-click to open URLs in the background [Paul Kafasis]
•	Temporarily disabled Safari support, because of bugs in recent Safari betas
•	Added Japanese localization [Shike, Satoshi]

1.3.1 / 9 February 2003
•	Sort helper application names in ⌥⌘-click menu
•	No longer activate in background-only (NS/LSUIElement, NS/LSBackgroundOnly), command-line or full-screen applications: fixes missing speech feedback window, conflict with Disk Copy and Xounds [Because of limitations in APE Manager, these applications still appear in the Enhanced list]
•	Fixed small memory leak in APE Manager preferences plugin

1.3 / 3 February 2003
•	Work around CFLog message appearing in Console when bookmark dialog box is shown

1.3b3 / 2 February 2003
•	Show default protocol handler in menu even if it doesn’t claim to handle it
•	Added “Add Bookmark” to ⌥⌘-click menu
•	Updated to APE 1.2.1 final and new Unsanity Installer: should fix problem where ICeCoffEE Installer is not updating APE where necessary, and ICeCoffEE doesn’t activate at all
•	Fixed “slack” URL opening problems with OmniWeb and iCab (ICeCoffEE was generating an invalid URL) [John Marriott]
•	Fixed ⌥⌘-click text highlighting in SimpleText

1.3b2 / 29 January 2003
•	Beginnings of Carbon support: implemented TEClick patch, based upon ICeTEe 2.0; enabled in SimpleText only.
•	Fixed incorrect version number in uninstallation, again (oops)
•	Normalized error processing in Terminal
•	Fixed text blinking to work like ICeTEe (especially noticeable in Terminal)
•	Handle “slack” URLs (e.g. web.sabi.net/nriley)
•	Fixed small memory leak when parsing invalid URLs
•	Added ⌥⌘-click “Open Location With” menu
•	Prepared all text in the APE for localization

1.3b1 / 26 January 2003
•	Implemented Mac OS X 10.2 Terminal support
•	Fixed URL parsing issues

1.3d3 / 22 January 2003
•	Uninstall input manager version of ICeCoffEE if found as part of installation
•	Fixed incorrect version number "1.5a3" displayed in installer (only if you try to uninstall this or a later version)
•	Restored exclude list functionality to APE Manager preferences (oops)
•	Automatically migrate exclude list from ICeCoffEE 1.0–1.2 format
•	ICeCoffEE-specific settings in APE Manager

1.3d2 / 20 January 2003
•	Added support for contextual menus in Safari’s browser window, and partial ⌘-click launching (select text first)
•	Fixed regression in Project Builder support, no longer reacts on ⌘-click (oops)
•	Use localized text for “Services” title
•	Added Services in the menu bar [Ben Hines]

1.3d1 / 19 January 2003
•	Now an Application Enhancer (APE) module instead of an input manager
•	Uses Unsanity Installer
•	Uses APE Manager for configuration
•	Converted Read Me to RTFD format from plain text
•	Removed Mac OS X 10.1 Terminal support
•	Fixed Services in contextual menu for Project Builder 2.0 and Mac OS X 10.2 Terminal

1.2b2 / 20 April 2002
•	Fixed “dead text fields” in tab views [Dr. Suksiri Grams]

1.2b1 / 10 February 2002
•	Be more lenient about the ends of a URL, so >http://... is correctly interpreted
•	Fixed memory leak in Terminal launching

1.2a2 / 10 February 2002
•	Fixed bug when ⌘-clicking in Terminal when text already selected
•	Fixed crashing bug when ⌘-clicking on the last line in Terminal
•	Filter punctuation surrounding URLs (correctly except parentheses, which technically violates RFC 2396 §2.3) [Chris Behm]
•	Support lines which wrap courtesy of Terminal
•	Factored a bunch of code; fixed the URL length checking bug everywhere, not just in one place.

1.2a1 / 8 February 2002
•	Rewrote attributedSubstringFromRange: to only grab complete lines; many hours of pain and suffering for padding lines
•	Fixed off-by-one error in URL length checking

1.2d5 / 7 February 2002
•	Implemented minimal NSTextInput for Terminal.app since it doesn’t do so itself (buggy, crashes when trying to access beyond end of line)
•	Reduced memory consumption in NSTextInput URL launching code

1.2d4 / 30 January 2002
•	Fixed crashing bug when ICeCoffEE couldn’t get the selection and tried to call ICStop without ICStart
•	Intercept ⌘-click in Terminal.app (but can't do anything with it yet)
•	Version of URL launching code that only requires NSTextInput, not NSTextView (uses too much memory)

1.2d3 / 30 January 2002
•	Pass mailto hint (⌘-click email addresses)

1.2d2 / 29 January 2002
•	Adds contextual menu to Terminal windows

1.2d1 / 28 January 2002
•	Proof of feasibility for Terminal.app

1.1 / 28 January 2002 / installer 1.0.2
•	minor tweaks to Read Me file
•	really handle drawers this time
•	fixed crashing bug in installer after remove/install (moral: always use accessors for setting object-valued instance variables)
•	no longer exclude applications which have no CFBundleID
•	properly handle toolbar item views which are nil
•	better error handling during patching

1.1d2 / 27 January 2002 / installer 1.0.1
•	Installer works around suid root bug (should no longer crash NetInfo Manager and Disk Utility on startup) [Peter Miller]
•	Better preference file handling
•	Fixed installer bug where ICeCoffEE couldn’t be removed if the folder in which it was installed was inaccessible
•	No longer disable Services contextual menu in excluded apps
•	Fixed “dead text fields” in toolbars and drawers [ZnU].  Note: to ⌘-click a text field in a toolbar, click then ⌘-click immediately afterwards, otherwise you'll move the toolbar item instead.

1.1d1 / 25 January 2002
Added Services item to contextual menu

1.0 / 25 January 2002
Minor tweaks to Read Me file

1.0a6 / 25 January 2002
Added exclusion, no UI yet (edit the plist if you need to)—defaults to exclude PBX. Added Remove function to the installer

1.0a5 / 24 January 2002
Fixed “dead text fields” bug, I think...

1.0a4 / 23 January 2002
Test version with installer

1.0a3 / 22 January 2002
Only activate on ⌘-left mouse button

1.0a2 / 21 January 2002
Removed debugging messages; reports errors in a dialog box rather than Console; flash URL; fixes errors clicking on <>; temporary disable function; read me

1.0d1 / 20 January 2002
Proof of feasibility.

Acknowledgments

John Marriott, for inspiration and testing
Michael Dinsmore, John Hayes, Ben Hines, Philippe Martin and Raphaël Szwarc, for testing and suggestions
Slava Karpenko and Rosyna Keller at Unsanity, for their incredible software and generosity
Quinn and Michael Schürig, for ICeTEe
everyone who worked on Internet Config

This product  uses Application Enhancer system
 Copyright ©2002-2003, Unsanity LLC
http://www.haxies.com/ape/