2009-06-16

Easy Find is a great free alternative to Spotlight for finding files

I usually give my files long and meaningful names, so to find stuff I just need a tool that will quickly and easily let me do a wildcard search on just file names.  I tried a few times, but I was never able to figure out how to do that kind of search using Spotlight.  I finally came across a free application called Easy Find from Devon Technologies that is optimized for the kind of searching I need.  Its pretty bare bones, but it does exactly what I want to be able to do.

2009-06-12

Applescript to give a primative command line interface to MS Word 2008

One of the things I hate about MS Word is having to use the mouse to click through menus to do simple things. Of course you can create keyboard shortcuts for stuff, but I find it hard to remember really complicated keyboard combos. What I prefer is the old XyWrite approach, which is to hit a command key, then enter a two or three letter code for an action, and then hit enter to have it execute.

Back when I was using Word 2000 for Windows I found a simple solution: Create a keyboard shortcut for the Run Macro command (Ctrl-M), and then write macros with 2-3 character names. For example: I wrote a macro to accept all revisions in a document, then named it 'aa' (for accept all). Then to accept all revisions all I had to do was hit Ctrl-M, type aa, hit enter, and boom, all the revisions were accepted.

When I switched to Mac OS X and Word 2008 for Mac I couldn't find any obvious way to recreate this functionality, so I suffered through clicking through menus for a lot of commands. However, one day I just reached my limit with click-click-click-click and decided to find a solution using Applescript. Here is what I ended up with:

-- Open a dialog box for user input
set var_input to display dialog "Word command: " default answer ""
-- For some reason you need to do this to get the user input into a string variable
set var_input to (text returned of var_input) as string
-- Applescript apparently doesn't have SELECT CASE statements so use If Else to take different
-- actions based on user input
if var_input = "st" then
    -- Convert selected text to strikethrough font
    tell application "Microsoft Word"
        set strike through of font object of selection to true
    end tell
else if var_input = "aa" then
    -- Accept all changes in the document
    tell application "Microsoft Word"
        accept all revisions active document
    end tell
else if var_input = "kt" then
    -- Toggle keep text together (so text doesn't break over page break)
    tell application "Microsoft Word"
        tell selection
            if ((keep with next of paragraph 1 as boolean) is false) then
                set keep with next of every paragraph to true
            else
                set keep with next of every paragraph to false
            end if
        end tell
    end tell
else if var_input = "uc" then
    -- Convert the selected text to all UPPERCASE
    tell application "Microsoft Word"
        set case of characters of selection to upper case
    end tell
end if
What this does is open up a dialog box where you can type in a string of characters, and then based on what you entered it tells MS Word to do some command or other.

Then I saved the Applescript in the folder:
Users/myusername/Documents/Microsoft User Data/Word Script Menu Items

With the name:
Command Line\cM.scpt

Although its not at all obvious, the \cM.scpt at the end creates a Ctrl-M as a keyboard shortcut for the Applescript. For more on naming Applescripts in this folder so they have keyboard shortcuts see:

http://www.entourage.mvps.org/script/add_shortcuts.html

Its for Entourage, but the script naming conventions appear to be the same.

2009-06-04

How to make keyboard shortcuts for Accept Revision and Next Revision in Microsoft Word 2008 for Mac

I find the native interface for working with tracked changes in MS Word 2008 to be unbearably clumsy. You have to turn on the Reviewing toolbar and then click an icon to get to the next tracked change, then click another icon to accept the change, and then repeat, which gets to be quite a clickapalooza with a long document with lots of changes.

I prefer to hit one keyboard shortcut to move to the next tracked change, then hit another keyboard shortcut to accept the change. For some reason Microsoft didn't bother to include these keyboard shortcuts. To set them up:

  • Choose View -> Customize Toolbars and Menus
  • Click the Keyboard button
  • In the Categories box select Tools
  • In the Commands box select AcceptChangesSelected
  • Click in the box for "Press new keyboard shortcut" and then hit your preferred key combo. Be sure not to use a combo that is already assigned to something because it just won't work.
  • Click the Assign button.
To make a keyboard shortcut to jump to the next tracked change just repeat, but this time select NextChangeOrComment in the Commands box.

I also like to have a keyboard shortcut for toggling track changes off and on. For that select ToolsRevisionMarksToggle in the Commands box.