December 16, 2011
Moved to Squarespace

As much as I love Tumblr, I don’t trust that it will stick around, and I don’t think that it is going to make the improvements that I want.

So I have moved this site to Squarespace. The direct URL is now http://luo.ma/.

Originally I had intended to import my RSS feed here, but Tumblr has apparently done away with that option.

So I hope that you will follow me there instead.

If you go to http://luo.ma/subscribe you will see options to follow posts (via RSS or email) on Technology, Faith, Personal, and Links. There is also an RSS feed for the entire site, naturally.

Thanks for your time and attention.

September 8, 2011
An RSS feed for Dropbox

Dear Internet:

I made you a thing. It’s an RSS feed for Dropbox beta releases.

You can find it at http://feeds.feedburner.com/dropboxmacbeta aka http://bit.ly/rssfordropbox.

(As you may have guessed, it only includes betas for Mac OS X, but if there is interest, I could easily make feeds for Windows and Linux too. Let me know if you’d be interested in those.)

“Why?”

Dropbox betas are (usually) very stable and I want to use them as soon as possible, but I don’t want to have to check the forum every day to see if there is a new build.

“Cool idea… where’d you get it?”

I had the idea after reading this post on StackExchange.

I wrote the script myself.

“How does it work?”

A shell script and a dash of magic.

“No, really, give me the nerdy details”

A shell script checks to see where http://forums.dropbox.com/forum-build.php redirects (using the HTTP ‘Location’ header). If the redirect has changed, that means there is a new beta. If there is a new beta, the script generates a new RSS entry.

The script runs via ‘cron’ every few minutes. Since it only checks the HTTP headers, it should cause no noticeable effect on Dropbox’s servers. Certainly less than a bunch of nerds refreshing the forums URL.

“Your RSS sucks and doesn’t work in [Insert RSS Reader Here]”

Sorry.

I have never worked with RSS before. I cobbled together the necessary parts via Google and checked that I was generating valid RSS according to http://validator.w3.org/.

And it works in Google Reader (which is all I really needed).

If there are specific elements that you would like to see added to the RSS feed, I’d be glad to consider adding them, especially if you provide good instructions on how the RSS should be formed.

“I don’t want to use betas I only want official releases”

That’s a reasonable request and I will probably make an RSS feed for that also, because Dropbox does not auto-update very well. But I wanted this first, so I made this first.

The end

I hope you like it.

p.s.

There is an official RSS feed for Dropbox release notes at https://www.dropbox.com/release_notes/rss.xml but the feedburner feed points directly at the DMGs so you can download them.

June 25, 2011
My dot-source file

At the top of each of my shell scripts, you will see a block line this:

SOURCE="${HOME}/.source"

if [ -r "${SOURCE}" ]
then
    . "${SOURCE}"
else
    echo "$0: no ${SOURCE} found"
fi

so I thought it would be a good idea to explain what that is, why mine isn’t available, and what you should put in yours.

“What is .source ?”

My .source file is a collection of variables and a few functions which I wanted to use over and over again, but:

  • Did not want to keep retyping
  • Wanted to be able to change without having to manually edit all of the files

For example, a standard $PATH on Mac OS X might look like this:

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

However, if you use MacPorts you might want to add /opt/local/bin

PATH=/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

but what if you then decide that You want to use MacPorts, but you don’t want the MacPorts versions to be the default, you might change that to

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin

or you might decide that you really prefer Fink so now you want

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/sw/bin

or you like them both:

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/sw/bin:/opt/local/bin

and then eventually maybe you find yourself using Homebrew and decide that you don’t want either of those things in your $PATH, but you do want to make /usr/local/bin/ the default:

PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin

Now, imagine that every time you changed your mind, you had to look through all of your shell scripts to make sure that you changed them all.

You could do that… or you could do the much more sane thing, and install “global” variables in one master file which gets read by all of your shell scripts, so that if you want to make a change all you have to do is change that master file.

.source is that master file.

If I define my $PATH in ~/.source and then read-in ~/.source to all my scripts, any changes are made automatically.

“That’s such an edge case, it hardly seems worth it”

Oh there’s a lot more.

For example, when I have a script which needs to email me, I could do:

foo | Mail -s "Output of foo" example@gmail.com

but then I have two potential problems.

  1. If I share this script with anyone, they now have my email address. Worse, if I put it online, it’s going to get indexed by Google and then by harvested by spambots.
  2. What if change my email address later?

To avoid these problems, when I need to email myself, I use a variable ($MAILTO) like so

foo | Mail -s "Output of foo" "$MAILTO"

In my ~/.source file I include:

MAILTO=example@gmail.com

and then if I change it later, it’s automatically changed everywhere.

If I need to be notified of something immediately, I can use my email-to-SMS address, which I put in a different variable: $SMSTO

SMSTO=5551234567@txt.att.net

which means that I can use that without giving everyone my cell phone number either.

What’s in a $NAME?

Almost all of my scripts used to include this line:

NAME=`basename $0`

to get the shortname of the script for use in error and informational messages. Now I just put that in .source and I can use $NAME in all my scripts.

