title: NSAppleScript Returned Value
body: <p>How do I get the returned value from an NSAppleScript.
  I am using apple script to get the song title in iTunes and take that value and set NSMenuItem's title.</p>
  
  <p>My code: .M</p>
  
  <pre><code>//run applescript
  NSAppleScript *script = [[NSAppleScript alloc] initWithSource:@"tell application      \"iTunes\" to set song to name of current track"];
  [script executeAndReturnError:nil];
  //set menu item title
  [songName setTitle:script];
  </code></pre>
  
  <p>My code: .H</p>
  
  <pre><code>IBOutlet NSMenuItem *songName;
  </code></pre>