Later that year…

A while back, [John Gruber][df] posted a [FastScripts][fast] [script][ntp] to
fix a loathsome Apple Mail behavior, which was shortly followed by
[signature-enabled][ntps] improvements. Fourteen short weeks later, here’s
my own version:

tell application “Mail” to activate
tell application “System Events”
tell process “Mail”
– Run the regular “Reply” command
tell menu bar 1
click menu bar item “Message”‘s menu “Message”‘s menu item “Reply”
end tell
delay 1.0 — Give it a chance to finish

– Remember what signature was selected and switch to “None”
set blib to value of (pop up button 1 of window 1)
if blib is not “None” then
click pop up button 1 of window 1 — The Signature popup
click menu item “None” of menu 1 of pop up button 1 of window 1
delay 0.2
end if

– Delete the return Mail inserted; recreate it at the bottom where it belongs
key code 117 — Forward delete
key code 125 using command down — Command-down (skip to the end)
key code 36 — Return

– Restore the previously selected Signature
if blib is not “None” then
click pop up button 1 of window 1 — Still the Signature popup
click menu item blib of menu 1 of pop up button 1 of window 1
delay 0.2
key code 117 — Mail inserts a bonus line here too
end if
end tell
end tell
{: lang=applescript }

One drawback that I maintain from John’s original is the use of a time delay —
I have other scripts that use them, and for each of them I occasionally have
the script fail because my machine is a little busier that day.[^pbook] That
being said, this script usually runs correctly.

My improvement is how I deal with arbitrary signatures. If you pick a
different signature (or no signature) from the popup menu in the compose
window, Mail updates the message correctly — so I just use that behavior
to do the messy bits.

[df]: http://daringfireball.net/
[fast]: http://www.red-sweater.com/fastscripts/
[ntp]: http://daringfireball.net/2007/07/non_top_posting_scripts (Non-Top-Posting Reply Scripts for Apple Mail)
[ntps]: http://makkintosshu.dyndns.org/journal/non-top-posting-reply-scripts-for-apple-mail-with-signature-support

[^pbook]: Yes I’m still using a PowerBook — what’s that got to do with anything?

Posted in Uncategorized | Tagged , , , , | Comments Off

Uh…click what?

Having trouble clicking? Try clicking instead:

Click what?

Posted in Uncategorized | Tagged | Comments Off

TextMate Here

TextMate Icon

That was actually the first post in a series (of two). This one opens a new
TextMate window on the selected item (if there’s a single item selected), or
the current folder otherwise. This makes the script a lot shorter (that and
there being a simple command-line TextMate launcher that I can use).

The instructions are the same as last time; save it as an application
somewhere you can find it, and call it “TextMate Here”. Find it with the
Finder, copy and paste TextMate’s icon onto it, and drag it up into your
Finder toolbar.

If you have TextMate installed someplace strange (or have an old enough one
that it doesn’t have the `mate` command in it) it will break; if this
happens, you get to keep both pieces.

Here’s the script:

on currentFolder()
tell application “Finder”
try
return POSIX path of (front window’s folder as text)
on error
return null
end try
end tell
end currentFolder

on selectedItem()
tell application “Finder”
try
get the selection
return POSIX path of (the result’s first item as text)
end try
end tell
return currentFolder()
end selectedItem

do shell script “/Applications/TextMate.app/Contents/Resources/mate ‘” & selectedItem() & “‘”
{: lang=applescript }

Feedback, improvements, etc. still welcome.

Posted in Uncategorized | Tagged , | Comments Off

iTerm Here

iTerm Icon

This is, for lack of a better description, my version of the _Open a Command
Window Here_ Windows XP PowerToy. I’ve played around with doing this from
the context menu, but I eventually decided I’m not fond of that approach.
Since I have the toolbar visible in Finder, however, it’s pretty easy to put
a script up there and pretend it’s a real toolbar button.

To use it, save it as an application somewhere you can find it, and call it
“Term Here”. Find it with the Finder, copy and paste iTerm’s icon onto it,
and drag it up into your Finder toolbar (like how you would drag it into the dock).

My version of this will use the path of the selected item in the front finder
window if it is a folder (and is the only thing selected). Otherwise, it will
use the path of the Finder window itself. If you want to skip the selection
business altogether, just replace the call to `selectedFolder()` before the
last (iTerm) stanza to `currentFolder()`. It then launches iTerm if needed,
create’s a new (empty) window if needed, opens a new tab in that window
`pushd`’s to the directory, and lists its contents for you.

Here’s the script:

on currentFolder()
tell application “Finder”
try
return POSIX path of (front window’s folder as text)
on error
return null
end try
end tell
end currentFolder

