dougscripts.com

AppleScript

August 2 2007 - 9:20 am

UPDATED: Lossless to AAC Workflow v1.5

Because of the capacity and free space bugs I've mentioned recently, I had to update Lossless to AAC Workflow, which uses those properties to determine the free space on the iPod--well, not in this version. This is a collection of scripts that assists with importing/managing Apple Lossless audio files and sending converted AAC copies to iPod.

July 30 2007 - 1:20 pm

Hourly Newcasts - What I Do

I just released Play Hourly Newscasts which I've been working on for weeks; the things have gotta be tested in real time which takes hours a day when I have the time. ANYway, I've got a playlist I run everyday called "100 Songs or More". It's a Smart Playlist limited to 200 songs, live updated, selecting random songs according to various criteria. When nothing special is going on Around The House this is the playlist that plays pretty much all day (I work out of my house). I run one of the Newscast applets while this playlist is playing and every hour I get that newscast. Just like the way radio used to be before radio Program Directors decided news and music didn't mix.

July 30 2007 - 12:38 pm

UPDATED: Play Hourly Newscasts v1.2

The Play Hourly Newscasts download contains four script applets that each, respectively, download and play the latest AP NewsPulse, BBC Hourly World News Bulletin, CNN News Update, or NPR Hourly News Summary podcast episode when it becomes available enabling you to integrate an hourly newscast into your iTunes music listening throughout the day. This latest version consolidates the four applets into single download; streamlines routines.

July 28 2007 - 11:28 am

UPDATED: Rip To iPod v1.6

I have updated Rip To iPod to account for the free space/capacity AppleScript problem in iTunes I mentioned earlier. This script will rip each enabled (check-marked) CD track to iTunes and immediately copy it to iPod, delete the file, and remove the track from the iTunes library, giving the appearance of seamless CD-to-iPod importing. You can also change your encoder on-the-fly and your Preferences-set encoder will be restored after the rip.

July 27 2007 - 6:56 am

Capacity and Free Space Bug?

I haven't thoroughly investigated this, but I thought I'd put it out there. Using AppleScript you should be able to get the capacity and free space of a mounted iPod. These are two properties of source, along with kind. Thus, the result of this snippet should be a list of numbers representing the free space of each mounted iPod:

tell application "iTunes"
	get free space of every source whose kind is iPod
end tell

I get 0.0 each time. This is wrong, as my Video iPod has well over 12GB of free space. Likewise, I get 0.0 if I attempt to get thecapacity.

This occurs with iTunes 7.3.1 with the iPod I mentioned above. Because the rest of my family is currently away with their iPods, I was only able to test a second generation Mini with iTunes 7.1.1 and the snippet works; it does not work with iTunes 7.3.1. So I can only assume that it's not the iPod but iTunes. Regrettably, I do not know which version of iTunes this bug first appeared.

This affects a small number of AppleScripts, notably "Rip To iPod" which uses capacity and free space to determine if there is enough room on the iPod to copy ripped CD tracks. Because of this bug, it always reports that there is not enough room. I'll update "Rip To iPod" to work around this.

July 17 2007 - 1:20 pm

Get Lyrical Error

Chris Shull's "Get Lyrical" script -- v2.3 was posted yesterday -- apparently only retrieves lyrics for "Billie Jean" by Michael Jackson. I have contacted Chris about fixing it.

Update: Apparently there are some other problems with the script. After editing it myself to fix the "BJ" problem, I was unable to get correct lyric text for very many song selections. Again, I have notified Chris.

July 3 2007 - 1:40 pm

Proximity + iPhone

Proximity is an application (menu bar app, actually) that monitors the proximity of your mobile phone or other bluetooth device and executes custom AppleScripts when the device goes out of range or comes into range of your computer. Guess what? Couple of geniuses have written some example scripts for it that work in conjunction with iPhone.

July 2 2007 - 12:10 pm

iTunes Maintenance

