# Batch Extract iTunes PIDs

The primary requirement in interacting with iTunes is establishing a link between Yate and iTunes. This link can be initiated from within Yate or iTunes. Regardless as to how the link is established, it is transient and is removed when the linked files are closed in Yate.

When there is insufficient metadata to link to iTunes you can use the iTunes so called Permanent Identifier (PID). PIDs are invalidated whenever an iTunes database is rebuilt and oft times when iTunes is updated and it silently updates its database. PIDs are also meaningless if you have more than one iTunes library. It is for these reasons that Yate's preferred linking method does not use the PIDs.

This batch process will automate the extraction of the PIDs from iTunes. It only works if you are running iTunes v11 or later.

The process enumerates all media items in the iTunes database. For every local item it attempts to locate the file and store the associated PID. Note that the number of items might appear to be larger than you would expect because of cloud based items, which are not processed. The log file always describes errors as well as descriptions of processed items in iTunes which cannot be located. When Verbose is selected, the log file will also contain an item for each written file.

If you only wish to see errors (including those nasty iTunes cannot locate errors, set the Log only option. Warning: when the Log only option is selected, no PIDs will be retained.

Additional information

Interacting with iTunes