Tag Archive for 'Mac'

iChm Adds Index Search

Keeping up the franctic pace of nearly weekly releases, Robin Lu has once again updated iChm to include another user-requested feature. Version 1.3 now allows you to search the index — this great little app just keeps getting better!

iChm Adds Index Support

Shortly after the well-received release of iChm 1.1.1, Robin Lu has responded to popular demand and updated his CHM Reader for Mac OS X with support for indexes.

iChm index popupThe sidebar now includes a small popup menu (shown at left) which toggles the sidebar to display either the table of contents or the index.

Congratulations to Robin for listening to users and reacting so quickly!

With the new index feature, Sparkle-based application updates and the tag-powered bookmarking system mentioned earlier, iChm is certainly the best CHM viewer available for Mac.

iChm - Cocoa CHM Reader for Mac OS X

iChm iconRobin Lu has released iChm, a Cocoa-based CHM Reader for Mac OS X with Webkit rendering, a slick tabbed interface and a bookmark system that not only allows you to store links to favorite topics in the current file, but also keeps track of your bookmarks across multiple files like in a regular Web browser.

When you bookmark a topic, you can assign tags which allow you to quickly access topics in any CHM file based on the keywords you have specified.

While the concept of tagging is hardly new, the feature is unique to CHM viewers on the Mac, and can be especially useful for help developers looking for a simple means of flagging open issues in topics—just add a FIXME tag to keep track of those pesky output bugs while you tweak your WebWorks stationery.

Unfortunately, iChm shares a shortcoming with many other Mac CHM viewers: the current version (1.1.1) offers no support for the index, which is an essential component of any well-built help system. With a little luck and a bit of persuasion, perhaps Robin can be convinced to add this feature in a later version.

It wouldn’t take much to make this the best CHM viewer available on the Mac—so many of the others were apparently released as one-hit wonders and have not been actively maintained in years.


2008-08-27 Update: Version 1.2 now includes index support.

2008-09-04 Update: Version 1.3 now allows you to search the index.

Using Mac VPN Clients with Virtual Machines

If you use Parallels or VMware Fusion and a Mac VPN client such as VPN Tracker, you can share your VPN connection between the host Mac and the guest PC by setting the network adaptor to share the host’s Internet connection via NAT.

This connection method also has other advantages, as the VMware Fusion Release Notes explain:

“VMware Fusion’s default network connection type for new virtual machines is NAT, which will prevent the spread of viruses over the network into the virtual machine, and will only expose the virtual machine to external viruses through browser security flaws when you browse the Internet.”

The idea of sharing VPN connections with Windows applications via Parallels is touted as a VPN Tracker feature and explained in detail in a how-to PDF, but it works equally well with VMware Fusion.

The key is setting the network adaptor to shared networking (NAT) as opposed to the bridged or host-only options shown in the VMware settings screenshot below.

screenshot

With this approach, network traffic from your virtual machine is routed through the existing VPN connection on the host Mac, so there’s no need to install a separate VPN client application on the guest PC.

Sharing DITA-OT in OS X & Boot Camp

If you’re using the DITA Open Toolkit on Mac OS X, you can’t generate compiled HTML Help (CHM) files directly, since Microsoft only offers the HTML Help Workshop for Windows.

But if you also run Windows on your Mac via Boot Camp, you can set up a single installation of the Open Toolkit on your Windows partition and use it to generate output from either operating system environment.

Essentially, you boot into Windows (via VMware, Parallels, or directly) and set up the toolkit there as usual.

Once you have the toolkit running under Windows, create a copy of the Ant build file for your project, adjust the paths for access from Mac OS X and save it under a new name in the DITA-OT directory on your Windows partition. (You’ll call this file later from the Terminal to build your project output on the Mac.)

Back on Mac OS, set up the environment variables required by the toolkit.

You can do this by editing the .bash_profile file in your home directory, or if you don’t like editing hidden UNIX files by hand, you can use freeware such as RCEnvironment or SSHKeychain, which provide a simple dialog that allows you to define environment variables like in Windows.

(In the background, both tools simply write to the ~/.MacOSX/environment.plist file. SSHKeychain also serves as a nice Mac equivalent to PuTTY, but that’s another story…)

The key here is to use the absolute path to the toolkit installation on the Boot Camp partition. For example, if your Windows partition is named BOOTCAMP and the toolkit lives there at C:\DITA-OT1.4.1, you might set the DITA_HOME variable like this:

DITA_HOME=/Volumes/BOOTCAMP/DITA-OT1.4.1  

You can then define the other variables relative to the toolkit directory with entries like this:

ANT_HOME=$DITA_DIR/tools/ant

Note: If you use either of the aforementioned tools to edit ~/.MacOSX/environment.plist, you’ll need to use the full paths for the remaining variables, as $VARIABLE values are not expanded when this file is read.

Once the variables are all set, you’ll need to log in to OS X again to activate them.

Then with a command like this, you can build output from the Terminal using the Mac version of the build file you edited above:

ant -f your-mac-build-file.xml html 

