AppleScript iTunes question

Anyone know why this works,



tell application "iTunes"



playpause


end tell




But this does't?




set theTail to "playpause"


tell application "iTunes"



theTail


end tell

MacBook Air, OS X Mountain Lion (10.8.4)

Posted on Aug 18, 2013 11:22 AM

Reply
10 replies

Aug 18, 2013 11:52 AM in response to napabar

playpause is an applescript command defined by itunes. theTail is a string variable as you've set it. It may be possible to set a variable to the command playpause and then invoke the command by calling the variable; I haven't tried, but I know that commands are technically application-defined handlers, and handlers can in normal cases be assigned to variables. But that line of thought is liable to provoke brain-freeze, so just take it as read that there's no easy way to use a string variable in place of an application defined keyword.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

AppleScript iTunes question

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.