A couple of TextExpander thingies

I sent out a bill to a client the other day and decided I wanted to start putting the due date for my invoices in the body text of the emails they’re attached to. The due date is on the invoice itself, of course, but I figured an extra reminder wouldn’t hurt.

And being me, I didn’t want to add the due date by hand. I wanted it added automatically.

I already had a simple TextExpander snippet for my billing emails, made shortly after TextExpander 3 added fill-in-the-blank fields. I was afraid I’d have to abandon that one and write a script that would add a net 30 due date. I had somehow missed that TextExpander has had just the sort of date and time math I need since version 2.5. That made the changes to the old snippet trivial.

TextExpander billing snippet

The content is

Attached is Company Name invoice %fill:invoice% for $%fill:amount%, covering recent services on the above-referenced project. Payment is due %@+30D%B %e, %Y.

Thank you for using Company. Please call if you have any questions or need further information.

The date math and formatting are handled by the

%@+30D%B %e, %Y

code at the end of the first paragraph. Choosing Date/Time Math > Add Day(s) from TextExpander’s insert menu,

Date/Time Math in TextExpander

inserts %@+1D into the Content area. Change the 1 to however many days you want (30 for me) and then insert the usual date codes after the D. %B %e, %Y yields the month name, the day without a leading zero, and the four-digit year: July 15, 2011, for example. Much simpler than I thought it would be.

While I’m dispensing simple TextExpander snippets, I might as well make available my set of Mac keyboard symbol snippets. If you ever have to write down instructions on how to use a Mac, these make it easy to describe keyboard shortcuts. They’re distinctly faster than scrolling through the Character Viewer.

To insert Type Key name
;cmd Command
;opt Option
;shift Shift
;ctl Control
;tab Tab
;bs Backspace
;del Forward
Delete
;enter Enter
;return Return
;esc Escape
;apple Apple
;left Left Arrow
;right Right Arrow
;up Up Arrow
;down Down Arrow
;space Space

That last one’s meant for the  menu, not as a synonym for the ⌘ key. Only uncouth arrivistes to the Mac platform refer to “the Apple key.”

Update 6/17/11
I just added the five snippets after the  to the Keyboard library at the suggestion of Lri in the comments.

I’m sure you can get snippets like this from many sources; the one advantage of downloading mine is that they aren’t bundled with a lot of other snippets you may not want.

By the way, if you don’t like the semicolon prefix I use in my snippets (even though you should), you can change them all in one fell swoop by using my little teprefix script.


4 Responses to “A couple of TextExpander thingies”

  1. Lri says:

    Symbols missing from Keyboard.textexpander:

    ;caps ⇪
    ;eject ⏏
    ;clear ⌧
    ;ftab ⇤
    ;pup ⇞
    ;pdown ⇟
    ;home ↖
    ;end ↘
    ;up ↑
    ;down ↓
    ;left ←
    ;right →
    ;space ␣
    

    It’d be more convenient to distribute snippets like this in some format understood by File - Add Group from File…. (Considering that most people downloading the snippets them will want to change the affixes.)

  2. Lri says:

    Sorry, ⇤ is supposed to be btab, not ftab.

    Oh and for short plain text snippets, I skip TE and use Basic text expansion with AppleScript — Gist via FastScripts. (The file containing the snippets is in the Notational Velocity library, so it’s easy to access and doesn’t need to be saved manually.)

  3. Dr. Drang says:

    Lri,

    This library is mostly symbols I’ve actually had to use. Not sure why I haven’t had to add ↑, ↓, ←, →, or ␣ , but they seem like good additions because I probably will use them sometime. To me, the others just aren’t used enough to be worth the clutter.

    It would be helpful for people managing snippet libraries if TextExpander could read/write a simpler format (would eliminate the need for scripts like teprefix). Have you suggested it to Smile?

    I like your AppleScript, and I can see how it makes it easy to add/edit snippets, but I don’t think I’d want to add a third snippet method to my workflow. TextExpander and TextMate snippets are enough for me.

  4. Lri says:

    Having a second, even if simplified, storage format seems kind of out of character for TE, so I wouldn’t necessarily suggest it to Smile. You can already import tab delimited text files, which even works for importing images via rtfd, and export by dragging (or copying and pasting) items from the list view to a text editor.

    I keep my TextMate snippets in the NV library as well (updated via this buggy script), and in fact I don’t use TE at all anymore, so the overall setup isn’t really that complicated.