読者です 読者をやめる 読者になる 読者になる

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

Mac
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するとよいですね。