
Continue reading to learn how to integrate shell scripts into AppleScripts.

If you use any applications with Cocoa-based text editors (TextEdit, Mail.app, and many more), you may have noticed that some of them, like Mail.app, recognize URLs and automatically turn them into links. The links are in Rich Text Format (RTF) and can be copied and pasted into other RTF-compatible text fields. To the best of my knowledge, though, there's no easy way to automate the creation of an RTF hyperlink, via AppleScript or other means. In programs that don't detect URLs, or if you want to link text to a URL, you generally have to select text, go to a menu item (Link..., Link Add..., etc.) that's a few submenus down, and then enter the url. Me? I'm always looking for the easy way out...
Continue reading Speedy creation of rich text links to Mail messages
One of the good things about the "very sweet solution" of iPhone development is that you don't need any special tools or too much knowhow to create neat applications-- if you know a little HTML, a little PHP, and have access to a text editor, you can come up with some pretty cool stuff. This tutorial from IBM's DeveloperWorks is about as simple as it gets, and yet it shows you how you can use your iPhone as a remote for iTunes, Keynote, or any other AppleScript-able applications on your Mac, with no jailbreakin' necessary.
The other day, I discussed how to record audio on your iPhone. Several people wrote in asking whether they could have their recordings show up in voicemail, so I scouted around a bit. I discovered that voicemail is stored in ~/Library/Voicemail and that it uses an sqlite3-compatible database to manage that information.
Last night, I put together a shell script that allows you to trick the iPhone into thinking that amr files added to the voicemail folder are actual voicemails. To make this happen, I ported sqlite3 to the iPhone (You can download a copy here). I also wrote a csh script, which you can download here and a time utility, here. The reason I wrote the script in csh rather than bash (both of which appear in the standard binary distribution kit) is just that I'm more familiar with csh.
To run the script, supply it with the amr file as its one argument, e.g. copy2vmail foo.amr. The script copies the amr file to the voicemail folder and updates the voicemail database as if the voicemail were received at the current time.
To force voicemail to update and re-read the database, enter the phone application and quit it by holding down the home button for 4-8 seconds. Re-enter the phone application and, with luck, you will see the recording as new voice message from "VoiceRecorder".
Thanks, Spaced.
Toxic Software's posted a useful little script if you spend any amount of time in Xcode-- because manopen is having trouble with Leopard, John punched up a shell/Applescript to open man pages directly from within Xcode's command line. It's tiny (and doesn't really do much-- just opens an Xcode Help menu item), but it seems useful-- straight from the command line, you can break out the man page within a GUI, and just keep right on coding.
Someone must have answered Rod Schmidt's call for AppleScripters, as he has just released PackRat 1.1, a major update to his offline Backpack syncing app that brings double-whammy support for both AppleScript and Automator. You can now get almost all your Backpack data via script, which means power users can do all sorts of extra-cool nerdy things now. A 'Synchronize with Backpack' Automator action is also included, offering easy access for the rest of us to set up auto-downloads in the morning or before we leave for a trip (hint: run the action as an app attached to an iCal event).
Have you ever wondered whether there was a command line way to check iTunes and determine which song is currently playing. The command-line osascript utility makes this an easy problem to solve. Osascript executes AppleScript commands from Terminal's command line and can run many of the same kinds of simple scripts you'd normally run in Script Editor. Here's a quick how-to to build a Now Playing command line utility. touch nowplayingopen -e nowplayingchmod 755 nowplaying./nowplayingThe script, when run, outputs the track name and artist.
% ./nowplaying
Now Playing: Everything I've Got - Iain Archer
%
Thanks Dave M
Update: For those of you who don't want to keep iTunes open:
#! /bin/bash
osascript -e 'tell application "System Events" to if ((name of processes) contains "iTunes") then do shell script ("osascript -e " & quoted form of ("tell application \"iTunes\" to if player state is playing then \"Now Playing: \" & name of current track & \" - \" & artist of current track" & ""))'
Rod Schmidt, developer of PackRat, has issued a call for AppleScripters who are interested in automating his rocking Backpack client. PackRat, to my knowledge, doesn't have AppleScript support yet, but that does seem to be at the top of the request list and would mark another powerful feature PackRat has over Backpack's own web UI: OS integration. I would love to be able to, for example, right-click some selected text in a Cocoa app and click "Send to PackRat," which would then sync up to Backpack all without me ever having to touch an actual webpage.
As I was working on an AppleScript-related post this morning, I couldn't seem to find any TUAW Tips in our vast archives that explained how to enable that AppleScript menubar item (pictured) that is mentioned so often in Mac software circles. This, of course, called for just such a tip.
Back in April we wrote about the public beta of Proxi, which is the easy-to-use scripting software from Griffin Technology. Proxi lets you automate complicated routines, much like Automator or QuicKeys. Earlier this week, Griffin released version 1.0 of Proxi.
FastScripts is a menubar script launcher on steroids. It offers
up everything the Apple version does, and a whole lot more. It also happens to cost $15, which is a fair price for the
application but some people might balk.
| # | Blogger | Posts | Cmts |
|---|---|---|---|
| 1 | Cory Bohon | 87 | 1 |
| 2 | Robert Palmer | 59 | 43 |
| 3 | Steven Sande | 56 | 23 |
| 4 | Mat Lu | 36 | 10 |
| 5 | Scott McNulty | 36 | 0 |
| 6 | Dave Caolo | 34 | 0 |
| 7 | Erica Sadun | 28 | 2 |
| 8 | Brett Terpstra | 21 | 0 |
| 9 | Mike Schramm | 18 | 2 |
| 10 | Michael Rose | 13 | 34 |
| 11 | Christina Warren | 9 | 38 |
| 12 | Joshua Ellis | 4 | 4 |
| 13 | Lisa Hoover | 2 | 6 |
| 14 | Chris Ullrich | 1 | 2 |
| 15 | Jason Clarke | 1 | 1 |
Other Weblogs Inc. Network blogs you might be interested in: