Run command in 30 minutes on Mac OS X and open eBay URL
at is a utility that you can use to schedule a task to run at a specific time. At is similiar to cron, the difference, at is used to run single jobs and cron is used to run re-occuring jobs.
at would be perfect for what I want to do *see article title. First a little background:
After missing a few eBay auction ends, I decided I needed a tool to remind me when it is ending. What I wanted was a simple countdown timer which would open a web page when the time is up, specifically the auction URL.
Widget
My first thought was to do it as a widget, a good chance to learn Apple's
new Dashboard product. After borrowing some example widgets to learn from
which weren't all that pretty; I discovered that Apple has
not documented it too well. I also discovered what I previously
learned developing Konfabulator widgets that HTML+JavaScript+CSS is not the
languages to write GUI applications in.
Square Peg meet Round Hole.
AppleScript
Since I knew my requirements were small and basic, I thought one
of those pull down AppleScript menu things would work well. I even
found an example in XCode for a Countdown Timer. However, the example
was an AppleScript application and not a script. After getting confused
by this I soon discovered that Apple does not document anything too well.
Or my way of learning doesn't jive with their way of documenting.
Python GUI App
Ok, time to turn to a language that I know, that is well documented and
that is easy to develop in: Python. As I was about to start whipping up a
quick Python app, it dawned on me the proper Unix way and that there is
already a little app setup to do this: at
at is really easy to use. Here's the basic syntax:
at> open http://ebay.com/
at> [EOL]
This would launch the web page that I wanted at 5:25pm. Nice easy, done. However, there is one big gigantic IF. If it actually worked on Mac OS X 10.4 Tiger. After many hours wasted and a lot of research I've discovered that Apple created a new program launcher called launchd, which replaces cron, xinit, at and a bunch of other utilities. Now they are all wrapped up in one spot, a little against the Unix way of small utilties that do their simple job; but eh... if it worked it wouldn't both me.
However, once again I discover Apple doesn't document things well. I did come across a nice snippet were the developer of launchd was asking people to submit their questions to him so he can write the documentation. This is of course after the launch, and nothing posted about how to use launchd in lieu of the applications it replaced.
So I go back to Python and write a dumb little script that solves this simple problem. Unfortunately, it is command-line and ties up a terminal screen while it runs but I'm still hopeful that I can get at working, so I don't want to waste too much more time on this.