<div dir="ltr">Thanks very much guys- I'll get back to this when I have a spare moment and let you know how I get on. <div><br></div><div style>Cheers,<br>Stu</div><div style><br></div></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Wed, May 22, 2013 at 11:06 AM, Albert-Jan Roskam <span dir="ltr"><<a href="mailto:fomcl@yahoo.com" target="_blank">fomcl@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
><br>
<br>
>forobjectinobjects:sorted(set(object.split('_',1)[0]))cmds.menuItem(label =object,parent ="objectMenu")<br>
<br>
<br>
"sorted" returns the sorted list but you don't assign anything to it. You can either assign it to a variable, or use the .sort method instead. Also, you don't need to specify the maxsplit argument (1) in .split. Also, you used 'object' as a loop index but this is a reserved word. Why not use the more descriptive "for filename in filenames"?<br>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><a href="http://stutozer.elementfx.com/" target="_blank">http://stutozer.elementfx.com/</a><div><br></div><div><br></div>
</div>