Skip to Content

Free TUAW iPhone app -- try it now!
AOL Tech

Filed under: AppleScript

Filed under: Software, AppleScript

Sal Soghoian talks Automator use in education

Total Apps has published a nice guest post from Sal Soghoian, Apple's Production Manager for Automator, intended for teachers. He describes how educators have a limited amount of instruction time with the kids, and even less for maintenance tasks like making sure the proper software is installed, that students are on the proper web page, and so on.

Sal wants to help, and points out a number of links useful to anyone (not just teachers) who wants to automate these repetitive and often time-consuming tasks. Best of all, he shares a link to The Teacher's Helpers (scroll down a bit), which is a free collection of Automator actions specifically written to assist teachers with Macs in their classrooms.

If you've been put off by AppleScript, give Automator a try. Its drag-and-drop interface is much easier to use.

Filed under: How-tos, Tips and tricks, iTunes, AppleScript

Batch move your playlists to an iTunes folder

Folders, which have been a feature of iTunes since iTunes 5.0, serve as a means to better organize your music. For example, you could create genre- or artist-based folders with corresponding playlists nested within them. But moving playlists into folders isn't the most fun thing, and can be especially time consuming if you're going to be moving a bunch. Fortunately, the "Move Playlists to Folder" script provides a means for you to easily move multiple playlists over to a specified folder in iTunes.

First, download and install the script: the file should reside in your [username]/Library/iTunes/Scripts/ folder. After successful installation, the script will now appear as an item in the scripts menu. If you didn't already have any scripts installed, the script menu allows you to access and run scripts for a specific app.

This AppleScript, along with a host of many other iTunes script goodies, is available as a free download at Doug's Scripts. However, Doug would also be more than happy if you were generous enough to donate a buck or two to help buy him a latte.

Filed under: Software, Cool tools, Odds and ends, Freeware, Internet Tools, Developer, AppleScript

TweetMyMac: Remote control of your Mac via Twitter

Important safety tip: Please read the instructions for TweetMyMac carefully, especially the part about creating a separate Twitter account for your Mac -- do not use your regular Twitter account, or anyone you follow will be able to control your machine.

We have previously covered some of the ways in which it is possible to remotely control a Mac at home or in the office. Most of our suggestions have required the use of Mail in order to process some rule and kick off a script or Automator action.

Alex P over at TheMacBox aims to change all of that. Enter TweetMyMac, the little program that lets you get screenshots, iSight snapshots, or launch a program through the use of Twitter. While the list of commands available is not currently as comprehensive as what your imagination can create with a little AppleScript or Automator whizzbangery, it is a good list and growing as well.

An obvious benefit of this approach is the ease of getting everything set up. In the past it took an AppleScript to call another Automator action or some other kludgey-at-best method to get things working. With TweetMyMac there is very little effort required for setup.

Another neat feature is that TweetMyMac will run a shell command. With a little scripting you can create your own custom commands. And using the previously-covered technique of sending tweets via the command line you can have your custom commands send information back to you as well.

Continue readingTweetMyMac: Remote control of your Mac via Twitter

Filed under: Features, Productivity, AppleScript

Skype call recording with bookmarked, mind-mapped notes

I've been perfecting a very specific efficiency aspect of my workflow: taking notes during Skype calls. I use a Skype-in number as my primary phone number, and -- with permission -- record client calls for future reference. I can't tell you how many times this has come in handy. On long calls, though, going back and finding a specific point where something was mentioned can be a time-consuming hassle. What I wanted was the ability to record a Skype call while taking notes, and to then be able to reference my (abbreviated) notes back to the exact point where they were taken in the conversation.

I've played around extensively with doing this in Pear Note and Transcriva, and both work very well once you get the audio routing right (Soundflower is gold). However, I love taking my notes in a mind map format, and usually create a MindManager map before I start a call. This is especially valuable with long, long calls where keeping things organized and grouped on the fly as the conversation meanders and backtracks can be vital. So I donned my AppleScript hat and started seeing what I could do.