Perhaps you change your car's oil on a regular schedule (you should). You pay bills on a regular schedule. Perhaps you have other household routines you schedule on a regular basis--cleaning bathroom, changing sheets, clipping the dog's nails, weeding the garden, Swiffering the computer desk, and so on.

How about tending to your iTunes music collection?

Many people who frequent this site are looking for AppleScript solutions that will instantaneously completely transform their un-tidy iTunes Library into a pristene-perfect Library of Congress-quality digital music collection. To the contrary, I've found that there's no need to try and get iTunes maintenance done in one fell swoop. If you take your time to manicure your iTunes music regularly you will not only avoid frustration but maybe get to know your collection better.

I spend only about a half-hour a week pruning, updating, re-tagging, deleting, Smart Playlisting.... Usually, the best time for me is on Saturday morning. Just after the second cup of tea and before my wife announces (decrees) the Weekend Activities. Here's my regimen:

  • Find duplicates - Using either iTunes' own "Show Duplicates" or Dupin, I assemble a list of possible duplicates. This assemblage contains the (so-called) "original" track and the (so-called) duplicate(s). I actually listen to a portion of each track, and/or check the bit rate and sample rate, and/or do a "Get Info", and/or check the file (using "Show In Finder", Command/R) to make sure which is the "original" and which is/are the "duplicate/s". Delete accordingly. (See iTunes Help Menu "Keyboard Shortcuts" on how to delete tracks/files from a playlist.) Remember, I don't check every track since I only have a half-hour on Saturday before wife says clean garage.
  • Check for empty tags - Do a sort by Album. Find tracks with blank albums. Do a sort by Artist. Find tracks with blank Artists. And so on with other tags. Correct, if necessary.
  • Check Artwork - I use artwork tool in TrackSift. Then I use Find Album Artwork with Google to locate artwork. Of course, you can always use iTunes own "Get Album Artwork" in the Advanced Menu.
  • Examine playlists - I'll often create temporary playlists (Smart and regular) and then forget about them. Now's the time to get rid of them.
  • Archive TV Shows and Movies - I subscribe to several TV Shows. When the season ended for "Ugly Betty" and "My Name Is Earl" I dumped the shows to DVDs and deleted the files from iTunes. Likewise, I delete episodes of "The Daily Show" after a couple of weeks; since they are so topical, unless there is a real keeper, they get deleted.
  • Always sort by Date Added - All my main libraries (Music, TV Shows, Audiobooks, and so on) are sorted by Date Added (newest on top) so I only have to scroll to the bottom to find out What The Deal Is. Archive 'em or delete 'em.

I certainly do other tasks which are me-specific, but the point is to do them regularly. Otherwise your library will almost certainly get out of control. Remember, you don't have to fix everything this Saturday. Take it one Saturday at a time.

July 2 2007 - 7:06 am

iTunes 7.3 - Bundled Apps

Last August, this article at Mac OS X Hints pointed out the differences between AppleScript Application and Application Bundles running on PPC and Intel Macs. At the time, I asked if Bundles displayed and worked correctly in iTunes' Script Menu on an Intel Mac--they did not. However, the original poster, Harry Dymond, just emailed me to let me know that iTunes 7.3 (and/or perhaps OS 10.4.10) resolves this issue.

June 30 2007 - 9:18 am

iTunes 7.3 - OSTypes Switched

A couple of Correspondents have noted that the OSType associated with the persistent ID property has changed to 'pPIS', which returns the persistent ID as a string. The previous OSType 'pPID' now returns a 64-bit number as in iTunes 7.1.1 and earlier. If you use raw Apple events to get this data then you may have to make some changes. (Thanks Milo and Manfred.)

Site contents © 2001 - 2024 (that's right: 2001) Doug Adams and weblished by Doug Adams. Contact support AT dougscripts DOT com. About.
All rights reserved. Privacy.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no direct affiliation with Apple, Inc.
The one who says "it cannot be done" should not be interrupting the one who is doing it.