• 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
[OT] Getting the labels of a record
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OT] Getting the labels of a record


  • Subject: [OT] Getting the labels of a record
  • From: Jean-Baptiste LE STANG <email@hidden>
  • Date: Wed, 18 Jun 2003 22:12:03 +0200

Here is a handler that will split a record using regular expressions, so you need satimage.osax :

it will only work if your record does not contain any record. I'm still working on it.

<script>
on breakRecord(myRecord)
set myRecordAsString to display myRecord
set recordLength to length of myRecord
set theRegExp to "\\{"
set groupList to {}
repeat with x from 1 to recordLength
set groupList to groupList & {"\\" & 2 * x - 1, "\\" & 2 * x}
if x < recordLength then
set theRegExp to theRegExp & "(.{1,}):(.{1,}), "
else
set theRegExp to theRegExp & "(.{1,}):(.{1,})"
end if
end repeat
set theRegExp to theRegExp & "\\}"
return find text theRegExp in myRecordAsString using groupList with regexp, whole word and string result
end breakRecord
</script>
_______________________________________________
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: [OT] Getting the labels of a record
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: [OT] Only three things (was Re: Why save text item delimiters?)
  • Next by Date: Re: [OT] Only three things (was Re: Why save text item delimiters?)
  • Previous by thread: Re: key,value pairs
  • Next by thread: Re: [OT] Getting the labels of a record
  • Index(es):
    • Date
    • Thread