• 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: Contains?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Contains?


  • Subject: Re: Contains?
  • From: Michelle Steiner <email@hidden>
  • Date: Thu, 11 Sep 2008 11:21:12 -0700

On Sep 11, 2008, at 11:09 AM, J. Todd Slack wrote:

OK, that is good to know. I am actually trying to do a contains based upon an array. Is that allowed? I wanted to make sure I had the right syntax (and I had a typo :()

property invalid_files : {".m4a", ".m4p", ".aac"}

if c_ring_tone_file contains invalid_files then
display dialog "opps"
end if

Is something like this allowed?

How do you define c_ring_tone_file? It would have to be a list for your script to work.  If it's a string (e.g., ".m4a"), then your code won't work.  you would need something like this:

set c_ring_tone_file to ".m4a"
property invalid_files : {".m4a", ".m4p", ".aac"}

if c_ring_tone_file is in invalid_files then
display dialog "opps"
end if

Alternatively:

set c_ring_tone_file to ".m4a"
property invalid_files : {".m4a", ".m4p", ".aac"}

if invalid_files contains c_ring_tone_file then
display dialog "opps"
end if

-- Michelle

--
Please contribute to the Leukemia and Lymphoma Society, and help me meet my fund raising goal for my marathon training.
<http://www.active.com/donate/tntdms/tntdmsMSteine>




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Contains?
      • From: "J. Todd Slack" <email@hidden>
References: 
 >Contains? (From: "J. Todd Slack" <email@hidden>)
 >Re: Contains? (From: Michelle Steiner <email@hidden>)
 >Re: Contains? (From: "J. Todd Slack" <email@hidden>)

  • Prev by Date: Re: Contains?
  • Next by Date: Re: set optionKeyDown to...
  • Previous by thread: Re: Contains?
  • Next by thread: Re: Contains?
  • Index(es):
    • Date
    • Thread