ScriptSpot

Forum topic · Scripts Wanted

delete empty named selection sets

By jsrocha · 2013-08-07

Description

Hi guys, i need a script to clean unused named selection sets. I use this tool a lot, and max keeps the list from the last opened files, so i often need to delete each one by hand.
I don´t know if is hard to wrote a script like this, but if someone want to try, i´ll be thankfull! ;)
cheers,

Jsrocha

Comments (2)

barigazy · 2013-08-07

Here we go

try(destroyDialog ::bgaRoll)catch()
rollout bgaRoll "C-E-S"
(
button btn "Clear Empty Sets" pos:[5,5] width:100 height:20
on btn pressed do
(
if selectionSets.count != 0 do for s = selectionSets.count to 1 by -1 where selectionSets[s].count == 0 do deleteItem selectionSets s
)
)
createDialog bgaRoll 110 30 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)

jsrocha · 2013-08-07

Hey Barigazy, thanks a lot, works just fine!!
Cheers man,

Jsrocha