Skip to content

Conversation

@ggarber
Copy link

@ggarber ggarber commented Jul 14, 2019

Tested with this code:

applescript
  .execString(script)
  .then(rtn => {
    if (Array.isArray(rtn) && rtn.length > 0) {
      console.log('Currently selected tracks in "iTunes":');
      rtn.forEach(function(songName) {
        console.log("\t" + songName);
      });
    } else {
      console.log('No tracks are selected in "iTunes"...');
    }
  })
  .catch(err => {
    console.log(err);
  });

It will enable to use node-applescript with modern async/await code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant