Showing posts with label Automator. Show all posts
Showing posts with label Automator. Show all posts

Wednesday, February 6, 2008

AstronomyPictureOfTheDay 3.0

I finally fixed one of the lingering "issues" I've had since migrating from Tiger to Leopard last month. Something in the Automator actions or other behavior changed in my AstronomyPictureOfTheDay app and every morning I have been greeted with 2 Safari windows. One is the usual window showing the description of the image downloaded that night, and the other is the local copy of the image. I don't need to see the latter, and it seemed a little sloppy so I wanted to fix it.

After some fiddling around with "View Results" actions I determined that the local filename was being added to the output chain by "Set the Desktop Picture". So where before I had a chain of actions that only sent the remote URL to the final "Show Web page" action, now I needed to filter the data. Throwing a variable into the mix did not solve the problem. I'm not sure how the variable is supposed to work -- it seems like it should replace the output instead of extending it. So I took the brute force option and inserted a shell script to filter the URLs before opening them.

So if you've been running an earlier version of AstronomyPictureOfTheDay under Leopard, grab the new one and give it a try. As usual, email me with any problems.

Tuesday, July 31, 2007

AstronomyPictureOfTheDay 2.0

There is a new release of AstronomyPictureOfTheDay available this morning. Version 2.0 is a substantial rewrite of the 1.1 version, but retains essentially the same functionality. The primary difference is that you no longer have to run a script to "personalize" it during installation. Now that it is distributed as an Application instead of an Automator workflow, you can just drag it to your Applications folder.

The source is still created with Automator, but some of the Finder actions for working with directories have been replaced by Shell Script actions to perform the same operations. The Finder actions are hard-coded to specific folder names, selected in the Automator UI when the action is configured. With a Shell Script action, I can use environment variables such as "$HOME" to make the action more flexible. Using variables also avoids the problem of having everything in the workflow tied to my own home directory, so that the paths needed to be modified before the workflow was usable by anyone else.

I could, of course, have written the entire program as a shell script, Python program, or whatever. But the point of building it with Automator in the first place was that it was easy. I suppose I am stretching the boundaries of where Automator is the easiest tool for this particular job, but at least now the hack is hidden inside the app instead of hanging out where everyone can see it in the installation instructions.

Tuesday, December 26, 2006

Astronomy Picture of the Day

I have been using an Automator workflow inspired by an article by Andy Ihnatko to download the latest image from the Astronomy Picture of the Day site and set it as my desktop background. It also adds a copy to my screen saver images folder. Some of the pictures are pretty, and some are inspiring.

Check it out, if you are interested.