Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>iTunes doesn't allow you to do this with AppleScript, but you can write directly into iTunes' preferences, where it stores an alias to the currently selected library (or nothing, if you're using a library in the default location).</p> <p>First, you'll need to obtain the alias data for your selected library location. Open iTunes holding down the Option key, select your library and quit iTunes. Then, in Terminal, run:</p> <pre><code>defaults read com.apple.itunes 'alis:1:iTunes Library Location' | pbcopy </code></pre> <p>This will copy the library alias data to the clipboard.</p> <p>Finally, here's the script:</p> <pre><code>property otherLibraryLocation : "" -- paste location between the quotes property libraryLocationPref : "com.apple.iTunes 'alis:1:iTunes Library Location'" -- first, quit iTunes if it's running tell application "System Events" if exists (application process "iTunes") then tell application "iTunes" to quit end if end tell -- then, set the location do shell script "defaults write " &amp; libraryLocationPref &amp; " " &amp; quoted form of otherLibraryLocation -- uncomment the following line to use the default iTunes library instead -- do shell script "defaults delete " &amp; libraryLocationPref -- finally, relaunch iTunes tell application "iTunes" to activate </code></pre> <p>Paste the library location between the quotes in the first line of the script, and you should be all set. To return to the original library, uncomment the line including <code>defaults delete</code>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload