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

Re: Records


  • Subject: Re: Records
  • From: Emmanuel <email@hidden>
  • Date: Thu, 3 Nov 2005 21:06:19 +0100

At 9:56 AM -0600 11/3/05, Luther Fuller wrote:
I don't work with records too often and I've run into
a couple of puzzling situations:

1.
A project I started earlier this year (in OS X 10.3) used records constructed
with vertical bar characters, for example: {|a|:somevalue, ...}.
AppleScript will no longer create new labels like this, but the old labels
still work.  Why?

2. Suppose r is a record only one of whose labels is known.
For example, r = {a:somevalue, ... }.
I need to create a new record that contains everything in r
except property a. (I really, really need this!)
One would think this would be as easy as something like ...
    set n to r
    delete a of n
which, of course, doesn't work. Any ideas?

Looks like a job for good ol' Satimage.osax' "suppress item" command:

set r to {a:"somevalue", foo:"bar"}
suppress item "a" from r
 --> {foo:"bar"}

Caveat: "suppress item" does not suppress the item from the original record! "suppress item" returns the changed record but leaves the original record unchanged.

Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Records (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: changing keyboard shortcut check boxes
  • Next by Date: Password-Dialog
  • Previous by thread: Records
  • Next by thread: Re: Records
  • Index(es):
    • Date
    • Thread