Mimsy Were the Borogoves

Hacks: Articles about programming in Python, Perl, Swift, BASIC, and whatever else I happen to feel like hacking at.

42 Astoundingly Useful Scripts and Automations for the Macintosh

Work faster and more reliably. Add actions to the services menu and the menu bar, create drag-and-drop apps to make your Macintosh play music, roll dice, and talk. Create ASCII art from photos. There’s a script for that in 42 Astounding Scripts for the Macintosh.

Play music faster in the Music App

Jerry Stratton, September 11, 2020

Photos Scripts menu

Every app on macOS has a Scripts Folder, and you can open it from the scroll-iconed Scripts Menu in the menu bar.

When I updated 42 Astoundingly Useful Scripts and Automations for the Macintosh for Catalina, I removed this script. Its purpose was to speed podcast playback, and the Podcast app, in Catalina, has that ability built in. That made this script less useful and less astounding, so I removed it and replaced it with a backmasking script, that is, one that plays music backward to reveal hidden messages.

But I promised to make the speed playback script available, and here it is. You may find it useful if you’re still on Mojave or earlier, for example, and are still listening to podcasts through iTunes. Or you may just find it enjoyable to turn your favorite music into Alvin and the Chipmunks.

I’m not judging.

Much.

This is a very simple script. It takes the currently-playing (or currently-paused) track in iTunes, gets both the file location and the current play position, and then opens the track in QuickTime Player to start playback from that position at the higher speed. I have it set to play back 60% faster (1.6x). Change the preferredSpeed property at the top of the script if you prefer a different speed.

AppleScript Editor: Enable Script Menu

To enable the Scripts Menu, you’ll need to check the appropriate boxes in AppleScript Editor’s preferences.

Paste this code into AppleScript Editor and save it as “Speed Playback” in your iTunes Scripts Folder. It will appear in iTunes under the scroll-iconed script menu in the menu bar.

Here are the important variables in the scripts:

alreadyPlayedHow much of the track we’ve already listened to in iTunes.
preferredSpeedThe multiplier to playback speed.
trackLocationThe filepath to the track.

And here is the script code:

[toggle code]

  • -- Listen to iTunes tracks faster than normal
  • -- Jerry Stratton astoundingscripts.com
  • property preferredSpeed : 1.6
  • -- get path to file from iTunes, remembering the current position
  • tell application "iTunes"
    • pause
    • set alreadyPlayed to player position
    • tell current track
      • set trackLocation to location
      • set the played count to the played count + 1
      • set the played date to the current date
    • end tell
  • end tell
  • -- open the file in QuickTime, skipping past what we've already listened to
  • tell application "QuickTime Player"
    • open trackLocation
    • tell first document
      • set current time to alreadyPlayed
      • set rate to preferredSpeed
    • end tell
    • activate
  • end tell
  1. <- Battery lamp
  2. Catalina vs. Mojave ->