dougscripts.com

Archive: September 2005

september 30 '05 - 12:00 am
New: Lyrics to Text Edit

If an AppleScript can save me from making even just a single click, you know I'm on it. While I'm not the most frequent user of the Lyrics tag, having to select a song, Command-I, and click the Lyrics Tab is too many clicks for me. Lyrics to TextEdit will display the lyrics of the current or selected track(s) in a new TextEdit document and bring TextEdit to the front. Give the thing a shortcut key (Command-Option-L works well at my house) and, voila: one-click lyrics access.

Missing Menu Commands Updated

I've added the script "Pretend We Played This Today" to the Missing Menu Commands page. Select some tracks and run this script; it will increase each selected track's play count and set its last played date to "now". See, I have a Smart Playlist that live updates to tracks not played in the last 8 weeks. If I see some songs I don't want in the playlist, I run this script on 'em and they vacate.

New: Artwork=1 BPM

Here's one I've been sitting on for a long time. There's no way for Smart Playlist criteria to detect if a track has artwork. So I wrote a script (for my own self) that set the BPM tag to "1" if selected tracks had artwork. Then I created a Smart Playlist that uses "BPM is 1" to pull in tracks with artwork. Duh. Today I get iChatted by a user who wanted to do something similar, so I had to own up to the script and thought I might as well post it. Artwork=1 BPM. Now, if you Really Use the BPM tag for Beats Per Minute then you don't want this script. But, if you're like me and see the BPM tag as superfluous, this is a great way to use it for Something Advantageous. It may also give you ideas for other BPM settings...sort of like a secondary Genre tag or something. Whatever. It's Friday.

september 29 '05 - 12:00 am
Updated: Import iPod Audio Files v1.9

Import iPod Audio Files has been updated to version 1.9. This script will allow you to select tracks on the iPod and import their files to your Music folder and iTunes library. This latest version streamlines the routine to locate your designated Music folder.

Some users have recently reported that this script will cease functioning after only one file is imported. I'd like to hear more about that if you experience the same problem.

System Events and Key Codes

Key codes are the numeric codes representing the keys on your keyboard. You can use these numbers to emulate key presses via AppleScript with "System Events", provided you also have the "Enable access for assistive devices" option checked in the "Universal Access" System Preference. Using these key codes, you can have AppleScript perform some shortcut actions, which, on occasion, may be more advantageous than scripting the actual action. Indeed, as far as iTunes is concerned, some of these shortcut actions aren't possible with AppleScript without using key codes. For instance, opening a Get Info Window or the View Options window. Here's an article describing how to get the most from key codes, AppleScript, and iTunes.

Popular Designation

Because I got bored today, I decided to attach a image to those scripts which have had 5000 or more downloads. This is an arbitrary number, since the total downloads of a script may not actually reflect its popularity, just how many times its various incarnations have been downloaded. But, like I said, I was bored.

september 28 '05 - 12:00 am
AppleScripts As Automator Plug-Ins

Just posted AppleScripts As Automator Plug-Ins, an article that briefly describes how to use Automator's "Run AppleScript" Action to create Plug-Ins which can be accessed from a Control-click in the Finder or via the Scripts Menu.

Latest Podcast Now Available

The latest edition of my podcast is now available. To subscribe, drag this link to you podcasting software. To subscribe via the iTunes Music Store, go here.

september 24 '05 - 12:00 am
Updated: Make UN-Bookmarkable v2.0

iTunes 5 has a simple way of making tracks "bookmarkable" with the "Remember playback position" option, and I had created Selected Tracks Bookmarkable to change this setting for selected files. Previous to iTunes 5, the "Make Bookmarkable" script served this purpose by changing a file's file type. Make UN-Bookmarkable has been updated to "un-do" either of these settings on the selected tracks.

september 23 '05 - 12:00 am
New: No Lyrics to Playlist

Correspondent Herwin Lans has submitted No Lyrics to Playlist which will copy tracks in the main library that don't have lyrics to a new playlist called "No Lyrics". The download also contains another script which will clear the "No Lyrics" playlist of tracks which you have added lyrics to.

Not Fer Nothin' But: Shuffle

I know Apple says they've made shuffle "more random" in iTunes 5.0.1 -- or less random, depending on how you view it -- but I still get separations between Artists as short as four or five songs even with the "Less Likely" slider maxxed to the right. An Option-click on the shuffle button once or five times tidies it up somewhat. I don't really care, actually. I know what "random" means, and if The Faces show up every few songs in a Smart Playlist set to live update songs not played in the last 8 weeks, well, I guess that's how it goes. Fact is, expecting Apple to accommodate our musical tastes is pretty much wishful thinking. Why be picky? iTunes can't network to the "Musical Taste" section of your brain; you can't expect a piece of software to know what you want to listen to; iTunes provides several ways of sculpting a playlist to your taste, but You Gotta Work On It. It Ain't Automatic and can't be.

Remember those old record changers? You'd drop five or six vinyl discs onto the changer (a disc from Elton John's "Goodbye Yellow Brick Road" always had to be included for some reason) and after a side played, the next disc dropped down. And I thought THAT was amazing. Ruined a lot of stylii due to the angle of the tonearm, but, MAN. Party music for hours.

We've come so far and people still aren't satisfied.

september 22 '05 - 12:00 am
Missing Menu Commands Page Updated

I've just updated the Missing Menu Commands page with a revised "Current Track to (Select Playlist)" and a new "Selected Tracks to (Select Playlist)". The latter evolved out of my frustration of selecting tracks in the main browser to copy to a playlist, and then having to scroll, page up and down, home, end and all that stuff in the Source column to get the target playlist in view, only to very often lose my selections. Don't forget to add Shortcut keys!

september 21 '05 - 12:00 am
Updated: Join Together v2.1

Despite iTunes 5.0.1 not fixing the multi-session bug, I have updated Join Together to version 2.1. This script will enable you to join the files of selected iTunes tracks together with Quick Time Pro and export them as a single AAC file/track. Optionally, with Apple's ChapterTool application installed, it will create a "chapterized" audio file of the exported AAC file.