‘msg’ for you sir!

I found that I was often writing functions in my shell scripts which would send a message via growlnotify (which is helpful when scripts run automatically via Hazel or launchd), and which would send the same message via ‘echo’ (which was helpful when running the script while ssh’d into another machine).

The biggest problem there is that I kept getting the syntax or order of arguments for growlnotify wrong, and it was tedious.

So I wrote a simple bit of script code which:

  • checks to see if growlnotify is installed
  • if it is, creates two functions: one named ‘msg’ which I use instead of ‘echo’ to send messages both to ‘echo’ and ‘growlnotify’, and the other named ‘sticky’ which will create a ‘sticky’ Growl message as well as ‘echo’
  • if growlnotify isn’t installed, ‘msg’ and ‘sticky’ are just other ways of saying ‘echo “$NAME: ’ plus whatever message I put in

Here’s the code which goes in .source:

which growlnotify >/dev/null

if [ "$?" = "0" ]
then
    # use growlnotify

        # IFF we are giving a "sticky" alert, let's use a different icon
        # to catch the user's attention, since 'sticky' messages
        # are, I assume, always fairly urgent/important

    ALERT="$HOME/Dropbox/Dropbox/Public/Growl-App-Icons/YellowAlert.png"

        # CHANGE THAT PATH to work on your system!!!
        # you can download the file I use from here:
        # http://dl.dropbox.com/u/18414/Growl-App-Icons/YellowAlert.jpg

    msg () 
        { 
            # rather than have two separate functions
            # one for sticky and one for 'regular'
            # I decided to combine them. Now for a regular message
            # I type 'msg FOO' but for a 'sticky' 
            # message, I type 'msg sticky FOO'
            # which reinforced the idea that it's the same thing as 'msg'
            # just with more emphasis.
            # 
            if [ "$1" = "sticky" ]
            then
                shift
                growlnotify -a "$APP" --sticky --image "${ALERT}" --message "$NAME" "$@"
            else    
                growlnotify -a "$APP" --message "$NAME" "$@"
            fi  

            echo "$NAME: $@"
        }

    # I'm keeping this around, for now, until I go through my scripts
    # and make sure that none of them are using it anymore.
    # Eventually this will go away, as well as the 'sticky' in the 'else' clause below
    sticky () 
            { 
                echo "$NAME: $@"
                growlnotify -a "$APP" --sticky --image "$ALERT" --message "$@" "$NAME (oldsticky)"
            }

else
    # if we get here, growlnotify was not found
    # so 'msg' and 'sticky'
    msg () { 
                if [ "$1" = "sticky" ]
                then
                    # We can't really do 'sticky' in echo 
                    # but 'tput bel' will cause a 'system beep'
                    # even via ssh (works on OS X, Linux, and OpenBSD. Presumably others)
                    shift
                    tput bel
                fi  

                echo "$NAME: $@" 
            } 

    sticky () { 
                echo "$NAME: $@" 
            } 
fi

Now, wherever I would have used:

echo "$NAME: foo bar bah"

I just use

msg "foo bar bah"

and the message is output via echo (with “$NAME: ” prefixed) and to growlnotify. It looks something like this:

dot-source-hello-world-msg

a TEMP place for my stuff

I try to avoid making temporary files whenever possible, but sometimes it’s just much easier. I used to just dump them into /tmp/ but on a shared server, files in /tmp/ might be readable to anyone else on that computer, which is something I wanted to avoid.

A better idea is to use TMPDIR, which is set automatically on Mac OS X (at least in Snow Leopard). However, before I learned about TMPDIR, I already had a bunch of scripts written which used “$TEMP” but since $TEMP was defined in .source I was able to change it fairly easily. I actually made it so that if TMPDIR isn’t found, my temporary files will be placed in ~/.Trash/ (the folder where OS X trash is kept before being emptied), and it even makes sure that it exists (which it might not if this is a non-OS-X Unix system). If it doesn’t exist, it tries to create it, and if it can’t create it, it falls back to /tmp/ as a last resort.

if [ -d "$TMPDIR" ]
then
    TEMP="$TMPDIR"
else    

    TEMP=${HOME}/.Trash/
    TMPDIR=${HOME}/.Trash/

    export TEMP
    export TMPDIR   

    if [ ! -d "$TEMP" ]
    then
        echo "Attempting to make TEMP ($TEMP):"
        mkdir -p "$TEMP" || TEMP="/tmp"
    fi  

fi

That’s about it

My .source file doesn’t have very much in it, but it’s hugely helpful to have the ability to define my own variables and functions to be used in all of my scripts.

If you try to use one of my scripts and get an error about ‘command not found’ it is probably ‘msg’ which you can copy/paste into your own ~/.source file.

“What if I want to override the variable?”

What happens if you have a script where you only want commands from a specific PATH but you have already set a global $PATH in .source? Simple, just define $PATH again after you read .source:

SOURCE="${HOME}/.source"

if [ -r "${SOURCE}" ]
then
    . "${SOURCE}"
else
    echo "$0: no ${SOURCE} found"
fi

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

That will tell your script to use the last $PATH variable.

