Hi!
I’m an applescripter with no professional knowledge of other programming. And with a bad knowledge of the right terms to use here. Anyway, her is a try to describe my problem
In a current project, I need a script to search a huge json for properties with certain names while ignoring most of the others. The properties are named by their key value, while the script only know this name as a string passed to it as a parameter.
To convert the json into an applescript record, I can use a script library that I once got from Shane Stanley in this forum that (thanks again, Shane!!) But now I want to be able to refer to a certain properties without the need to loop all the
json data – since the json is so huge and I have to do that kind of query many times in a time critical situation.
So – is there a solution out there that I can use to search dynamically for json properties from applescript?
Simplified example:
I want to be able to ask for the property ”lateprime” among the two properties under ”timeblocksDefs” in the small json below:
{"timeblocksDefs":
{
"normal":
{
"morning":
"06-09",
"day":
"09-18",
"primetime":
"18-22",
"nighttime":
"22-06"
},
"lateprime":
{
"morning":
"06-09",
"day":
"09-19",
"primetime":
"19-23",
"nighttime":
"23-06"
}
}}
In my real case, the json is of course far more complicated… Any suggestions welcome!
<image001.png>
JÖRGEN STAHLE
Sidproduktionsansvarig
IT
TT Nyhetsbyrån
105 12 Stockholm
+46 8 691 16 44
+46 70 372 44 46
|
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: