tell application "iTunes"
set lib_pl to first library playlist
set item_ref to location of first track of lib_pl
end tell
set n to ""
repeat until n is "iTunes"
tell application "Finder"
set item_ref to (container of item_ref)
set n to name of item_ref
end tell
end repeat
return item_ref as alias
thanks for your code snippet.
Its not returning the location of the iTunes Music folder in my case.
But your method is returning one of the folders where I store my music,
which is even better!
So thanks again for this nice idea.
Just in case somebody might be interested how to do the same in python with appscript:
def getMusicFolder():
try:
libraryPlaylist = app(‘iTunes’).library_playlists.get()[0]
path = libraryPlaylist.tracks.get()[0].location.get().path
n = “”
while not n == “iTunes”:
path, n = os.path.split(path)
return path
except Exception, e:
print “[KRIX] unable to get music folder:”, e
return None
Thanks as well to Bruce for the forum link.
Have a nice day,
yours kodi