on selectedFolder()
try
tell application “Finder”
get the selection
set theItem to result’s first item as alias
end tell
set theInfo to info for theItem
if theInfo’s folder then
return POSIX path of theItem
end if
end try
return currentFolder()
end selectedFolder

set targetPath to selectedFolder()
tell application “iTerm”
activate
try
set term to the front terminal
on error
set term to (make new terminal)
end try
tell term
launch session “default session”
tell current session
write text “pushd ‘” & targetPath & “‘”
write text “ls”
end tell
end tell
end tell
{: lang=applescript }

Feedback, improvements, etc. welcome. Unless you think it should
automatically detect whether iTerm or Terminal is your default terminal
program, in which case your feedback is only welcome if you can explain a way
to detect this from AppleScript that doesn’t double the length of the script. :)
I just don’t care enough about this issue to figure out how to do it.

Posted in Uncategorized | Tagged , | Comments Off

Updates

Okay, I rebuilt the site again. Since I didn’t just copy the theme over,
there will likely be some formatting quirks. On the plus side, since
Wordpress is one-click installed now, hopefully we can stop counting the lag
between Erwin updating his blog and me updating mine in months.

Posted in Uncategorized | Tagged | Comments Off

Lunatic HTML

Sometimes all you want is a little confirmation that there are people crazier
than yourself out there. Here’s a perfect example:

Insert your own joke about building HTML in Notepad here.

Posted in Uncategorized | Tagged | Comments Off

Not my usual poison…

William Utermohlen's 1967 Self Portrait. © 2006 Galerie Beckel-Odille-Boicos

There aren’t a lot of items in _Raves_ that I would classify as haunting and
terrifying, but this is an exception.[^1] I only knew one of my
grandmothers, and only after she was slipping into dementia,[^2] so this has
something of a personal connection to me.

The painting on the right is William Utermohlen’s 1967 self-portrait from a
series of self-portraits chronicling his descent into dementia. He was
diagnosed with Alzheimer’s in 1996, so this is the first in the series.

