dougscripts.com

Sierra

May 19 2017 - 8:15 am

iTunes Folder Missing?

A couple of Correspondents have reported that fresh installations of Sierra do not have a “iTunes” folder in the User Library folder (~/Library/iTunes/). Traditionally, this folder contains the “iTunes Plug-Ins” folder and the “Scripts” folder (see my Download FAQ page for more details). Additionally, some third-party apps may use this folder for caching their own iTunes-related files. However, the “Scripts” folder is not created automatically and needs to be created by the user; and I believe Apple has lately inhibited the use of third-party visualizers such that the “iTunes Plug-Ins” folder may no longer be necessary. Perhaps, therefore, the ~/Library/iTunes/ folder is not created automatically anymore either.

To repeat: this seems to affect clean installs of the latest Sierra and iTunes 12.6 and later. If you already have these folders configured on your machine they will not disappear when you upgrade the operating system—at least, that’s been my experience.

iTunes still looks for AppleScript files in this location to make them available in its Script menu, so if your system isn’t configured with the ~/Library/iTunes/ folder you will have to create the intermediate “iTunes” folder there and then the “Scripts” folder within it.

AppleScripts can also be installed in the /Library/iTunes/Scripts/ folder—that’s the [startup disk]/Library/ folder and putting AppleScripts here makes them available to all Users. Again, the “Scripts” folder may have to be created by the user.

AppleScripts will appear in the system-wide Script menu in the Menu Bar when they are installed in ~/Library/Scripts/Applications/iTunes/ for the single User or /Library/Scripts/Applications/iTunes/ for all Users.

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.

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.

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