Just modified it a bit to give me the top level key's
function (__string Out) main (__structure StructIn)
{
var result = new Object();
var msg = new String;
msg = "" ;
if (StructIn)
{
k=1
for (i in StructIn)
{
if (k%3==0) CR=String.fromCharCode(32)
else CR=""
msg = msg + i + " " + CR;
k++
}
}
result.Out = msg;
return result;
}
You may not trust my JS since I'm a new convert ;-). This is my super Structure Key at Index patch – an extension of smokris's patch. It will dig down to 3 levels to get the key, or 2 levels if you leave Index_2 input blank (not zero, blank = ""). Extensible as far down as you want.
@ usefuldesign.au I like and i trust your JS :) (no offense meant before it was more of a reflection on my own ability when it comes to javascript!). Its a VERY useful patch indeed. Something like this should be a stock patch.
This is the way I know.
Just modified it a bit to give me the top level key's
And it works like a charm, just what I needed.
Thanks!
No worries.
Yes, that was tailored to work for the xml file the XML Downloader patch defaults to: http://www.apple.com/main/rss/hotnews/hotnews.rss
As per comp in my other post (for future reference).
I've stop using this javascript method for Smokris 'structure ket at index' patch http://kineme.net/composition/smokris/StructureKeyIndex ;- i think subconsciously i trust smokris workings more than my own!
You may not trust my JS since I'm a new convert ;-). This is my super Structure Key at Index patch – an extension of smokris's patch. It will dig down to 3 levels to get the key, or 2 levels if you leave Index_2 input blank (not zero, blank = ""). Extensible as far down as you want.
@ usefuldesign.au I like and i trust your JS :) (no offense meant before it was more of a reflection on my own ability when it comes to javascript!). Its a VERY useful patch indeed. Something like this should be a stock patch.