I'm using Audio Hijack Pro and Mindjet MindManager 7 Mac in these scripts. I had these readily available and they both have excellent AppleScript dictionaries, thus were conducive to satisfying my requirements. A little hacking could make these work with a variety of other applications. To set this up in Audio Hijack, I used the default Skype session and had my scripts check to see if we were recording, starting it up if we weren't. From that point, I could add quick bookmarks to my MindManager topics during the conversation. When I read back through my notes, I can instantly play back the associated part of the conversation. Read on to find out how I did it!

Continue readingSkype call recording with bookmarked, mind-mapped notes

Filed under: Software, Features, How-tos, Tips and tricks, Internet Tools, AppleScript

Use iCal to tweet automatically

Recently, the question came up of how to automatically "tweet" a birthday message to a friend or loved one on their special day. After thinking on this question for some time I finally came to a solution. As it turns out, intrepid TUAW blogger Dave Caolo wrote a Mac 101 article all about attaching AppleScripts to iCal events. Additionally, Brad Linder over at Download Squad put together a nice little tutorial for posting to Twitter via the command line.

It wasn't obvious at first, but these two articles together formed a dynamic duo of birthday tweeting proportions. If, dear reader, you are interested in setting up a system for sending out some birthday tweets then follow along as we travel the mysterious world of iCal events and command line tweeting. Read on for a somewhat technical tutorial on how to set up some pre-scheduled tweeting goodness. (If you're looking for a service to take care of all this for you, here you go.)

Continue readingUse iCal to tweet automatically

Filed under: How-tos, iTunes, AppleScript

Lyric fetchin' lovin': how to batch fetch lyrics with GimmeSomeTune and Needle Drop

One neat little thing about the iPod and iPhone family of devices is their ability to display lyrics -- supported by all iPod nanos as well as the iPhone/iPod touch, and iPod Classic 5th generation and higher. On the iPhone and iPod touch, lyrics show up when a song is loaded (and can be re-displayed by tapping on the screen while a song is playing); while on the iPod nano, pressing the center button several times while a song is playing will cycle you through to display lyrics.

But the real issue isn't so much about displaying lyrics as much as it is obtaining them. PearLyrics was once my tried and true favorite way of getting lyrics, but it passed away some time ago.

Continue readingLyric fetchin' lovin': how to batch fetch lyrics with GimmeSomeTune and Needle Drop

Filed under: How-tos, Podcasts, Apple, AppleScript

iTunes 101: How to prevent podcasts from spoiling

Like milk, podcasts will spoil if left unused for a period period of time -- at least in the mind of iTunes. iTunes will automatically unsubscribe from a podcast that hasn't been listened to within the last 5 updates, and more than 5 days have passed since an episode was played.

The rationale, as Apple states in the documentation for podcast providers, is to "minimize unnecessary bandwidth costs for both the user and the podcaster," as well as making it more likely that episode downloads align with the actual plays of the episode.

But I like the option of being current on all my podcasts, as well as being selective about which episode(s) I want to listen to. And being the rebel that I am -- using a two button mouse in 2001 while everyone else was still control-clicking -- this means that I will sometimes not listen to a podcast within these set parameters.

In the past, iTunes would keep me in check by forcing me to manually click on the exclamation mark next to each podcast to resume updating the podcast. Needless to say, this became a chore after the 10th click. You can also select all your podcasts, right-click and choose "Update Podcast" to force a global update, but why do three steps when AppleScript is there to reduce those to one?

