• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: set variable to a command?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set variable to a command?


  • Subject: Re: set variable to a command?
  • From: Steve Mills <email@hidden>
  • Date: Wed, 19 Nov 2003 12:09:41 -0600

On Nov 19, 2003, at 11:06, David A. Cox wrote:

This does not:

set command to "play"
tell application "iTunes"
command
end tell

You can't do that. The line 'set command to "play"' is setting the variable "command" to the string "play", which has nothing to do with the verb "play". I just tried forcing the 4-char code into a variable, but that doesn't work either. You'll probably just have to set command to your own strings (possibly even "play" and whatever other commands you want to do), then switch off those strings to the actual verbs:

set command to "play"

tell app "iTunes"
if command is "play" then
play
else if command is "pause" then
pause
end if
end tell

Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: (beep) as string
  • Next by Date: Re: Getting label from a record
  • Previous by thread: set variable to a command?
  • Next by thread: Re: set variable to a command?
  • Index(es):
    • Date
    • Thread