[OT] Getting the labels of a record
[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.