RE: OSAX to Tokenize Record Field Names from List Items ???
RE: OSAX to Tokenize Record Field Names from List Items ???
- Subject: RE: OSAX to Tokenize Record Field Names from List Items ???
- From: Olof Hellman <email@hidden>
- Date: Mon, 25 Jun 2007 13:26:47 -0700
- Acceptlanguage: en-US
- Thread-topic: OSAX to Tokenize Record Field Names from List Items ???
Two blasts from the past in one message! (Hi Rick!)
I feel obligated to point out that list to record coercion is a frequent topic for this list. In 2001, we had a grand old time doing a non-OSAX version of the runtime list to record converter and tagged item from record functions. See this post about midway through the thread
http://lists.apple.com/archives/applescript-users/2001/Dec/msg00499.html
for our simplest version:
to usrf(theList) -- make a record from a list
return {+class usrf;:theList } -- chevrons here :-)
end usrf
to extract_record_field(theRecord, fieldName) -- get the item from the record with the tag fieldName
run script " on run{r}
return |"& fieldName & "| of r
end " with parameters {theRecord}
end extract_record_field
set usrfRecord to usrf( {"serial number", 75757575 })
extract_record_field( usrfRecord, "serial number" )
--> 75757575
Which still works in 2007.
- Olof
Microsoft MacBU
-----Original Message-----
From: applescript-users-bounces+olofh=email@hidden [mailto:applescript-users-bounces+olofh=email@hidden] On Behalf Of Rick Gordon
Sent: Monday, June 25, 2007 10:43 AM
To: email@hidden
Subject: Re: OSAX to Tokenize Record Field Names from List Items ???
Thanks to Luther, Michelle, and Mark for your responses to this intriguing (to me) thread.
For what it's worth, this is all working towards a custom tag parsing application for InDesign, where I would be reading InDesign Tagged text files with extra custom codes inserted, which will be parsed into data for the scripted placement of inline image and text objects. My intent to keep some flexibility in the fields included in the tags is to allow flexibility in the order of tag parameters, and the ability to have certain elements be initialized with default values if not specifically included.
--
___________________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________
_______________________________________________
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
_______________________________________________
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