• 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: names of a record's items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: names of a record's items


  • Subject: Re: names of a record's items
  • From: "koenig.yvan" <email@hidden>
  • Date: Wed, 09 Apr 2014 18:54:32 +0200


Le 09/04/2014 à 16:13, 2551 <email@hidden> a écrit :

Way back when Matt Neuburg wrote AppleScript: The Definitive Guide, he stated that:

“There is no built-in way to obtain a list of the names of the items of a record…I have seen many elaborate attemtps to work around this problem, but I’m not going to show you any of them. This is a big shortcoming of AppleScript itelf, and it needs to be fixed on the level of AppleScript itself”.

I guess we’re still waiting for that fix, and I was wondering if anyone would care to share any "elaborate attempts” they know of?


TIA


Phil



#[SCRIPT]
system info
try
result as text
on error errMsg number errNbr
offset of "{" in errMsg
set errMsg to text (result + 1) thru -1 of errMsg
offset of "}" in errMsg
set errMsg to text 1 thru (result - 1) of errMsg


set listOfRecords to my decoupe(errMsg, ",")
set theLabels to {}
repeat with aRecord in listOfRecords
item 1 of my decoupe(aRecord, ":")
set end of theLabels to result
end repeat
theLabels
end try

#=====

on decoupe(t, d)
local oTIDs, l
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d}
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe

#=====
#[/SCRIPT]


Of course it's not perfect.
It would be useful to take care of possible encapsulated records.
But as I have a perfect answer to the problem in ASObjC Runner I will not spent more time upon that.

Yvan KOENIG (VALLAURIS, France) mercredi 9 avril 2014 18:54:10


 _______________________________________________
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: names of a record's items
      • From: "koenig.yvan" <email@hidden>
  • Prev by Date: Re: names of a record's items
  • Next by Date: Re: names of a record's items
  • Previous by thread: Re: names of a record's items
  • Next by thread: Re: names of a record's items
  • Index(es):
    • Date
    • Thread