AppleScript to JavaScript
Hi,
Just to test, I'm want to code a simple function in JavaScript to get the artist name of a track in iTunes.
In AppleScript, the script is :
on run {input, parameters}
set t to input
tell application "iTunes"
set artist_name to artist of (item 1 of t)
end tell
return artist_name
end runBut in JavaScript, I don't know how to tell iTunes to do something so I tried this :
function run(input, parameters) {
var t = input;
var artist_name = t.artist;
return artist_name;
}Nothing is returned.
Can you help me ?
Thx.