To build CHM output, switch to Boot Camp, run startcmd.bat in the DITA-OT directory, and enter something like this on the command line:

ant -f your-windows-build-file.xml chm

If both your build files are set to share an output folder on your Mac, your files will land in the same place, no matter which operating system you build them on.

CHM Viewers for Mac OS

A quick search for Mac CHM viewers yields a handful of open source & shareware apps which provide Mac users access to Windows help files in the Compiled HTML Help (CHM) format.

A few older shareware apps such as Chimp and CHM Viewer are only available in PowerPC versions and apparently no longer actively developed.

The remaining candidates are all free, open source software and available as universal binaries for PPC & Intel Macs. Each does pretty much the same thing–more or less successfully–though none of them quite manage to support all of the features CHMs provide in their native Windows environment.

Here’s a short list of a few pros (+) & cons (-) that appear at first glance:

  • Chmox
    + Beautiful HTML page rendering via Apple’s WebKit browser engine
    - Chokes on some large & complex pages
    - No search, index or favorites support

  • xCHM
    + Functional search, index & favorites (bookmarks)
    - Only basic HTML rendering, poor table/CSS support

  • Chamonix
    + Supposedly supports ToC, Indexing, Search and Favorites,
    - Unreliable–index shown in test file is incomplete, odd CSS background rendering quirks
    (should we read “Chamonix” as “shame on it”?)

For a more detailed–though somewhat outdated–comparison of xCHM & the now-defunct CHM Viewer, see this Mac OS X Hints article.

Automator Workflow: Set ZIP File Date

When you compress a file or folder in the Finder via the Create Archive command, a ZIP file is created using the current date as modification date.

But when you’re archiving older data, it’s much more useful for the ZIP file date to reflect the date of its contents, since a few years from now you probably won’t care when you compressed the stuff, but rather how old the files inside are.

Fortunately, the command line version of ZIP included in Mac OS X includes an option to do just this: zip -o, which according to the man page will

Set the “last modified” time of the zip archive to the latest (oldest) “last modified” time found among the entries in the zip archive

—which is just what we want.

But depending on your command line proficiency, you may find it a bit tedious to open up a terminal window and look up the command syntax every time you need to compress a file.

Enter Automator, one of the most useful (and unsung) productivity tools in OS X, which we’ll use to create a new Finder plug-in (or “workflow”).

To create the workflow, open /Applications/Automator.app and add three actions in this order:

  1. From the Finder library, drag the Get Selected Finder Items action to the workflow area on the right side of the window.
  2. Drag the Create Archive Finder action to the workflow area, placing it after the first action.

    (At this point, you can pre-specify a name and location for the archive file, or set the Options to prompt for this information when the workflow runs.)

  3. From the Automator library, add the Run Shell Script action. Leave the Shell set to /bin/bash, set Pass input to as arguments, and replace the default script in the text box with zip -o "$@".

That’s it!—Save the workflow as a Finder Plug-in, and you can run it on files & folders in the Finder by Control-clicking and choosing your new command from the Automator submenu in the shortcut menu.

CTRL-clicking in VMware Fusion

If you use the Enable Mac OS keyboard shortcuts option in VMware Fusion, Mac keyboard commands are passed on to the VM, which is useful if your Mac-schooled muscle memory has you pressing Apple+S every time you breathe.

The Enable Mac OS mouse shortcuts also affects the CTRL key, which is used in Windows for nonadjacent selection & a few other handy things.

With the latter option active, VMware interprets the a CTRL-click like a Mac would, invoking the context shortcut menu instead of extending the current selection, which can be absolutely vexing if you’re trying to select a bunch of individual files in a folder or open a Firefox link in a new tab.

While you can easily disable the option entirely, there is an alternative if you’ve grown accustomed to command-clicking to emulate a middle-click and want access to these mouse shortcuts in your VM:

To have it both ways, just use the Enter key to the right of the space bar instead! When you press this key and click the mouse, VMware passes this on to Windows as a CTRL-click.

SCPlugin—Subversion Client for Mac

Say “Hello” to SCPlugin — At long last, there’s a Mac equivalent for TortoiseSVN: a free, open-source Subversion client for Mac OS X that integrates with the Finder to display the status of your version-controlled files in the Finder without the need for a separate application.

While dedicated Subversion clients can be useful at times, for most day-to-day work it’s much easier to check in or out via a context menu command without having to fire up a different program (though Versions is definitely one to watch).

Like in TortoiseSVN or Tortoise CVS, icon overlays badges show at a glance the Subversion status of each file in a window.

HumaneText.service

Fans of John Gruber’s Markdown will appreciate HumaneText.service, a system-wide Mac OS X service that translates between markdown and XHTML with quick key-commands: Shift+Apple+{ and Shift+Apple+}. Simply beautiful!

If you haven’t heard of markdown, it’s a simple and elegant means of writing plain text that is highly readable “as is”, yet easily converted to HTML. As the author says:

The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions. While Markdown’s syntax has been influenced by several existing text-to-HTML filters, the single biggest source of inspiration for Markdown’s syntax is the format of plain text email.