MacOS – AppleScript: move a folder to library (to root) in iTunes

applescriptfoldersitunesmacos

Does anybody know how to move some folder to library playlist in iTunes?

I can move some folder to another folder using the following script:

tell application "iTunes"
    move folder playlist "3" to folder playlist "1"
end tell

The initial state is:

1
|--2
   |--3

After executing the script state will be:

1
|--2
|--3

But I don't know how to move folder "3" on the same level as folder "1". Folder "1" is located in library. I mean the following structure:

1
|--2

3

You can see picture what I want to do using AppleScript
enter image description here

Best Answer

@ArtemG. then I assume that this operation could be done by editing the playlist file that is loaded by iTunes. It should be located in ~/Music/iTunes/

Information is according to the posts marked as helful over here (https://discussions.apple.com/thread/2439817)