“Isn’t it a hassle to include the block of text for .source at the top of each post?”

Not at all. I use TextExpander to create my base shell script template, which I outlined in my next post. It includes that block automatically.

Dropbox

I’ve been using ~/.source for a long time, even before I used Dropbox. These days, .source is actually a symbolic link:

lrwxr-xr-x 1 luomat 27 Mar  7 20:17 /Users/luomat/.source -> Dropbox/DotFiles/source.txt

Note that I don’t use “.source” on Dropbox because I’m not sure how Dropbox handles that, plus it makes it easier to find and edit when needed.

All of my Unix-y configuration files, including my .wgetrc and .zshenv are stored in ~/Dropbox/DotFiles/ so I can use them across all of my computers.

To link my ~/Dropbox/DotFiles/source.txt to ~/.source I simply did this in Terminal:

cd 

ln -s Dropbox/DotFiles/source.txt .source

and all of the scripts continue to read it just the same as always. Plus I have the benefit of my last 30 days worth of changes being stored on Dropbox in case I change my mind. Sort of like a poor (read: lazy) man’s ‘version control’ system, or “30 day undo.”

Short URL for this page: http://luo.ma/dotsource

June 24, 2011
Apple: “No Lion on DVD, come use our wifi!”

If Lion isn’t going to be available on DVD, but only through the App Store, how can you download it if you don’t have high speed Internet?

According to Jim Dalrymple of Loopinsight:

Several Apple store representatives have told Computerworld that users can come into their local Apple store and download Lion using their Wi-Fi network. You don’t need to make an appointment, just walk in and start downloading.

This is a nice thing for Apple to offer. I have no idea how well it will work in practice. I assume most of the early adopters have connections at home which will let them download and install it right way, so I can’t imagine a huge number of people showing up at Apple’s doorstep waiting to do this.

Also, if you live in

  • Alaska
  • Arkansas
  • Montana
  • North Dakota
  • South Dakota
  • Vermont
  • West Virginia
  • Wyoming

and don’t have access to high speed Internet, there are no Apple retail stores in those states.

I live in Ohio and the nearest Apple Store to me is 2 hours and 20 minutes (115 miles) away. Our home Internet connection is satellite and is limited to 200 MB per day. My previous connection was about 17 GB per month. Assuming that the download comes in around 4 GB, that would have been a significant dent in my monthly allowance — not to mention the fact that it might not have worked at all.

I’m fortunate that I can download things at the office (unmetered DSL) and bring them home on my MacBook Air. I am assuming/hoping there will be some way to download Lion once and install it on multiple computers. I am also assuming there will be some way to do a “clean install” onto a new hard drive without having to install Snow Leopard 10.6.8 first.

June 16, 2011
Twitter for iPad’s terrible Direct Message UI

Twitter, inc. purchased Tweetie, which was considered to be the best looking Twitter application for the iPhone.

Unfortunately, they haven’t done much good with their purchase. The official Twitter iPhone client added the universally-loathed trending topic bar, and then removed it after loud public outcry.

The UI for the official Twitter iPad client is a nightmare. It has improved a little since its initial release, but it still reeks of an overdeveloped attempt at being clever and innovative.

Whereas Tweetie broke new ground with ideas such as “Pull To Refresh” (which now seems so natural as to be obvious, and has been often copied), Twitter for iPad’s UI contributions are much more of a warning for what others should not do. (Have you seen anyone copy anything from Twitter for iPad’s UI? I haven’t.)

Here’s just one example. This is what it looks like when you try to send a Direct Message (DM) to someone:

