Přepínání mezi iTunes knihovnami

1. V terminálu zjistíme “iTunes Library Location” knihovny :
#defaults read com.apple.itunes ‘alis:1:iTunes Library Location’ | pbcopy

– toto nám do clipboardu vloží cestu k posledně otevřené knihovně.

2. Spustíme si Automator “Nový sled úloh” -> Utility -> Spustit AppleScript
3. do okna Scriptu vložíme tento text :

property otherLibraryLocation : “” — Sem vložit umístění knihovny mezi uvozovky
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 ” & libraryLocationPref & ” ” & quoted form of otherLibraryLocation
— uncomment the following line to use the default iTunes library instead
— do shell script “defaults delete ” & libraryLocationPref

— finally, relaunch iTunes
tell application “iTunes” to activate

4. V Automatoru Soubor -> Uložit
Vybrat formát souboru:Aplikace

POZOR : při vkládání umístění knihovny neodmazávat řádkování a uvozovky nechat na dalším řádku, jinak skript nefunguje