This latest version supplies some timeout and error protection, restores the ability to concatenate MP3s of the same bit rate (though this type of file cannot be "chapterized), ensures files open in separate QuickTime Pro windows, prohibits the naming of the joined track using one of the selected tracks' names, and other code enhancements.

New: Create Archive of Selected

Create Archive of Selected will copy the files of the selected tracks to a new folder in a location you specify and create a .zip archive of the folder.

september 20 '05 - 12:00 am
New: Enter Category Text for Selected

iTunes 5 introduced a new "Category" track tag. Unfortunately, the tag does not appear in a track's Get Info window, even though it is editable. Enter Category Text for Selected will allow you to enter some text and have it appear in the Category tag for each of the selected tracks.

New: Delete Lyrics

Correspondent "weiriuc" came up with Delete Lyrics after some lyric-gathering software he was using grabbed the wrong lyrics. The script will clear the Lyrics tag of the selected tracks.

iTunes 5.0.1 Released

Apple has released iTunes 5.0.1. As of now (Tuesday afternoon) , it's only available from Software Update, but I imagine it will be available from Apple's iTunes download page shortly.

No fix for the infamous multi-edit session bug (audio files joined by QuickTime Pro using "Pass-Through" settings are incorrectly recognized by iTunes).

New: Enter Description Text for Selected

Hot on the heels of iTunes 5.0.1, Enter Description Text for Selected will allow you to enter text to the selected tracks' Description tag. There apparently was a bug in iTunes 5 that prohibited this.

New: Enter Long Description Text for Selected

And why not? Although the "Long Description" tag is not visible in iTunes, it is used by podcasters. So along with the other two scripts I posted today for Category and Description, here's Enter Long Description Text for Selected.

september 19 '05 - 12:00 am
Playlist Magazine Exclusives

Last week I made a collection of scripts available exclusively to visitors of Playlistmag.com. Just so ya know, these Playlist-exclusive scripts have been updated. So head over there and grab 'em while their hot! And while you're there, check out what else Playlist has to offer, why don't you?

september 16 '05 - 12:00 am
iTunes 5 Update Next Week?

C|NET is reporting that Apple plans an update to iTunes 5 next week.

september 15 '05 - 12:00 am
New: Art to iChat

There's probably a billion apps like this around, but after the rigors of working on "Join Together", it was just fun to make. Art to iChat will use the artwork of the currently playing iTunes track as your iChat's Buddy icon while your status is "Available". Your original Buddy icon will be restored on quit, or when your status changes to "Away", or when the current track doesn't contain artwork. I use it it conjunction with iChat 2.0's "Current iTunes Track" status message.

september 14 '05 - 12:00 am
Updated: Join Together v2.0

I have updated Join Together to version 2.0. This script applet will enable you to join the files of selected iTunes tracks together with Quick Time Pro and export them as a single AAC file/track. Optionally, with Apple's "ChapterTool" application installed, you can then create a "chapterized" audio file of the exported AAC file.

This latest version accepts any combination of MP3 or AAC tracks for joining and export as AAC with QTPro; exports from QTPro using AAC-LC settings, rather than the "Pass Through" settings used in previous versions; makes final track bookmarkable (requires iTunes 5 or better); converts European time formats for ChapterTool compatability, i.e: 12:34,5678 to 12:34.5678; adds option to supply Composer tag; other minor improvements.

As you may have read in my previous posts, iTunes 5 has trouble with files created with earlier versions of Join Together, whereby only the first of the joined files is recognized. I have been told to assume that this is a bug in iTunes 5, although this hasn't been completely confirmed. As a result, the script no longer uses the "Pass Through" Audio setting in QuickTime Pro, but enables you to select a specific bit rate. This increases the time it takes QTPro to export the final file, but it's a sure-thing that the final file will play correctly in iTunes 5.

Thanks to the many Correspondents who provided excellent feedback and encouragement!

september 9 '05 - 12:00 am
New: Get Lyrical

Well, I knew it wouldn't take long before someone came up with something like this. Chris Shull sent me Get Lyrical, a script that will use the track name and artist of the current or selected track as the basis for a lyric search of searchlyrics.org and store the result in the lyrics tag. iTunes 5 is required. Chris is going to continue improving it so look for updates soon.

So THAT's How They Did It

"The iPod nano is a sham. They haven't made the iPod smaller; they've made Steve Jobs much, much larger." Details.

On CD Insert

Correspondent Gary Wagman wants to know (as did I) where the heck the "On CD Insert" option went in iTunes 5 Preferences. It is now located under the "Importing" tab in the Advanced Preferences.

september 8 '05 - 12:00 am
New: Set Selected Tracks Shuffle

My friend Kirk McElhearn asked for a script that would batch-enable/disable the iTunes 5 "Skip when shuffling" option for the selected tracks. Set Selected Tracks Shuffle does so.

Paul Withey Maintains His Sense of Humor

Long-time Correspondent Paul Withey sent this along, calling it "Sing Along WIth Mac":

tell application "iTunes"
	if player state is playing then
		tell current track
			set TheLyrics to lyrics
			if TheLyrics is "" then return
		end tell
	end if
end tell
say TheLyrics

iTunes 5 only, of course. And you need to have lyrics in there.

Latest Progress on Join Together Bug

Since upgrading to iTunes 5, any files I created with my script "Join Together and Chapterize" play incorrectly. The effect is that only the first chapter is recognized. After investigating a little bit I have determined this:

- The selected files are joined correctly by QuickTime Pro. However, when the final joined file is exported with the "m4a" extension, iTunes 5 clearly does not recognize any portion of the file except the first file, whether the file has been "chapterized" or not.

- If the joined file is exported from QuickTime with a "mp4" extension, iTunes 5 recognizes it as a QuickTime Movie file and can access/play the entire file. However, if this "mp4" file is "chapterized", its format is set to AAC, and again, iTunes 5 does not recognize more than the first of the joined files.

I have tried various combinations of extensions but it always comes down to iTunes 5 not recognizing any more than the first of the joined files. My assumption is that iTunes 5 now is much more "fussy" about AAC files. I'll continue to investiagte the situation. Note that creating a "chapterized" file from a single AAC file still works; it's just that files joined and exported as MPEG4 from QuickTime Pro fail.

Join Together Also...

Hmmm. Some success with using new QuickTime Pro export settings. Rather than use "Pass Through", using actual AAC-LC settings seems to work. However, the export process takes an incredibly long time. More as it develops.

Hmm, QT 7.0.2 Released

Apple has released an update to QuickTime.

Progress on Join Together, Part 2

I was hopeful that the update to QTPro (7.0.2) would update some components that made "Join Together" files work in iTunes 5. But no dice. However, I have managed to get an updated version of "Join Together" to go and work correctly. Unfortunately, exporting AAC files from QTP takes a while. I had to create export file settings files for each bit rate, which are selectable from the script. Works fine. Even makes the final file bookmarkable in iTunes 5. I'll run some more tests and try to have an update available soon.

september 7 '05 - 12:00 am
iTunes 5 Released

iTunes 5.0 was released on September 7, 2005 at an Apple Special Event in San Francisco's Moscone Center, along with the Motorola ROKR iPod/cell phone and iPod nano. New features in iTunes 5 include improved search capabilities, "Smart Shuffle" to provide more control over shuffle by artist and album, and parental controls to restrict downloading of iTMS music with explicit lyrics. iTunes 5 sports a new "shinier" metallic look.

I'll be providing info on AppleScript ehancements and changes on this page.

Dump Lyrics to File

Correspondent Sam Elowitch inspired this script to write lyrics from the current track in iTunes 5 to a file on the Desktop which will open in Text Edit:

set target_folder to (path to desktop from user domain) as string
set lyric_file to ""
tell application "iTunes"
	if player state is playing then
		tell current track
			set TheLyrics to lyrics
			if TheLyrics is "" then return
			set nom to name
			set art to artist
		end tell
	end if
end tell
set TheLyrics to (""" & nom & """ & return & art & return & return & TheLyrics) as string
set lyric_file to (target_folder & "Current Lyrics") as string

try
	set fileRef to open for access file lyric_file with write permission
	write TheLyrics to the fileRef starting at 0 as Unicode text
	close access the fileRef
on error
	close access the fileRef
end try

tell application "TextEdit"
	open lyric_file
	activate
end tell

Mod it if you like. Thanks, Sam.

New: Selected Tracks Bookmarkable

iTunes 5 will let you set any to track to be bookmarkable, not just AACs. Selected Tracks Bookmarkable will let you select some files and make them bookmarkable. Requires iTunes 5.

Chapterized Tracks in iTunes 5

My script Join Together has a problem with iTunes 5--at least, I hadn't experienced it with iTunes 4.9. After joining selected AAC tracks with QuickTime Pro the finalized file will load into iTunes. However, only the first song seems to be recognized in the joined file. If you have opted to "chapterize" the joined file the effect is such that when you select a "chapter", the next track in the playlist plays. Other joined tracks are not recognized. In fact, any file created with Join Together behaves the same way, whether I created it with iTunes 4.9 or iTunes 5. I am investigating.

september 5 '05 - 12:00 am
New: Save Album Art to Album Folder

Yet another...You know, those of us who have been trying to write scripts that dump a batch of artwork to the ol' hard drive have run into a "out of memory error" so many times. I finally beat that error and have come up with Save Album Art to Album Folder. This script applet will dump the artwork of the selected tracks--or tracks in the selected playlist--to each track's file's folder, or en masse to a folder you select. Each graphics file will be re-scaled (the default is 300 x 300) and the image will be used as the file's icon. Have a look at the Read Me for more info on making your own mods.

september 3 '05 - 12:00 am
Script Editor Help Help

Do you suppose my copy of Script Editor is trying to tell me something?
Help Help!
If you have any ideas on how to fix this, let me know. Short of a re-install, I think I've tried everything.

...And Help is Found

Correspondent C. Posey writes in my response to my double-Help Menu dilemma: "I had this same exact problem of 2 Help menus in several of my apps after updating to Tiger. Finally found the solution. It involved an older, incompatible version of DivX plugin I had installed.

Remove "/Library/QuickTime/DivX 5.component" or it may be located in ~/Library/Quicktime and then restart your apps and I think that will solve your problem. Then if you want to re-enable DivX - try the DivX Fusion plugin - has been working perfect for me in Tiger. Is currently beta and free."

Worked like a charm!

Site contents © 2001 - 2020 (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 interrupt the one doing it.