- [Wired: The Alzheimer's Self-Portraits of William Utermohlen][wired]
- [NY Times: Self-Portraits Chronicle a Descent Into Alzheimer's][times1]
- [NY Times: Slideshow of Utermohlen's Self-Portraits][times2]

[^1]: It actually got mentioned in one of the Wired feeds a while back, so it
might not even be anything new to most of my audience (i.e., Erwin).
[^2]: Not necessarily from Alzheimer’s, but dementia none the less.

[wired]: http://blog.wired.com/tableofmalcontents/2006/11/the_alzheimers_.html
[times1]: http://www.nytimes.com/2006/10/24/health/24alzh.html?ex=1162616400&en=66feba45095d0e0e&ei=5070
[times2]: http://www.nytimes.com/slideshow/2006/10/23/science/20061024_ALZH_SLIDESHOW_1.html

Posted in Uncategorized | Tagged | Comments Off

iTunes 7 (Again?!)

If you’ve read anything about the Just For You section lately, it’s been about
how you can turn it off to see the freebies panel on the [iTS][its] home page.
I’ve found this to be peculiar advice, personally, because I’ve seen the Just
For You panel and the related link at the bottom of the page to turn it on and
off exactly once since I upgraded to iTunes 7. It isn’t that I’ve turned it
off — I didn’t. I just never seem to hit one of the servers that shows the
thing.

Now, I’m assuming that Apple hasn’t canned the feature, if for no other reason
than because it’s mentioned explicitly on the [iTS Music][its] page. So, what
if you actually liked the feature, or like me are just dimly curious what sort
of crazy ideas it comes up with? You do the [same thing][hint] you’d do if
you are missing the freebies panel — link to it.

[its]: http://www.apple.com/itunes/store/ (iTunes Store)
[hint]: http://www.macworld.com/weblogs/macosxhints/2006/09/itunes7free/index.php?lsrc=macosxhintblog

So, assuming the URL for you is the same as it is for me (which might be true outside the US…):

> [Just For You][link]

[link]: itms://phobos.apple.com/WebObjects/MZPersonalizer.woa/wa/seeAllRecommendations

Posted in Uncategorized | Tagged | Comments Off

iTunes 7

I skipped the whole “first takes on” bandwagon with the last large-ish release
of iTunes, but not this time (apparently). So, here’s what jumps out at me:

1. I don’t get why people say the MiniStore is gone. If I show it, there it
is (on both Mac OS X and Windows).
2. Apparently, it isn’t enough anymore for every Apple application to have a
different splitter widget (and, in iTunes’s case, a different window
rounded-corner radius). Maybe they decided that, since the main interface
basically looks the same on Mac OS X and Windows, it should look like an
alien in both environments, instead of just in one environment or the other.
3. I also saw somewhere that the scroll bars have the arrows together — on Mac
OS X it picks up the value for this from your Appearance preference pane
(on Windows, as far as I can tell, it always uses the _at both ends_
variety).
4. The _every widget looks different than it does anywhere else_ plan applies
only to the main window — the preferences dialog looks like a normal window
for whatever OS you’re running it on. This makes me suspicious of the
theory that maybe this is a Leopard preview (well, that and having used
some recent Apple applications). But theming the OS is still crazy talk.
5. In iTunes preferences, the _Show: Podcasts_ and _Show: Radio_ items on the
General pane and the _Disable Podcasts_ and _Disable Radio_ items on the
Parental pane apparently set the same two preferences (flip between the two
panes, flipping the Podcasts item each time, and you’ll see what I mean).
6. Related to the above, if you want to hide the STORE category in the source
list, there’s no check box to hide it, but there is a box for your parents
to disable it. Mind you, if either the _Purchased_ or _Download_ item in
that category has stuff in it, that item (and therefore the STORE category)
will remain, just with fewer items in it.
7. iTunes 6._something_ has been the current version since I returned to the
platform, so I’ve only ever seen the green variant of the iTunes icon on a
current version of the software. I keep noticing the blue one in my dock
and wondering how I managed to get iTunes 4 or something on my Tiger
machine.
8. The only two _gapless_ examples I can think of in my library weren’t
detected. And by _weren’t detected_, I of course mean they now play
gapless, but the checkbox that seemingly enables this behavior on each
item’s Get Info dialog is not checked.
9. There’s useful newcomer in the Get Info dialog if you’ve been playing with
TiVoToGo on your Windows box — some of the _TV Show_ tags on MPEG-4s can
now be edited, so you can put your TV Shows in the (\*gasp\*) TV Shows
part of your library.
10. In Finder (and a number of other apps, for that matter), there’s a
segmented control in the toolbar to chose from the three different view
types, and you can use Command 1–Command 3 to flip between them. iTunes
already uses those for zooming videos that you’re playing, and there’s no
hint how you might flip between the three view styles from the keyboard,
if you even can do it. And that control isn’t in the sequence of controls
you can Tab to, so don’t get any ideas there scooter.

Update 1
——–

I’m a dimwit (or shouldn’t write this stuff so late at night). iTunes 4–6 all
had the green icon, and I’d actually come back during the iTunes 4 era. iTunes
3 had the [purple icon][purple], iTunes 2 had a [blue icon][blue], and it looks
like iTunes 1 had this spiffy [three-colored job][multi] that I don’t think
I’ve seen before.

[purple]: http://images.google.com/images?q=itunes3+icon
[blue]: http://images.google.com/images?q=itunes2+icon
[multi]: http://images.google.com/images?q=itunes1+icon

Update 2
——–

The _iTunes 1_ link above now points where it’s supposed to.

Posted in Uncategorized | Tagged | Comments Off

Coming of Age

The following story is true; the dates have been changed to protect the lazy.

Last night, I heard a sound for the first time, although I still somehow
recognized it instantly. I was sitting at my computer working and I heard my
wife scream from the living room. Mind you, I’ve known her for a lot longer
than I’ve been married to her, and I feel like I’ve heard her shriek more
than once in that time…but this one was special.

Someone once said “before you get married, make sure one of you kills bugs.”
Usually I just scoot them outside on a scrap of paper or something — assuming
we get to it before one of our cats does.[^1] This didn’t sound anything
like that.[^2]

This time, once my loving wife fetched me, I found a mouse laying in the
middle of the living room. Before you get any ideas, I’m not talking about
the little plastic numbers with glued-on fur and felt ears and tail. I’m
talking a real mouse capable of real bleeding. Oh, and it was bleeding.
Fortunately (or is that _unfortunately_), none of our cats spent enough time
feral to know why they can render a mouse into this state so easily.[^3]

The answers to the two questions I remember her asking were both _yes_. Any
guesses? “Do you want a glove?” and “Is he still alive?” — he wasn’t still
there the next morning, so either he was playing dead to get the cat to lose
interest or something else happened along to finish the job. Welcome to
married life, I guess.

[^1]: Anyone with a cat will tell you it’s scientifically impossible for you
to notice the bug before the cat does, even if you and the bug are
awake in one room and the cat is asleep in another room all the way
across the house.
[^2]: If I recall correctly, that event sounds exactly like my wife walking
into whatever room I’m in with a sort of tense look on her face.
[^3]: I _swear_ I am not making this up; the most underweight of our cats has
been stealing food from the most overweight of our cats, even though
the latter is fed separately. I’ve heard of cats preferring one food
over another, but the by-prescription-only weight-loss cat food?

Posted in Uncategorized | Tagged | Comments Off