Archive for the ‘Advanced’ Category

Access Google Calendar from Terminal

Thursday, February 14th, 2008

gcalcliMurphy has been on the lookout for an easy way to use the Quick Add feature of Google Calendar, even when his calendar isn’t open in Safari or Firefox. There doesn’t seem to be a widget, but there is a Firefox plugin. Last time Murphy tried the plug-in there were some problems.

If you’re partial to the Terminal you might like gcalcli. Murphy uses gcalcli to make Quick Add entries from the tiny Terminal window he’s always got open. Simple, fast, convenient. He’s also using gcalcli with GeekTool to display calendar events right on the desktop, like the image you see above. (more…)

Watch Now

Select a Playlist by Email - And More

Sunday, February 3rd, 2008

Playlist by EmailI can see the comments now. “Why not just…” But let’s be patient and save judgements until you’ve read the whole post.

Yes, I know there are tons of ways to control iTunes from your iPhone or your touch or another computer or your fancy remote. (Murphy even dug up an old Pocket PC recently to try out Salling Clicker, which also supports BT phones) But there’s no harm in having yet another avenue for getting some music playing.

Murphy stumbled into a script that checks the content of an email for instructions on what to play in iTunes, like a playlist or an artist. But there’s more - just like the title of this post says. The script can also tell iTunes to play through external speakers via your Airport Express. That might not sound like much, but it is, because iTunes doesn’t provide the necessary hooks to control speaker selection. (more…)

Download Script

Creating icns Icon Files

Wednesday, January 9th, 2008

icns filesIn a previous screencast we used Photoshop to make an image suitable for a folder icon in Leopard. Now we’ll turn that Photoshop file into an icon and apply it to the Finder folder.

It’s probably more steps than you might have guessed, but it’s very straight-forward once you have all the tools in place. Murphy installed the Developer Tools from the Leopard install DVD which include a utility called Icon Composer. The first step is to drag the Photoshop file we created earlier into Icon Composer. The icon is created in various sizes appropriate for Leopard and we export to an icns file.

The catch is that the icns file doesn’t use its own icon content as its icon. That sounds confusing, but when you see the file you’ll know it’s not right. The background isn’t transparent. But that’s no problem. Just drop the icns file onto an application called IconDroplet. A new file will be created that uses the icns file’s content as the icon.

From there, the process may be familiar. Open the Get Info panel for the file created with IconDroplet. Select the tiny icon in the top left corner and hit Command-C on the keyboard to make a copy. Then open the Get Info Panel for a the folder or file that needs a new icon. Select its tiny icon and hit Command-V to paste it in. That’s it.

If you’re confused Murphy slapped a screencast together. For a general look at changing icons on files there’s an old post on the subject too. But keep in mind, using an icns file is the way to go for best results in different Finder views, like Cover Flow.

Watch Now

Schedule a Command without Cron

Thursday, January 3rd, 2008

cron alternateIf you only have a few minutes to schedule a job you might not feel like digging into cron for your kickoff tool - especially if you’ve never used it before. In fact, Apple is kind of discouraging the use of cron in favor of launchd these days.

If you came from Windows you might be happy to see OS X has the AT command you might be oh-so-familiar with. Until you realize Apple doesn’t really want you using that either. That’s a shame, because AT is quick and dirty and supports some simple syntax, like now + 3 hours, to set a time for kickoff. In fact, you can specify teatime as a time, which really means 4pm.

If you’re sleepy and want to schedule a job and you don’t want to mess around, iCal might be the answer. You can use the alarm feature of an appointment to run an Applescript. Just set the time and pick your script like you see in the picture.

cron alternative

Your script can be pretty simple. Something like the screenshot below should work. Just replace the text following “do script” in the double quotes with whatever your terminal needs require.

cron alternative

The articles linked above mention the downsides of cron and AT - mostly dealing with sleeping machines and hard drives that can’t rest because AT is frequently checking to see if it has anything to do. That’s why OS X doesn’t enable AT by default. If your machine will be sleeping when you need the command to run you can wake it up with the Energy Save in System Preferences.

No screencast for this one. If you want to shed any light on how you schedule your routine jobs let us know in the comments. As always, be careful with the Terminal. You can break something very easily!

More on Applescript

Exit Your SSH Session Without Killing Your Job

Monday, December 31st, 2007

screen commandMurphy loves this one. If you connect to a remote machine and kick off something like a file copy you have to stay connected to the remote machine for the job to complete. Unless you use the screen command, which lets you detach from the running session while your job chugs away.

This is great for a process that might take a long time to complete. Murphy can use his hacked ipod touch to ssh to a remote machine, tell it to start copying files, detach, then turn the touch off. The screen command will even let you reconnect to the remote machine to check the progress of the job.

In the screencast Murphy covers how to get screen going, and how to switch between active screens and close them down. There’s plenty of other information on screen if you look around.

With screen running you can hit CTRL-A and then a key to issue a screen command. For example, CTRL-A followed by D lets you detach from a screen without closing it. Murphy also uses CTRL-A followed by ” (double-quote key) to get a list of screens he can switch to. Follow the link above for more screen tips. Or take a look at the screencast.

Watch Now