iTunesで再生している曲の情報をYAMLに吐き出すAppleScript

tell application "iTunes"
	set yaml to ""
	set newline to "
"
	repeat with t in every track of current playlist
		set entry to "- title: " & name of t & newline
		set entry to entry & "  album: " & album of t & newline
		set entry to entry & "  artist: " & artist of t & newline
		set entry to entry & "  path: " & POSIX path of (location of t as string) & newline
		set yaml to yaml & entry & newline
	end repeat
	yaml
end tell

あとはこれをMac::AppleScriptでRunAppleScriptしてYAML::Loadするとよいですね。