function generateLink(trackID) {
// Get necessary info from Spotify
var trackName = spotify.currentTrack().name();
var artist = spotify.currentTrack().artist();
// Use songwhip.com to create a cross-platform music link
var mySearch = "https://songwhip.com/" + trackID;
safari.openLocation(mySearch);
// Prompt user for a quick note on the music, the second argument is a placeholder
var myStr = _prompt('Write a few words about this music.', 'Check out this music.');
// Wait until webpage is loaded and return the song link
do {
delay(0.1);
} while (safari.documents[0].url() == null);