I need help with this script:
set x to display dialog "What song do you want to hear?" default answer "" buttons {"OK"} default button 1
tell application "iTunes"
activate
play track "x" of playlist "Library"
end tell
As you can see, I am trying to get itunes to play a song that I enter, however, to my dismay, I cannot figure out how to get itunes to play the variable I have entered in. Note that this script:
tell application "iTunes"
activate
play track "x" of playlist "Library"
end tell
works if you change "x" to a song of your choice, such as "Blue Monday". I however think this is against the point and don't want to open applescript just to play a song. Please help with the user input and variable, because this is the problem I have been stumped on for a while. Thank you in advance. If you don't understand, I'm happy to clear up any misunderstandings.
I am also new here. I don't plan on coming to this site much to post, only to browse. Only rare circumstances like these require a post.
set x to display dialog "What song do you want to hear?" default answer "" buttons {"OK"} default button 1
tell application "iTunes"
activate
play track "x" of playlist "Library"
end tell
As you can see, I am trying to get itunes to play a song that I enter, however, to my dismay, I cannot figure out how to get itunes to play the variable I have entered in. Note that this script:
tell application "iTunes"
activate
play track "x" of playlist "Library"
end tell
works if you change "x" to a song of your choice, such as "Blue Monday". I however think this is against the point and don't want to open applescript just to play a song. Please help with the user input and variable, because this is the problem I have been stumped on for a while. Thank you in advance. If you don't understand, I'm happy to clear up any misunderstandings.
I am also new here. I don't plan on coming to this site much to post, only to browse. Only rare circumstances like these require a post.