January 2024
Issue With Copying a Newly Converted File
I've been going crazy trying to track down a problem using AppleScript to convert a file and then duplicate the newly converted file's track entry to a playlist. No matter what I tried, the original pre-converted track is copied to the playlist and not the new converted file. Here's a stripped-down example:
tell application "iTunes"
set oldTrack to item 1 of selection
-- convert oldTrack and get a ref to the newTrack
set newTrack to item 1 of (convert oldTrack)
duplicate newTrack to somePlaylist
-- ...but oldTrack gets copied
end tell
Come to find out, iTunes 12.4.1 gets fussy about converted files when iCloud Music Library is active. As soon as the new converted file is created (again, via AppleScript) and added to the library, iTunes goes into its "Waiting..." mode—waiting to upload the file to the cloud. This apparently prevents AppleScript from doing anything with the new track entry.
This reminded me of how iTunes will warn you about editing a track (that is, about using Get Info) while it is waiting to be uploaded:
Strangely, all the properties for the new track are available. So, I tried adding it to the playlist using its location (file path); I tried persistent ID'ing it from library playlist 1 to get a reference to it; neither worked.
It wasn't until I shut iCloud Music Library off in iTunes > Preferences... > General that a newly converted track entry could be copied to a playlist. After some more experimentation with iCloud Music Library turned back on, I tried setting up a loop that waited for the cloud status of the new track to change to uploaded. But, since it can take several minutes for this process to be initiated, I abandoned this.
Primarily this will be a problem for Quick Convert, which has an option to copy converted tracks to a new/selected playlist (and, I suppose, any other script that works similarly):
If iCloud Music Library is ON, the "Copy new tracks to playlist:" option is ineffective.
The player position Bug Fixed
This bug that prevented setting the player position while the player state is paused is fixed in iTunes 12.4.1
iTunes 12.4.1 Released
Apple has released iTunes 12.4.1 which fixes the Crossfade bug, problems with Voice Over and Up Next, and restores the Reset Plays and Convert ID3 Tags features.
NEW: Reset Plays
Even though I had posted a script workaround to emulate the now-removed "Reset Plays" feature, several users had suggested adding a few additional settings. Plus, some people were just not sure how to get that script onto their machines.
Reset Plays is a downloadable variation of that original script that, in addition to resetting Plays and Played Date, also resets Skips, Skipped Date, Rememebr Playback Position and the played property.