iTunes will keep me in check no longer, as Doug Adams (of Doug's Scripts fame) provides a solution for this issue with his Update Expired Podcasts v2.0 AppleScript -- which batch updates each of your podcasts. You could even set up an iCal alarm that runs the script every day to force a fresh set of podcasts.

Update Expired Podcasts v2.0 (download link) is donationware, and is available for download at Doug's Applescripts for iTunes site (link). It's finger clickin' good.

Filed under: AppleScript, Snow Leopard

Snow Leopard offers more Automator "purrfection"



If you know me, then you know that I love Automator and scripting things on the Mac. I believe that Automator should be something that everyone can take advantage of, not just the select few that already know how to use it well. That's why I've been working on the TUAW Mac Automation and AppleScript series for over a year now (we're going to have more coming soon, so stay tuned).

I was watching the WWDC '09 keynote, desperately waiting to see if anything new was announced for Mac OS X 10.6 Snow Leopard in regards to automation, and specifically Automator.app. Nothing was said at the keynote, but when I looked on the newly updated Snow Leopard page on Apple's site, I was ecstatic. One of the refinements listed was that Mac OS X Services would now be a feature of Automator. Services let you use features of one application while you are inside of another. In the Automator instance, you would be able to use workflows while you are inside of any Mac OS X application that supports the use of Services.

In addition to updating Automator for Services, Apple has also added more starting points for workflows. You can now choose between a standard workflow, application, service, folder action, print plugin, iCal alarm, or an image capture plugin. We will have more information about Automator and Services in Snow Leopard when it launches in September.

Filed under: Features, How-tos, AppleScript

Mac Automation: Integrating Spotlight searches with your workflows

We've discussed some pretty neat uses for Automator workflows in the past, but did you know you can easily integrate Spotlight searches into your automation workflows? Well, you can, and it might be easier than you think. In this Mac Automation post, I'm going to show you how you can integrate it into a workflow that will burn the resulting files to a CD or DVD.

Creating the workflow
To create this simple workflow, you'll need to use two actions. Find the "Spotlight" action and drag it to your workflow section; then, find the "Burn a Disc" action and drag it below the newly added Spotlight action. That's it; your workflow is now completed, but we need to tweak the actions.

Using the workflow
To test the workflow, you can enter a search term in the Spotlight action, and a Disc name in the Burn a Disc action. Insert a rewritable disc, or a regular CD/DVD, and click the "Run" button in the upper right corner of the Automator window. Automator will then go to work finding all of the search terms that matched files, then will then burn all found items to the disc. This could take a while to burn, depending on the resulting files.

Remember that all of the Spotlight tricks, such as exclusion, denoting kind, etc. are still available even though you're using the Automator action.

Continue readingMac Automation: Integrating Spotlight searches with your workflows

Filed under: Features, How-tos, AppleScript

AppleScript: Exploring the power of Folder Actions, part III

So far in this AppleScript feature we've covered what folder actions are and how to create them. In this AppleScript post, I'm going to tell you how to create your own custom scripts and add them to your folder actions list.

If you work with file permissions a lot, then you know how crazy it can get when you need to change a ton of files to their correct permission types. With this AppleScript folder action, you can easily change the permissions just by dragging and dropping files in their correct folder.

Creating the Script
To get started, we'll open the Script Editor (located in /Applications/Utilities). Once you have the editor opened, copy/paste the following script:

on adding folder items to this_folder after receiving added_items
tell application "Finder"
set fold_name to the name of this_folder
try
repeat with i from 1 to number of items in added_items
set new_item to item i of added_items
set the item_path to the quoted form of the POSIX path of new_item
do shell script ("/bin/chmod -R +r " & item_path)
end repeat
end try
end tell
end adding folder items to

This script will change the dropped files to a permission of "0644" meaning that everyone can read the file. For information about chmod and command line permissions strings, visit the Wikipedia page.

Continue reading to learn more about this AppleScript and folder actions.

Continue readingAppleScript: Exploring the power of Folder Actions, part III

Filed under: Features, AppleScript

AppleScript: Exploring the power of Folder Actions, part II

In the last AppleScript post, I mentioned some of the useful ways to create Folder Actions, and showed you how to use one of the built-in scripts to perform a pretty useful action. In this AppleScript post, we'll dive into the built-in scripts in more detail, and I will tell you how each of them works.

Once you create a new folder action (as we did in the last tutorial), you will have a pop-up dialog asking if you would like to attach an Apple-created script. There should be around 13 preinstalled on your Mac. Now let's go through each of them, and see what they will do when attached:

Add-new item alert.scpt - This included script, which we covered in the last post, allows you to get a pop-up dialog upon dropping files in the attached folder. So, if you were to drop file x into the folder, a dialog would display a message that file x was just dropped in there. This script is great for networked folders, as you get a dialog when someone drops something in there.

Close-close sub-folders.scpt - This script will, when a file is dropped in the attached folder, close all opened Finder windows associated with that folder and subfolders. So, if you have that folder opened, or another subfolder within that folder, when you drop a file into it the script will close those opened Finder windows. You can use this script to tidy up your screen.

Convert-PostScript to PDF.scpt - If you have a PostScript file type (i.e. eps or ps files), then you can enable this folder action. When you drop a PostScript file on it there will be two folders created, one called "Original" and the other called "PDF." This folder action will take those PS files and turn them into PDFs for your instant viewing pleasure. You can use it in your workflow to easily convert from PS to PDF.

Read on to learn about even more built-in folder action scripts.

Continue readingAppleScript: Exploring the power of Folder Actions, part II

Filed under: Features, AppleScript

AppleScript: Exploring the power of Folder Actions, part I

Welcome to Part I of this mini AppleScript feature on creating useful folder actions. We'll have more posts on this topic coming up, but for now, let's introduce what a folder action is. Have you ever wanted to just drop a file into a folder and have something magically happen? Say, have a file printed, whisked to a remote site via FTP, or perhaps have an image be automatically flipped from horizontal to vertical? With Mac OS X's built-in folder actions, you can easily do this with a simple drag and drop.

Creating the folder
First, let's talk about how we can enable these "magical folders" that perform actions on files dropped within them. For this example, I'll show you how to make a folder on your desktop that, when a file gets dropped into it, will display a dialog letting your know that the file was placed there.

Continue readingAppleScript: Exploring the power of Folder Actions, part I

Filed under: Terminal Tips, AppleScript

Revisiting the randomized signature AppleScript, now with API goodness

When I shared an AppleScript last week which created randomized signatures using TextExpander, I promised to revisit it when the iheartquotes.com API started working again. It's working right now, but it seems to go up and down; check this link before you try the script and make sure you get a quote, not an error message.

As before, when used with a TextExpander snippet set to the AppleScript type, this script will provide a random quote, this time pulling it from the Internet rather than our own list. The script is essentially the same, so I'm only going to explain the part which changed; visit the previous article for a rundown on the rest:

set _date to do shell script ¬
"date +'Sent on %A, %b %d at %l:%M %p'|tr -s ' '"

set _quote to ""

try

set _quote to do shell script "curl -s \\
'http://www.iheartquotes.com/api/v1/random?source=macintosh&max_lines=4'"

set {astid, AppleScript's text item delimiters} ¬
to {AppleScript's text item delimiters, return}
set _quote to paragraphs 1 through -3 of _quote as string
set AppleScript's text item delimiters to astid

end try

set _out to "
-Brett

" & _date & "
________________________________
Brett Terpstra | myemailaddress@mywebsite.com
The Unofficial Apple Weblog | http://www.tuaw.com

" & _quote

return _out

The curl call

Here's the part which makes this more interesting than it was before:

set _quote to do shell script "curl -s \\
'http://www.iheartquotes.com/api/v1/random?source=macintosh&max_lines=4'"

First off, that really should be all one line, but is split here for formatting purposes. You can remove the double backslash (\\) and merge the lines together if you like. What this does is use AppleScript's ability to run shell scripts (Unix commands) to make a curl call to retrieve a response from the iheartquotes API. Note the "try" statement surrounding that section; it will just return our regular signature without the quote if anything goes wrong. If it gets a response, it stores it in a variable (_quote) and then trims off the last line, like this:

set {astid, AppleScript's text item delimiters} ¬
to {AppleScript's text item delimiters, return}
set _quote to paragraphs 1 through -3 of _quote as string
set AppleScript's text item delimiters to astid

The first two lines (actually one line) are shorthand for setting "AppleScript's text item delimiters" -- the character that AppleScript uses to separate text items in a block of text -- to the return character and store the current text item delimiter in a variable so we can restore it with the last line. Using the paragraphs command, which automatically uses the return key to separate paragraphs, we turn the quote into a list of paragraphs, starting with the first and ending with the third from last. This is because the last two "paragraphs" are always an empty line and a permalink (even if you use the API's parameters to turn off the permalink). The last part of that line, "as string", is where the text item delimiters come into play, putting the list items back together with a return after each one, reconstructing the original formatting.

Note: You could do the same thing by adding |sed -n '$!p' to the end of the do shell script line, right before the last double quote. I suppose you might as well, as long as you're dipping out to the shell anyway ...

From there it's the same as before, just building a final output string from the pieces we've created. This method provides a much wider variety of randomized signatures than constructing your own list by making use of a small section of the wide array of data on the interwebs. The use of curl in an AppleScript can open a lot of possibilities, such as posting to Twitter in various ways. or shortening urls on the fly. Have fun.

Filed under: Cool tools, TUAW Tips, AppleScript

Random Signatures with TextExpander and AppleScript

TextExpander, a $29.95US utility which inserts snippets of text or images when you type a preset string of characters, has long been a TUAW favorite. I only recently learned that it can run AppleScripts within a snippet, which opened up a world of fun for me. Here's a quick script demonstrating how AppleScript can be used to randomize quotes within your email signature.

Create a new TextExpander snippet and set the content type to "AppleScript." Copy and paste the code that follows into the snippet content box. I'll run through what it does in at the end.

Read on for the script!

Continue readingRandom Signatures with TextExpander and AppleScript

Filed under: Books, Developer, AppleScript

AppleScript 1-2-3 now available from Peachpit Press

Mac users rejoice! Santa brought just what you wanted, a new book about AppleScript by the two of the top wizards of the Mac automation world.

Apple's Product Manager for Automation, Sol Soghoian, and Bill Cheeseman, who is a noted developer in his own right, have announced the publication of AppleScript 1-2-3 by Peachpit Press. This book guides AppleScript newbies through an easy and enjoyable process of understanding how to use the Mac's automation language. Soghoian and Cheeseman based the book on ideas and scripts that have been used at hands-on seminars taught at Macworld Expo.

While the book can take someone with no prior knowledge of programming or AppleScript and turn them into a confident Mac automator, experienced scripters will find a lot to like about AppleScript 1-2-3 as well. The authors have made a copy of the first chapter available on the Apple AppleScript website. During Macworld Expo, the Peachpit website will feature a "tip of the day" from the book. The book will be available at the Peachpit booth as well (#812).

The book is available for pre-order now (US$44.99) through Peachpit, and will start appearing in bookstores in January. There's also an Adobe Reader version of the text that is available now (US$35.99) for download.

Tip of the Day

To get an instant map to any address, just go to your Address Book and right click on the address field of any one of your contacts and select "Map Of." The address will then be revealed in Google Maps on Safari. You can do the same if a data detector determines there is an address in an e-mail in Mail.


Follow us on Twitter!
 TUAW [Cafepress]

Featured Galleries

DNC Macs
Macworld 2008 Keynote
Macworld 2008 Build-up
Google Earth for iPhone
Podcaster
Storyist 2.0
AT&T Navigator Road Test
Bento for iPhone 1.0
Scrabble for iPhone
Tom Bihn Checkpoint Flyer Briefcase
Apple Vanity Plates
Apple booth Macworld 07
WorldVoice Radio
Quickoffice for iPhone 1.1.1
Daylite 3.9 Review
DiscPainter
Mariner Calc for iPhone
2009CupertinoBus
Crash Bandicoot Nitro Kart 3D
MLB.com At Bat 2009
Macworld Expo 2007 show floor

 

More Apple Analysis

AOL Radio TUAW on Stitcher