Skip to Content

Ask TUAW: AppleScripting coolness

ask tuaw videoIt's Tuesday Wednesday, which means it's time for Ask TUAW Video Edition. We've gotten great comments and questions coming in, and we have been trying to get to them all. Some of them are just too hard to show in a video format such as Ask TUAW, so today I have decided to do a little AppleScript "tutorial."

Here are 4 scripts that I use:

  • iTunes - this script will automatically play/pause my music
  • I'm back - will automatically make Adium go available, and start my music
  • Mail Announce - will announce who incoming mail is from (works with mail.app only)
  • Tell me a joke - tells a random joke

You can download the scripts here. Updated the download link at 5:30pm EST

As always leave us comments below or email us here.



Categories

Ask TUAW AppleScript

It's Tuesday Wednesday, which means it's time for Ask TUAW Video Edition. We've gotten great comments and questions coming in, and we...
 

Add a Comment

*0 / 3000 Character Maximum Comment Moderation Enabled. Your comment will appear after it is cleared by an editor.

21 Comments

Filter by:
marktatham

Justin. How can I attach the iTunes pause to a keystroke?

April 28 2011 at 11:31 AM Report abuse rate up rate down Reply
1 reply to marktatham's comment
Justin Esgar

Mark - you mean the iTunes script?

Use the keyboard system preference.

Directions are convoluted, but here: http://macdevcenter.com/mac/2007/06/08/hit-and-run-launching-applescripts-with-keyboard-shortcuts.html

April 28 2011 at 11:34 AM Report abuse rate up rate down Reply
pafoster

Had a look at Apple Script for the first time a few days ago but it went way over my head.

Just watched your video and now have Alex telling me I've new mail!

Thanks so much for this, you've given me the confidence to have another look at AppleScript!

PS: What screencast software are you using? Need to do some similar stuff soon and no idea what to use.

April 27 2011 at 6:16 PM Report abuse rate up rate down Reply
1 reply to pafoster's comment
Justin Esgar

Glad we got you back into it!!!

For screencasting we use ScreenFlow - it allows us to record the screen, myself and use my external mic to record my audio.

April 27 2011 at 9:31 PM Report abuse rate up rate down Reply
Jeff

I haven't used scripting since using Aspect on PcPlus WAY back when, and have totally overlooked AppleScript.
Rolling up my sleeves.
Thanks, man!

April 27 2011 at 4:50 PM Report abuse rate up rate down Reply
Jeff

Got it!
"To contains @"

Thanks!

April 27 2011 at 4:42 PM Report abuse rate up rate down Reply
1 reply to Jeff's comment
Justin Esgar

That works also.

Trick - if you use iVox you can use the editor to speak specific ways a certain way. So when my mother emails me from her aol account - it doesn't say her email address out loud, but does say her name. I set up the editor to say that momemail@aol.com is pronounced a certain way. :)

April 27 2011 at 4:44 PM Report abuse rate up rate down Reply
Jeff

Justin,
Just how does one set a rule for ALL incoming mail, regardless of recipient?
I am on mailing lists where my address is hidden.
Feeling stupid here.

April 27 2011 at 4:36 PM Report abuse rate up rate down Reply
1 reply to Jeff's comment
Justin Esgar

Jeff - depending on your version of Mail it might be different - but for me (on 10.6.7) I have it set to:

If ANY of the following conditions are met:
Account AccountName

Run AppleScript Location of Script


that help?

April 27 2011 at 4:39 PM Report abuse rate up rate down Reply
Patrik

Anyone have a working script that deletes movies and TV Shows that in iTunes is marked as watched? Both the file in iTunes and the file on the harddrive should be deleted.

April 27 2011 at 2:30 PM Report abuse rate up rate down Reply
dorjesyber

I love Apple Scripts. It was one of the best moves Apple made putting them back in AND giving them acess to the Accessible Items that vision or hearing support uses. In short anything you can tell the OS to do by voice command Apple Script can do as well.

I use UI Browser http://pfiddlesoft.com/uibrowser/ to find what elements of the OS or program is scriptable. Safari renders web pages in UI friendly so it can often be scripted for example.

April 27 2011 at 1:56 PM Report abuse rate up rate down Reply
Andy

I have been trying to find something for a while now... My itunes library lives on a mac mini and plays to airport express speakers around my house.

I use the iOS remote app to control this.

Can i control it from my macbook? I do sometimes use the inbuilt OSX screensharing to get in but this is a bit of a hassle as the mini is also running plex so I have to close that to find itunes and pick a song.

Basically I'm after the iOS remote app for mac! the ability to choose airplay speakers is essential!

Thanks,
Andy

April 27 2011 at 1:35 PM Report abuse rate up rate down Reply
Jeff

Neither iTunes, nor mailannounce, nor I'm back.
The joke one works (sorry, I failed to try that one before posting).
When I click run, nothing happens.

April 27 2011 at 1:30 PM Report abuse rate up rate down Reply
2 replies to Jeff's comment
Justin Esgar

Jeff -

itunes - will only work if iTunes is running. Launch iTunes - be on your music section and have it playing - then run the script - it will pause your iTunes.

MailAnnounce - it has to be loaded into mail.app - Add it as a rule that on all incoming mail to run script "mailannounce"

I'm back - only works with Adium - you can change it to iChat if you want.

Hope this helps.

April 27 2011 at 1:32 PM Report abuse rate up rate down Reply
Jeff

Aha!
Thanks Justin!

April 27 2011 at 1:40 PM Report abuse rate up rate down Reply
Kraven Craft

Apple has multiple voices on its OS, is there a way to chose which voice speaks?

April 27 2011 at 1:26 PM Report abuse rate up rate down Reply
Buy an ad here

Tweets

© 2012 AOL Inc. All Rights Reserved.