Re: Coercion of list to record
Re: Coercion of list to record
- Subject: Re: Coercion of list to record
- From: Bastiaan Boertien <email@hidden>
- Date: Thu, 7 Feb 2008 15:47:28 +0100
I know but you can also solve this problem as well. I don't use
property name's of a record with spaces but if you do, Convert the
spaces in the property name into "_" or just remove them and you
problem is solved.
For every problem there is a solution and don't try to do something
that applescript doesn't support. It speaks for it self for me.
greets bas
Op 7-feb-2008, om 13:10 heeft Skeeve het volgende geschreven:
Bastiaan Boertien wrote:
set recordItems to {}
repeat with x from 1 to count theList by 2
set end of recordItems to item x of theList & ":\"" & item (x
+ 1) of theList & "\"" as string
end repeat
set AppleScript's text item delimiters to ", "
set recordAsString to ("{" & recordItems as string) & "}"
set AppleScript's text item delimiters to ""
return run script recordAsString
This should do the job for you
Negative! Try it with
set theList to {"the answer", 42, "value for pi", 3.14159265359}
And this is (i guess) one of the reasons why Chris said, that there
are ways (like yours) but that they are painful (as you just
learned)...
There are ways to bludgeon AppleScript records into serving as
associative arrays, but it's just kind of painful.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
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