list

Sorting a structure randomly

biro's picture

Hi Guys! this is my first post. So forgive me if the question could seem stupid

I have a directory scanner that retrieve me the list of movies in a specific folder. I'd like to "randomize the order" of that list, so every time i trig the structure, i can scramble the order.

I've tried with javascript with something like this PHP Code: function (__structure out) main (__structure input){ if(input !=null){ var result=new Object(); result.out=input.sort(function(){return (Math.round(Math.random())-0.5)); return result; } }
but it doesen't work....and i don't know neither how to debug it...

Any solution???

Thanks

kineme structure to file and structure from file troubles

Swiftlikeninja's picture

Ok, Im using the structure to file plugin to write a plist of a structure that is 7500 indexes long. When I use the structure from file plugin to bring the plist back into quartz the structure is in no decernable order, is there any way to sort this list,

Ive tried the structure sort (not to sure on all the keys to use with it though) but it jumps the structure names and sorts the values which is not what I want.

the plist structure is laid out as follows

0:"quartzstructure_5987"=0.4985
1:"quartzstructure_10034"=0.5874

as I stated previously, only the final value would get sorted but I need the "quartzstructure_####" sorted instead.

If anybody could shed some light and assist me it would be greatly appreciated