dougscripts.com

August 12 2016 - 6:46 am

The Next Track Podcast, Episode #13

Kirk and I welcome back Chris Connaker to discuss music streaming services. Apple Music, Spotify, Tidal, or another; which is right for you? What are the pros and cons of the various streaming services?

Listen to The Next Track: Episode #13 ? Which Streaming Service Is Right for You?

Find out more, and subscribe to the podcast, at The Next Track website. You can follow The Next Track on Twitter at @NextTrackCast, to keep up to date with new episodes, and new articles from the website.

August 7 2016 - 2:54 pm

Dislike is a New iTunes 12.5 Track Property

If you have access to the latest macOS 10.12 Developer Preview then you probably downloaded the newest iTunes 12.5 beta (12.5.0.63). It has a new "Dislike" track feature and corresponding AppleScript disliked track and playlist property and album disliked track property. These work like the corresponding loved properties.

Except...

In the current iTunes beta there is no way to know which tracks you've Dislike'd; there's no column in the browser window [UPDATE: Yes there is], there's no widget in the Get Info window [UPDATE: Yes there is], and there's no "Disliked" criteria for Smart Playlist making—yet, I guess, right? [UPDATE: Right! iTunes 12.5.2, released October 28, 2016, has Love/Album Love criteria that incorporates "Disliked".]

But for now there is this:

-- iTunes 12.5.0.63 or later required

tell application "iTunes"

set dislikedTracks to {}

try

set dislikedTracks to every track of library playlist 1 whose disliked is true

end try

if dislikedTracks is {} then return

if (exists playlist "_Disliked_") then

delete playlist "_Disliked_"

end if

set thePlaylist to (make new playlist with properties ¬

{name:"_Disliked_", description:("Disliked tracks as of " & my makeDateString()) as text})

repeat with dislikedTrack in dislikedTracks

try

duplicate dislikedTrack to thePlaylist

end try

end repeat

reveal thePlaylist

end tell

to makeDateString()

set cd to (get current date)

return (short date string of cd & space & time string of cd) as text

end makeDateString

It just copies every disliked track to a new playlist named "_Disliked_", re-creating the playlist each time the script is run. It'll also time stamp the playlist's description.

This script won't work unless you have the latest iTunes 12.5 beta with the disliked track property, which I suspect may be in the next Public Beta release.

August 5 2016 - 6:38 am

The Next Track, Episode 12

In Episode 12 of The Next Track podcast, Kirk and I talk about iTunes and AppleScript. During the episode, we mentioned the following scripts:

Artist - Name Corrector
Remove n Characters from Front or Back
This Tag, That Tag
Search Replace Tag Text
Proper English Title Capitalization
List MIAs
Super Remove Dead Tracks
Music Folder Files Not Added
Move Playlists to Folder
Playlist Manager
Find Album Artwork With Google
Save Album Art as folder.jpg
Embed Artwork
Re-Embed Artwork
PDF Adder
View Cached Music
Copy Tag Info Tracks to Tracks
A Space Between

In case you don't know, The Next Track is a weekly 30-minute podcast in which Kirk McElhearn and I discuss how people listen to music today; it was inevitable we'd talk about iTunes and AppleScript at some point, right?

August 1 2016 - 7:24 pm

Revisiting Reset Plays

The iTunes faithful may remember that iTunes 12.4 removed the "Reset Plays" option. This command would zero the Plays and Skips of a track.

AppleScript to the rescue: I posted a script, Reset Plays, that replicated this feature and additionally deleted the Last Played Date and Last Skipped Date, turned off "Remember Playback Position", and set the played property to false; essentially, rendering a track as "never played".

Whether due to user clamor or by design, the "Reset Plays" feature was restored in iTunes 12.4.1 and I figured the script was obsolete.

Today, I got around to trying iTunes' native "Reset Plays" in v12.4.3 (it is not something I would normally use at all). While the Plays and Skips are set to zero as expected, surprisingly, the Last Played Date and Last Skipped Date remain; such that a Smart Playlist filtering by the date a track was last played (or skipped) will not realise that these "reset" tracks were supposed to appear as never played.

So, Reset Plays may actually still be useful.

August 1 2016 - 3:56 pm

iTunes 12.4.3 Released

Apple has released an update to iTunes. Version 12.4.3 "resolves an issue where playlist changes made on other devices may not appear in iTunes." I'm wondering if this addresses the played count problem. More as it develops.

July 18 2016 - 6:15 pm

iTunes 12.4.2 Released

Apple released iTunes 12.4.2 today (along with updates to all current OS) which addresses a play back issue with short songs in Up Next. More if it develops.

July 8 2016 - 2:03 pm

About Sierra Public Beta

Apple's Sierra Public Beta program allows registered participants to download and install the latest developer builds of macOS 10.12 before its ultimate final release in the Fall. If the public beta program works like it has in previous years, developers will receive updates first and then a week or so later the public beta testers will get a version.

As a registered Apple developer, I've had access to macOS 10.12 since WWDC in June. As far as I've been able to tell, any scripts or apps from this site that are already downloaded on a machine that is updated to macOS 10.12 should work fine. But Apple has introduced new security features in macOS 10.12 that may affect some scripts or apps if they are newly downloaded to a Sierra beta machine (they won't behave badly, they just won't be able to be launched). Therefore: unless a script or app is specifically described as supporting macOS 10.12, don't assume it will work on Sierra. To be clear, there aren't that many downloads that will be affected and I'm updating those as promptly as I can.

June 26 2016 - 12:18 pm

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.

June 24 2016 - 6:31 am

The Next Track, Episode No. 6

On the latest episode of The Next Track podcast, Kirk McElhearn and I welcome Chris Connaker, the founder of the Computer Audiophile website, to discuss some basic pros and cons of high-resolution audio. I have to admit that my familiarity with hi-res audio has been somewhat stifled by a natural inclination to Not Pay Much Attention to New Stuff Now That I've Got My Audio System Set Up Just The Way I Like It For The Rest of My Life. You know that feeling? So I enjoyed reviving my inner audio-geek in this chat with Chris.

If you haven't already, you can subscribe to The Next Track on iTunes or in Overcast and follow our Twitter feed.

June 2 2016 - 10:55 pm

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

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.