[Screenshot of Twitter for iPad's DM UI

What’s with all of that empty space? It’s completely wasted.1

I can’t see all of the message that I have typed.

And — most astoundingly — there is no character count.

If you know the least little bit of about Twitter, you know that messages are limited to 140 characters. That includes DMs.2

There’s no character count. So how do you know if your message is too long? Exactly.

Some times you can spend so much time trying to be creative that you forget the basics.

Yet another reason why I use Twitterrific as my default client. I Only have the official Twitter iPad client installed for push notifications.


  1. I believe that space is used to show previous recent messages, if there are any. However, as you can see, there aren’t always previous messages to show. And even if there were, that still doesn’t excuse the fact that there’s no character count or that I can’t see all of the message that I have typed. 

  2. although in the past you could send much larger DMs, they have enforced the 140 character limit for some time now. 

June 16, 2011
TextExpander shell-script template

In my previous post I mentioned that I have a TextExpander shortcut which creates the basic format for me. I trigger it with ‘/ss’ (an un-creatively shortcut for “shell script”):

Here is an example of what it creates:

#!/bin/bash
#
#   Author: Timothy J. Luoma
#   Email:  luomat at gmail dot com
#   Date:   2011-06-16
#
#   Purpose: 

SOURCE="${HOME}/.source"

if [ -r "${SOURCE}" ]
then
    . "${SOURCE}"
else
    echo "$0: no ${SOURCE} found"
fi




exit 0
# EOF

But the TextExpander shortcut is this:

#!/bin/bash
#
#   Author: Timothy J. Luoma
#   Email:  luomat at gmail dot com
#   Date:   %Y-%m-%d
#
#   Purpose: %fill:name%

SOURCE="${HOME}/.source"

if [ -r "${SOURCE}" ]
then
    . "${SOURCE}"
else
    echo "$0: no ${SOURCE} found"
fi

%|


exit 0
# EOF

Note the place-holder for the date which automatically fills in today’s year-month-day, as well as %fill:name% which prompts me to put in a description of what the script does. Here’s what it looks like when I trigger it:

That reminds me to write a summary for it, which is helpful when I go back later and wonder “Now why did I write this?” It also means that I can fgrep for ‘Purpose: ’ in my ~/bin/ which can help me find the script I’m looking for if I can’t remember what I called it.

The %| tells TextExpander where to put the cursor where I can start writing the actual script. (I used to have it go to the “Purpose” line, but then I realized it was easier to use the ‘fill’ feature so I didn’t have to down-arrow past the dot-source block.)

What’s the point of the .source file? I explained that in my previous post.

June 1, 2011
Launch Mac apps at specific days or times

OS X’s launchd can be used to launch certain apps at a certain time, or certain day and time.

Let’s say that you want to review your calendar every day at 4:00 p.m. I use BusyCal but you can replace it with iCal if you wish:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.luomat.busycal</string>
    <key>ProgramArguments</key>
    <array>
        <string>open</string>
        <string>-a</string>
        <string>BusyCal</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>16</integer>
        <key>Minute</key>
        <integer>0</integer>
    </dict>
</dict>
</plist>

Or if you want to run Tumblr Backup every Monday at 11:35 a.m.:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.luomat.tumblrbackup</string>
    <key>ProgramArguments</key>
    <array>
        <string>open</string>
        <string>-a</string>
        <string>Tumblr Backup</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>11</integer>
        <key>Minute</key>
        <integer>35</integer>
        <key>Weekday</key>
        <integer>1</integer>
    </dict>
</dict>
</plist>

By the way, I highly recommend Lingon ($5, Mac App Store) for making/editing launchd files. put them into ~/Library/LaunchAgents/ and use “launchctl load whatever.the.name.plist”

You can download the two plists mentioned above here:

to use as example files.

(Be sure to remove the .txt from the filenames after you download them.)

May 27, 2011
Create a Fluid Browser for 5by5 Podcasts

ShortURL for this page: http://luo.ma/5x5fluid

I&#8217;ve been using the heck out of Fluid.app.  I definitely recommend getting the $5 version for the &#8220;Create Fluid Apps with Separate Cookie Storage&#8221; feature alone, but you can use the free version if you want. I&#8217;ll occasionally post how I&#8217;ve been using Fluid.

I love Dan Benjamin&#8217;s 5 By 5 podcasts, and I often find myself on Twitter when I see that a show is &#8220;live&#8221; and I want to listen to it.



Now I could just open that in my regular browser, but I&#8217;d much rather open it in a separate browser. Why? In case my browser crashes, or in case the 5-by-5 stream crashes, etc.

Also, I want to open not only the live feed, but also the IRC channel.

Fluid lets me do that.

~  Create and configure the Fluid app ~

The image above shows the basics: use the http://5by5.tv/live URL, name it (whatever you want), put it in /Applications/, and use the website&#8217;s favicon for the app icon.

A few seconds later, it will offer to open the new browser. Now you have a few more settings to configure in the &#8220;5-by-5.app&#8221; preferences.

The first is Behavior Preferences:



These are the most important settings.

&#8220;Closing the last browser window only hides the window&#8221; means that if you accidentally close the window while you are listening to the show, it will still keep playing! This works fine for me, because when I am done listening, I plan to quit the app.
(Pro-tip: To get the window back is double-click on the app icon in the dock.)

&#8220;On startup [x] restore windows and tabs from last time&#8221; means that if you open the live stream and chat URLs, they will re-open next time you launch the app. Nifty!
(Assign other preferences however you want.)

The second is Security Preferences:



Web Content: [x] enable plugins because you want to listen to the stream, right? 
Now, instead of going completely Flash-less on my computer, I have decided that I will install it because some apps work better with it installed, but in Safari (my default browser), plugins are disabled. This hardly ever presents a problem to me, but since I will always want the plug-ins enabled when I listen to 5-by-5, it makes sense to check that box.

The other settings are all optional. (Note the cookie storage is the &#8220;advanced&#8221; feature.)

~ Menu Bar (Advanced Option) ~

If you have paid the $5 for Fluid.app, you can make Fluid.apps in your menu bar. There&#8217;s a &#8220;Pin to Status Bar&#8221; menu option under the app menu. If you select it, you will be prompted to make sure you know what you are doing (and how to un-do it):



Making it into a menu bar item means that it won&#8217;t appear in the dock or in the command-tab app switching list. That may either be what you want or what you don&#8217;t want.

The advantage is that you can click on the status bar item, open the /live page, start the feed, and then it goes away. All you&#8217;ll see is a little 5 by 5 icon in the menu bar. (This is especially handy if you don&#8217;t care about joining the chat, but do want to be able to quickly launch the live show at any time.)

~ Choosy (Really Advanced Option) ~

If you start making a lot of Fluid.apps, you&#8217;re going to want to checkout Choosy which will make it easy to automatically launch the browser that you want for certain sites.

Here&#8217;s my Choosy rule to make sure that if I click on a link to http://5by5.tv/live in a Twitter client or anywhere (except another browser), it will open my 5 by 5 browser:



You could change it to say &#8220;anytime I click on any link to 5by5.tv, use my 5-by-5.app:

Create a Fluid Browser for 5by5 Podcasts

ShortURL for this page: http://luo.ma/5x5fluid

I’ve been using the heck out of Fluid.app. I definitely recommend getting the $5 version for the “Create Fluid Apps with Separate Cookie Storage” feature alone, but you can use the free version if you want. I’ll occasionally post how I’ve been using Fluid.

I love Dan Benjamin’s 5 By 5 podcasts, and I often find myself on Twitter when I see that a show is “live” and I want to listen to it.

Now I could just open that in my regular browser, but I’d much rather open it in a separate browser. Why? In case my browser crashes, or in case the 5-by-5 stream crashes, etc.

Also, I want to open not only the live feed, but also the IRC channel.

Fluid lets me do that.

~ Create and configure the Fluid app ~

The image above shows the basics: use the http://5by5.tv/live URL, name it (whatever you want), put it in /Applications/, and use the website’s favicon for the app icon.

A few seconds later, it will offer to open the new browser. Now you have a few more settings to configure in the “5-by-5.app” preferences.

The first is Behavior Preferences:

These are the most important settings.

  1. “Closing the last browser window only hides the window” means that if you accidentally close the window while you are listening to the show, it will still keep playing! This works fine for me, because when I am done listening, I plan to quit the app.

(Pro-tip: To get the window back is double-click on the app icon in the dock.)

  1. “On startup [x] restore windows and tabs from last time” means that if you open the live stream and chat URLs, they will re-open next time you launch the app. Nifty!

(Assign other preferences however you want.)

The second is Security Preferences:

  1. Web Content: [x] enable plugins because you want to listen to the stream, right?

Now, instead of going completely Flash-less on my computer, I have decided that I will install it because some apps work better with it installed, but in Safari (my default browser), plugins are disabled. This hardly ever presents a problem to me, but since I will always want the plug-ins enabled when I listen to 5-by-5, it makes sense to check that box.

The other settings are all optional. (Note the cookie storage is the “advanced” feature.)

~ Menu Bar (Advanced Option) ~

If you have paid the $5 for Fluid.app, you can make Fluid.apps in your menu bar. There’s a “Pin to Status Bar” menu option under the app menu. If you select it, you will be prompted to make sure you know what you are doing (and how to un-do it):

Making it into a menu bar item means that it won’t appear in the dock or in the command-tab app switching list. That may either be what you want or what you don’t want.

The advantage is that you can click on the status bar item, open the /live page, start the feed, and then it goes away. All you’ll see is a little 5 by 5 icon in the menu bar. (This is especially handy if you don’t care about joining the chat, but do want to be able to quickly launch the live show at any time.)

~ Choosy (Really Advanced Option) ~

If you start making a lot of Fluid.apps, you’re going to want to checkout Choosy which will make it easy to automatically launch the browser that you want for certain sites.

Here’s my Choosy rule to make sure that if I click on a link to http://5by5.tv/live in a Twitter client or anywhere (except another browser), it will open my 5 by 5 browser:

You could change it to say “anytime I click on any link to 5by5.tv, use my 5-by-5.app:

May 23, 2011
Keyboard Maestro is one of those programs that I&#8217;ve heard about for a long time, but only recently started to use it.

It is also one of those apps which is difficult to explain to people who don&#8217;t use it.

Even I wasn&#8217;t sure how I would use it, and purchased it only as part of one of those &#8220;app bundles&#8221; that have become popular in the past few years.

I hope to post a series of short posts for how I use it (and other apps) as those uses become obvious to me.

~ Saying &#8216;yes&#8217; repeatedly ~

I decided that I want to start syncing my iPad to my MacBook Air (which I almost always have with me) instead of my iMac, which obviously does not travel as often, or as well.

I did this by copying my &#8220;Mobile Applications&#8221; folder from my iMac to my MacBook Air using Transmit, and then adding the contents to the &#8220;~/Music/iTunes/iTunes Media/Automatically Add to iTunes&#8221;

This lead to a number of prompts like this one:



Each one of these prompts had to be answered before the process would continue. Over, and over, and over again.

~ Enter Keyboard Maestro ~

I solved this problem by creating a &#8220;macro&#8221; in Keyboard Maestro. You can see it above, but simply put it says:


  For as long as iTunes is active, press the button &#8220;Don’t Replace&#8221; every second, and don&#8217;t stop if you can&#8217;t find the button to push.


I enabled the macro, and switched over to iTunes. Sure enough, the prompt appeared, and disappeared… and appeared, and disappeared. Over and over again until it was all finished.

Why did I tell it not to stop if it didn&#8217;t find the button to push? Because sometimes it took a little longer, and sometimes a littler shorter, for it to appear. In a way, this was inefficient, since it kept running even after it was done, but the machine wasn&#8217;t doing anything else at the time, and I couldn&#8217;t use it anyway, because iTunes had to be in front for me to answer its continued prompts. 1

n.b. Note that I had to be sure to use &#8220;Don’t&#8221; instead of &#8220;Don&#8217;t&#8221; (note the difference between &#8217; and ’ which is crucial to Keyboard Maestro&#8217;s success).

While it did this, I went to breakfast at a local diner. When I came back, it was finished. I switched over the Keyboard Maestro, disabled the macro, and went into iTunes.

And just like that, my computer worked for me, instead of me having to work for my computer.



iTunes appears to have a bug when adding iOS apps via the &#8220;Automatically Add to iTunes&#8221; folder. When you click &#8220;Don&#8217;t Replace&#8221; iTunes leaves the .ipa file in &#8220;~/Music/iTunes/iTunes Media/Automatically Add to iTunes&#8221; instead of moving it to a &#8220;Not Added&#8221; subfolder, like it does for music files. This caused iTunes to prompt me to replace the same apps over and over again, until it finally stopped (I&#8217;m not sure what made it stop, but it did.) Hopefully this is a bug which will be fixed in a later version of iTunes. ↩

Keyboard Maestro is one of those programs that I’ve heard about for a long time, but only recently started to use it.

It is also one of those apps which is difficult to explain to people who don’t use it.

Even I wasn’t sure how I would use it, and purchased it only as part of one of those “app bundles” that have become popular in the past few years.

I hope to post a series of short posts for how I use it (and other apps) as those uses become obvious to me.

~ Saying ‘yes’ repeatedly ~

I decided that I want to start syncing my iPad to my MacBook Air (which I almost always have with me) instead of my iMac, which obviously does not travel as often, or as well.

I did this by copying my “Mobile Applications” folder from my iMac to my MacBook Air using Transmit, and then adding the contents to the “~/Music/iTunes/iTunes Media/Automatically Add to iTunes”

This lead to a number of prompts like this one:

Each one of these prompts had to be answered before the process would continue. Over, and over, and over again.

~ Enter Keyboard Maestro ~

I solved this problem by creating a “macro” in Keyboard Maestro. You can see it above, but simply put it says:

For as long as iTunes is active, press the button “Don’t Replace” every second, and don’t stop if you can’t find the button to push.

I enabled the macro, and switched over to iTunes. Sure enough, the prompt appeared, and disappeared… and appeared, and disappeared. Over and over again until it was all finished.

Why did I tell it not to stop if it didn’t find the button to push? Because sometimes it took a little longer, and sometimes a littler shorter, for it to appear. In a way, this was inefficient, since it kept running even after it was done, but the machine wasn’t doing anything else at the time, and I couldn’t use it anyway, because iTunes had to be in front for me to answer its continued prompts. 1

n.b. Note that I had to be sure to use “Don’t” instead of “Don’t” (note the difference between ’ and ’ which is crucial to Keyboard Maestro’s success).

While it did this, I went to breakfast at a local diner. When I came back, it was finished. I switched over the Keyboard Maestro, disabled the macro, and went into iTunes.

And just like that, my computer worked for me, instead of me having to work for my computer.


  1. iTunes appears to have a bug when adding iOS apps via the “Automatically Add to iTunes” folder. When you click “Don’t Replace” iTunes leaves the .ipa file in “~/Music/iTunes/iTunes Media/Automatically Add to iTunes” instead of moving it to a “Not Added” subfolder, like it does for music files. This caused iTunes to prompt me to replace the same apps over and over again, until it finally stopped (I’m not sure what made it stop, but it did.) Hopefully this is a bug which will be fixed in a later version of iTunes. 

May 21, 2011

catchmeadaydream asked: hi I need your advice. Im planning to upgrade my mac but Im confused if I should go for Mac's Snow Leopard or just wait for Lion?

At this point it probably makes more sense to wait for Lion, which is supposed to be out “this summer.”

Although I should mention that when Apple refers to a “season” they often mean the last day of that season.

UPDATE: (2011-06-06) According to Apple, you will have to be running Snow Leopard to upgrade to Lion. So if you are not yet running Snow Leopard, now is the time to get it.

Amazon shows it backordered 2-5 weeks: http://j.mp/kYZvuK

But Apple Store has it: http://j.mp/jLcRGP (US$29 plus shipping)

April 28, 2011
Bad timing and bad grammar

We are [redacted], a developer for iOS devices and we have been working diligently to provide an app for IT and Networking professionals that is simplistic and powerful SSH client for iPhone and iPad.

Bad timing: Panic just released Prompt for $5 which means you are now competing with a well-known Mac development company.

Bad grammar: The word you wanted was “simple” not “simplistic” which has a negative connotation:

“treating complex issues and problems as if they were much simpler than they really are : simplistic solutions.”

Never use a fancy word when a simpler one will suffice.

April 6, 2011
Sometimes it takes awhile to &#8220;get&#8221; a piece of software, to understand how it fits into your workflow.

That was my experience with Keyboard Maestro, which I picked up in one of those software bundles. At first, I didn&#8217;t know what I would use it for, but as I&#8217;ve used it more often, I&#8217;ve found more ways to use it.

Here&#8217;s just the latest example, and it&#8217;s a relatively minor one: &#8220;When Microsoft Word is active, &#8216;save&#8217; every minute.&#8221;

(If you don&#8217;t use/like Microsoft Word, replace it with Pages, or TextEdit, or whatever program that you work in.)

Now, I&#8217;m fairly obsessive about hitting &#8220;Save&#8221; frequently, but I bet everyone reading this has had the experience of getting into a groove while writing or working on some project, when suddenly the computer crashed, or the program crashed, or it simply locked up.

With this Keyboard Maestro macro, I won&#8217;t ever have to worry about losing more than 1 minute&#8217;s worth of work. It will automatically save for me every minute.

Note: I seem to remember that some applications won&#8217;t allow you to &#8216;undo&#8217; after a save. Word allows undo after save, but you should check your application and consider whether or not that is an issue for you. I save to Dropbox, which keeps previous versions for 30 days (longer if you pay for their &#8216;packrat&#8217; service). I consider Dropbox my &#8220;Undo&#8221; for major changes.

Sometimes it takes awhile to “get” a piece of software, to understand how it fits into your workflow.

That was my experience with Keyboard Maestro, which I picked up in one of those software bundles. At first, I didn’t know what I would use it for, but as I’ve used it more often, I’ve found more ways to use it.

Here’s just the latest example, and it’s a relatively minor one: “When Microsoft Word is active, ‘save’ every minute.”

(If you don’t use/like Microsoft Word, replace it with Pages, or TextEdit, or whatever program that you work in.)

Now, I’m fairly obsessive about hitting “Save” frequently, but I bet everyone reading this has had the experience of getting into a groove while writing or working on some project, when suddenly the computer crashed, or the program crashed, or it simply locked up.

With this Keyboard Maestro macro, I won’t ever have to worry about losing more than 1 minute’s worth of work. It will automatically save for me every minute.

Note: I seem to remember that some applications won’t allow you to ‘undo’ after a save. Word allows undo after save, but you should check your application and consider whether or not that is an issue for you. I save to Dropbox, which keeps previous versions for 30 days (longer if you pay for their ‘packrat’ service). I consider Dropbox my “Undo” for major changes.

March 17, 2011
Automatically forward email from Gmail to Yahoo

Over at ManageMyLife.com a reader asked how to forward email from Gmail to Yahoo.

To forward email from Gmail to Yahoo (or anywhere else) you have to access your Gmail mail settings.

A link to this can be found at the top-right of your Gmail or Google Apps account. If you see a “Gear” icon next to your name, click it to reveal the “Mail settings” in the drop-down.

An older layout showed settings in a list which went across the top of the page. This is still in use for Google Apps accounts:

Whichever way you get there, the next screen will look like this, showing you several “tabs” of different settings, you want the one for “Forwarding and POP/IMAP”:

If your Yahoo address is not already know to Gmail, you will have to add it.

Check the drop-down list next to “Forward a copy of incoming mail to” and look for your Yahoo address. If it isn’t there, click the button “Add a forwarding address”:

Enter your Yahoo email address. You will be sent a confirmation code. Enter it in the “verify” field which will appear after you have added the new address.

Tell Gmail to forward all new mail to Yahoo:

Once you have verified it, you can choose “Forward a copy of incoming mail to” (and then select the Yahoo address in the drop-down box) and then you have to decide what you want to do with the copy at Gmail. You can:

  1. keep Gmail copy in the Inbox
  2. mark Gmail’s copy as read
  3. archive Gmail’s copy
  4. delete Gmail’s copy

Choose #1 if you want Gmail to ignore the fact that you are forwarding your mail to Yahoo and continue to act normally.

Choose #3 if you don’t want to see messages that you have forwarded in Gmail’s Inbox.

Choose #4 if you want to delete them immediately.

My recommendation is to choose #2, which leaves the messages in Gmail’s Inbox, but marks them as “read” so you don’t end up seeing the same message twice. My reasoning for this is that if you ever forget that you are forwarding your email to Yahoo or if something goes wrong with it, it’s easier to see that new messages have been arriving.

So in the end it should look like this:

Note that Gmail may not forward a copy of a message from your Yahoo account back to your Yahoo account. This is a safety precaution to avoid “mail loops” which are very bad. So you may need to have someone else send you a message at your Gmail account to see if it is forwarded to your Yahoo account.

Also note that this will only apply to new email that arrives after you enable forwarding. Existing mail will not be forwarded.

March 15, 2011
Amazon One (Memorable, Shortened) Click Settings

I need to access my Amazon 1-click settings quite often, probably more often than most people (please don’t interpret that as some bizarre form of bragging, it’s nothing but a reflection of the oddity of my life).

I have different one-click settings for:

  • Buy with my personal Discover card, and ship to my office.
  • Buy with my personal Discover card, and ship to my home.
  • Buy with my work Visa card, and ship to my office.
  • Buy with my work Visa card, and ship to my home.

Plus about 6-8 more.

Most importantly, I buy some Kindle books which need to go on my work credit card, and some which need to go on my personal credit card.

You might think Amazon, which has long supported a few memorable custom links such as http://www.amazon.com/wheres-my-stuff would have included one for your 1-click settings, but you’d be wrong (at least, I can’t find one).

So I made my own: http://luo.ma/1click

(Amazon.co.uk users: http://bit.ly/1-Click is already setup for you, but all the other guesses for bit.ly short links that might go to Amazon’s 1-click led to other sites.)

ps - I’m using http://yourls.org/ for my personal link-shortening. It’s very simple to configure and use. And free!

March 9, 2011
Syncing Google Contacts and Mac OS X Addressbook

Mac OS X has a built-in method to sync its Address Book and Google. Open OS X’s Address Book.app and look in the preferences and you’ll see something like this:

OS X's Google Sync Preferences

You’ll notice it has a “Configure…” button. Don’t be fooled, it doesn’t do anything useful except let you enter your Google login information.

My experience with OS X’s built-in syncing is this: it’s not very good. It doesn’t follow any particular schedule that I can find, information is often duplicated or just plain screwed up.

(Update: Paul Straw reminded me that hidden away on a page in Google’s support is a note that says “Contact changes are synced when the iPhone and iPod Touch are synced, plus hourly on Mac OS X 10.6.” That’s the theory, at least. It didn’t seem to work that way for me.)

Most of this is Google’s fault. To begin with, Google’s contact list has no concept of “first” and “last” names. You just get a “name” field. I’m sure that sounded good to an engineer who spent too many hours behind a computer and not enough time in the real world, but despite people asking for changes for years, it hasn’t happened (last I checked).

I had my contact info screwed up too many times, or, even better, sometimes the sync seems to just stop happening altogether, even though the option is still set.

So I stopped using it.

Enter SpanningSync

SpanningSync has offered OS X and Google sync for several years, long before Apple built it into OS X. Yet they still exist. How can they compete with free? Easy: their solution doesn’t suck. It will sync calendars as well as contacts (although I don’t use Google Calendar so I can’t speak to that). They give you several options for how often you want to sync: 10, 30, or 60 minutes, or daily, or weekly.

Most importantly, they have this option, which is worth cost of the program all by itself:

Spanning Sync Preferences

In case it isn’t clear, this means “Sync my changes from OS X to Google, but don’t let Google’s damn dirty data corrupting ape hands anywhere near my Mac.”

The only reason I care about Google contacts is for Google Voice, and I make all my changes/additions/corrections through OS X’s address book, not Google, so this is the safer method for me.

Support Support Support

Here’s another important difference:

If you use OS X’s built-in contact sync, and something goes wrong, here’s who you should contact at Apple:

HAHAHHAHAHAHA… yeah right. Good luck with that. Might as well dial “1-800-google” and ask for them to help.

If you’re using SpanningSync and something goes wrong, you contact SpanningSync support. I bet you can even guess their email address. Here’s a hint, their domain name is “spanningsync.com.” They’ve been very helpful each time I’ve contacted them.

(In case you’re wondering: yes, it supports Google Apps as well as regular Google accounts.)

Cost

As you might have guessed, it’s not free. The service costs you $25/year or $65/lifetime. I grabbed the $65/lifetime deal a couple of years ago and have already saved money on the deal.

You can save $5 (on either plan) using this link (which is my referral code and pays me $5 too using their referral program.

If you have an objection to saving yourself $5, feel free to buy it directly through their store.

Bonus Tips and Suggestions

  1. If you are a MobileMe subscriber, use their free Backup program to backup your address book data every day.

  2. Make yourself a weekly (at least!) calendar reminder and do a manual export of your Address Book (Address Book » Export » Export vCard and Address Book » Export » Address Book Archive… — yes, I do both). Your address book data is almost as important and irreplaceable as your pictures.

  3. Get Spanning Sync’s Contacts Cleaner and run it before you start syncing anywhere. It will identify potential problems, help you merge duplicates, and make you taller. Ok, not taller. But definitely smarter. It’s only $5. The same $5 you’ll save if you signup through this link. They have other tools available but I haven’t tried them so I can’t vouch for them.

Referral Codes

Someday I’ll write a separate post about this, but since it applies here. I’ll mention it: I’ve noticed that many people have an irrational hatred/distrust of referral codes unlike anything I’ve seen since the early days of Internet hysteria over “cookies.”

I understand that people are afraid that they aren’t getting unbiased information, but anyone with a brain can tell the difference between someone whose website is littered with more referral programs than your average NASCAR vehicle, and someone who says “You know, I use this program, it’s worked for me, if you use this link, it helps me and/or you at no cost to you.

If you honestly think that I’m misrepresenting my opinions on that hope that maybe, just maybe I might someday earn back the purchase price of this software I bought, then you probably shouldn’t trust anything I write.