Automator Walkthrough - Auto Save and Load Wallpaper


Every so often, I like to troll the archives of interfacelift for new wallpapers. It is a great site with plenty of interesting wallpapers and icons for your Mac. It even remembers your screen resolution so you can filter through only those wallpapers that fit your screen. I keep wallpaper images in a subfolder in my pictures folder. The problem is that once I find a good wallpaper there are a lot of clicks and drags involved getting the file into the wallpaper folder. No problem though. Automator to the rescue.

Step One - Start a new Custom Automator Project

Once Automator opens, start a "Custom" project.


Step Two - Tell Automator to get the Webpage

When you run this script, you'll already have the picture you want open in Safari. So the first step is to tell automator to get the current Webpage with the command, "Get Current Webpage from Safari" This can be found under the "Internet" category in Automator.


Step Three - Tell Automator to download the URLt

Next, Automator needs to download the URL to your wallpaper folder. This is done with the Automator action called "Download URLs" which can be found under the Internet tab. Drag it over and we are going to customize it.

Download urls.jpg

Specifically, you need to tell it where to put the wallpaper file. It defaults on the "Downloads" file but that isn't a good place for wallpaper. First click the selection arrows...

Download Desktop Pic-1.jpg

Then click "other" and find your wallpaper folder.

click other.jpg

At this point you could stop if you like. The Automator script will automatically grab your wallpaper and save it for you. I also wanted it to automatically load the file as my current wallpaper so I continued.

Step Four - Get Finder Item

In order to load the new wallpaper, Automator needs to select the file. Drag over "Get Specified Finder Items" from the Finder group.

Get Finder Item.jpg

Step Five - Load the Wallpaper

The final step is to take the selected file and load it into the desktop. There is an Automator task for this function called "Set the Desktop Picture" from the Finder group.

load desktop.jpg

That is it. Four simple actions will save lots of clicking and dragging for all wallpaper addicts.

Step Five - Save the Action

Automator gives you a variety of ways to save your scripts. I'm going to save this one as a plug-in to the script button in my menu bar so I can get to it easily.

save as plugin.png

Save as a "Finder Plug-in"

Finder plugin.jpg

And then it pops right out of your script menu and you are good to go.


Enjoy! If anyone comes up with any interesting tweaks to this action, let me know in the comments or email.

Macworld 2008 Sessions Online and Free

macworld video.jpg

I spent most of my time at Macworld connecting with friends and collecting promotional shirts from vendors. (I think I ended up with seven). I didn't register to attend any of the sessions except those on the show floor.

Well today I discovered that video for most (all?) of the sessions is now online for free at Macworld Encore. The presentations include the keynote slides and are very well done by some of the smartest people in the Mac community. I don't know when I'm going to find time, but I am definitely going to watch several of these.

Deleting Forward on Mac Laptops


One issue that baffled me when I first bought my MacBook Pro was the delete key. The delete key on the Mac laptops deletes backward as opposed to windows machines where it deletes forward. There is no forward delete button on Apple laptops. It took me a few weeks to figure out that if I hold the Function key and press delete, then it deletes forward. Apparently I was not the only person confused by this. Apple posted a small video on this issue right here.

Compacting Sparse Disk Images

A lot of you have seen my screencast on how to make an encrypted sparse disk image. As I explained in the screencast, sparse disk images grow when add files into them but don't shrink when you pull files out. As my sparse disk images used to bloat I would occaisionnally make a new one and copy the files into it and discard the old image. Recently however I discovered an automator workflow that compacts an existing sparse image without requiring you to take all those insane steps I used to. So lets walk through it now.

Step One ... Load Automator


Now some of you may be Automator veterans but for me it is just that funny looking icon I always pass over.

Step Two ... First Script

Compact Sparse Image 1.jpg

Click on the "Finder" category in the Library column then click and drag "Get Selected Finder Items" from the Actions Column into the work area of Automator.

Step Two ... Second Script

Compact Sparse Image-1.jpg

Click on the "Automator" category in the Library column then click and drag "Run Shell Script" from the Actions Column into the work area of Automator.

Step Three ... Change Pass Input

Compact Sparse Image-2.jpg

Change the "pass input" drop down from "to sdnin" to "as arguments"

Step Four ... Remove Text from the Shell Window

Compact Sparse Image-3.jpg

Step Five ... Fill in the Window

Compact Sparse Image-4.jpg

Type in the following in the window....

hdiutil compact "$@"

Step Six ... Save It

Go to Automator's File menu and "Save as Plug-in". Give it a name like "Compact Sparse Image". Also make sure "Plug-in for:" category says "Finder".


Using the Workflow

1. Find your sparse image in the finder.
2. Make sure it is unmounted
3. Cntrl(Right)-Click, Mouse down to Automator and run your script.

Now all of the above probably sounds like a lot of work but it really is not. Once you have it set up you can regularly compact your sparse images. Let me know if it works for you.

Technorati Tags:
, ,