• 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
AS/FMP: a list of fewer than two records
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AS/FMP: a list of fewer than two records


  • Subject: AS/FMP: a list of fewer than two records
  • From: Chap Harrison <email@hidden>
  • Date: Thu, 26 Feb 2004 22:39:09 -0600

Please tell me I'm just doing something stupid.

Everything was working great with a database of 21 test records. Then I tried it with 1 record.

The following suddenly broke -

set myLI_IDList to ID of (every record whose cell "Price" is not "*")
repeat with myLI_ID in myLI_IDList

Apparently, when only one record meets the criteria, "ID of (every record whose...)" returns a scalar value, not a list. So the repeat statement failed - I was not iterating over a list.

Okay... So I add "as list" -

set myLI_IDList to ID of (every record whose cell "Price" is not "*") as list
repeat with myLI_ID in myLI_IDList

That fixed it!

Next I try it with *zero* qualifying records.

The 'set myLI_IDList...' statement dies with an "object not found". It's only a wild guess, but I'm guessing that an empty set of records is not an object?

Is it time to go to bed, or does AS (or FMP) sometimes really treat "a list of zero items" and "a list of one item" as something other than a list? (That would be... "English-like")

Please, tell me I'm just doing something stupid.

Thank you,
Chap
_______________________________________________
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.


  • Follow-Ups:
    • Re: AS/FMP: a list of fewer than two records
      • From: Chris Espinosa <email@hidden>
    • Re: AS/FMP: a list of fewer than two records
      • From: Gary Lists <email@hidden>
  • Prev by Date: Re: Results differ in editor and applet
  • Next by Date: Enabling and Attaching Folder Actions
  • Previous by thread: Re: Results differ in editor and applet
  • Next by thread: Re: AS/FMP: a list of fewer than two records
  • Index(es):
    • Date
    • Thread