Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OSAX to Tokenize Record Field Names from List Items ???



On Jun 23, 2007, at 11:00 AM, Luther Fuller wrote:

on run
set aList to {"recName", 5}
set scriptText to "{" & (item 1 of aList) & ":" & (item 2 of aList) & "}"
set aRec to run script scriptText
display dialog (recName of aRec)
end run

And here is a generic solution:

on run
set scriptText to "{"
set aList to {"recName", 5, "rec2", 2, "rec3", "\"third record\"", "rec4", true, "rec5", false}
repeat with i from 1 to (count aList) by 2
set scriptText to scriptText & (item i of aList) & ":" & (item (i + 1) of aList) & ","
end repeat
set scriptText to text 1 through -2 of scriptText
set scriptText to scriptText & "}"
set aRec to run script scriptText
end run


-- Michelle

--
"The past is like a foreign country. They do things differently there." --Leslie Poles Hartley


_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >OSAX to Tokenize Record Field Names from List Items ??? (From: Rick Gordon <email@hidden>)
 >Re: OSAX to Tokenize Record Field Names from List Items ??? (From: Luther Fuller <email@hidden>)
 >Re: OSAX to Tokenize Record Field Names from List Items ??? (From: Michelle Steiner <email@hidden>)
 >Re: OSAX to Tokenize Record Field Names from List Items ??? (From: Luther Fuller <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.