I admit it. I'm doing it just for the fun of it. Now I can't figure out how to get around this wall.
For years I thought it would be cool if I could pick a song from the desktop in some manner on a whim and hear it launched in iTunes.
Recently, I started looking at applescript, mostly just playing and trying to have fun while learning a thing or two. That's when I decided to really try something courageous. After 3-4 days of reading the applescript missing manual, I've gotten this far in my script:
set mymsg to "what'cha wanna hear?"
set myresponse to the text returned of (display dialog mymsg default answer "" buttons ["Got it!", "Not right now, thanks!"] default button 1)
set mychoice to the button returned of (display dialog myresponse buttons ["Here we go!", "Uh, there's a problem!"] default button 1)
repeat (1) times
tell application "iTunes"
play track mychoice of playlist "KoWeiNaLie"
end tell
end repeat
I know it may not be particularly elegant. But I've got it to work right up to playing the track. At that point, the script craps out and gives me an error -- saying it can't make some data into the expected type. I'm pretty proud of myself having gotten that far. But guess I'm too dull to see my errorl
Can someone point out what I'm probably just not seeing? Thanks
For years I thought it would be cool if I could pick a song from the desktop in some manner on a whim and hear it launched in iTunes.
Recently, I started looking at applescript, mostly just playing and trying to have fun while learning a thing or two. That's when I decided to really try something courageous. After 3-4 days of reading the applescript missing manual, I've gotten this far in my script:
set mymsg to "what'cha wanna hear?"
set myresponse to the text returned of (display dialog mymsg default answer "" buttons ["Got it!", "Not right now, thanks!"] default button 1)
set mychoice to the button returned of (display dialog myresponse buttons ["Here we go!", "Uh, there's a problem!"] default button 1)
repeat (1) times
tell application "iTunes"
play track mychoice of playlist "KoWeiNaLie"
end tell
end repeat
I know it may not be particularly elegant. But I've got it to work right up to playing the track. At that point, the script craps out and gives me an error -- saying it can't make some data into the expected type. I'm pretty proud of myself having gotten that far. But guess I'm too dull to see my errorl
Can someone point out what I'm probably just not seeing? Thanks