Apple Intelligence now features Image Playground, Genmoji, Writing Tools enhancements, seamless support for ChatGPT, and visual intelligence.

Apple Intelligence has also begun language expansion with localized English support for Australia, Canada, Ireland, New Zealand, South Africa, and the U.K. Learn more >

You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

📰 Newsroom Update

Apple Music expands live global radio offering with three brand-new stations. Learn more >

Organizing audiobook chapters

Last modified: Oct 10, 2020 5:08 AM
37 35296 Last modified Oct 10, 2020 5:08 AM

While iTunes caters for multi-track audiobooks, the result of copying these tracks to older Apple devices such as an iPod classic can be unpredictable if names or chapter titles are not set in a standard <Book>, Part ## form. Starting from version 12.7.2 the audiobooks view in iTunes may show multiple copies of books, each containing all of the same tracks, unless this pattern or something similar is used. Essentially chapters are sorted alphabetically by name, and each time the book title changes a new cover is displayed. Each cover then shows all tracks with the same book title. Using a naming pattern such as <Book>, Part ## means that all of the chapters of a given book are sorted next to each other, so only one cover gets shown, and that the covers are sorted by book title. The sort name field can be used to control the ordering of chapters while leaving the existing descriptive chapter titles in place. It is possible to apply this workaround by hand, but tedious. Mac users can take advantage of the AppleScript below called AudiobookSortName to automatically set sort names in a form that should be organized consistently both in iTunes and on Apple devices. A second script called ClearSortName can be used to reset the sort names if things change so that this tweak is no longer needed. The two AppleScripts mirror those I have created for iTunes for Windows which can be found at Audiobooks on iPods. That page also contains further advice on organizing audiobooks for use with iTunes and Apple devices.


In iTunes 12.7.2 sorting as Author by Author (which doesn't seem a like it ought to be an option) should provide a duplicate free view, and may be a preferable workaround if you don't have to cater for older Apple devices. It is unclear however when this bug will be fixed. iTunes 12.7.4 for example still exhibits this issue, and it seems no longer allows the Author by Author workaround.



To use either of these scripts copy the block of text below the title into the Script Editor which can be found in Applications > Utilities and save with the respective title as the filename. If you save them in User/Library/iTunes/Scripts you can access them from the scripts icon in the iTunes menu bar. Select the tracks that you want to be updated first then run the script either in the Script Editor or from the icon in iTunes menu bar. iTunes won't automatically refresh the grid view after the changes are applied so switch to another view or playlist and then back again to see the results.


If track counts are not set then two digits will be assumed. For an audiobook with more than 99 chapters set the track count to the chapter count to ensure the correct padding with leading zeros.




AudiobookSortName


-- AudiobookSortName - V1.0 - © Steve MacGuire - 2017-12-11

tell application "iTunes"

if selection is not {} then

set mySelection to selection

repeat with aTrack in mySelection

set aString to album of aTrack & ", Part "

if (track number of aTrack) < 10 and ((track count of aTrack) > 9 or (track count of aTrack) = 0) then

set aString to aString & "0"

end if

if (track number of aTrack) < 100 and (track count of aTrack) > 99 then

set aString to aString & "0"

end if

set aString to aString & (track number of aTrack as string)

set sort name of aTrack to aString

end repeat

end if

end tell





ClearSortName


-- ClearSortName - V1.0 - © Steve MacGuire - 2017-12-11

tell application "iTunes"

if selection is not {} then

set mySelection to selection

repeat with aTrack in mySelection

set sort name of aTrack to ""

end repeat

end if

end tell





Example running iTunes 12.7.2


Before: 86 items, each cover shows all tracks of the respective audiobook.



After: The custom sort names have collapsed the view down to the 9 distinct audiobooks.




The original Windows versions of these scripts can be found at AudiobookSortName and ClearSortName.





macOS 10.15 Catalina and later


The scripts above can still be useful if you change the second line of the script to:


tell application "Music"


and use Music to configure the metadata of your audiobook items before you import them into the Books application. Once there your options for editing metadata are severely limited.


Comments

Jan 11, 2019 12:49 PM

SetToAudiobook


If you are having trouble bulk changing music items into audiobooks you can use the following AppleScript:


-- SetToAudiobook - V1.0 - © Steve MacGuire - 2018-06-05
tell application "iTunes"
	repeat with aTrack in selection
		try
			set media kind of aTrack to audiobook
		end try
	end repeat
end tell


tt2

Jan 11, 2019 12:49 PM

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.