I've got an Applescript program that works really well for getting most of the info of a currently playing track into a series of named variables:
tell application "System Events" if application process "iTunes" exists then tell application "iTunes" set state to player state if state = playing tell current track set theArtist to artist set theTitle to name set theAlbum to album set theTime to time set theGrouping to grouping set theGenre to genre set theKind to kind set theYear to year set theComments to comment set playCount to played count set theTrack to track number set numTracks to track count set theDisc to disc number set numDiscs to disc count set bitRate to bit rate end tell else set state to "none" end if end tell else set state to "none" end if end tell
But I'm completely baffled on how to get actual file path of the current track. The Applescript library for iTunes has a "file track" entry that has a "location" item, but I haven't been able to figure out how to use it in this context. Any help would be greatly appreciated.