Combo

Q: 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 run

 

But 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.

Posted on May 8, 2015 10:34 AM

Close

Q: AppleScript to JavaScript

  • All replies
  • Helpful answers