listing particular types of ops from script?

Hi all,

I need to run a script that will give me a list of components in the current network level and feed them to a foreach in order to do use opparm on each one.

I thought lc might be the one but it throws up an error and stops there. It would be nice if it could just ignore operators for whom the parameter is irrelevant.

more specifically, I want to enable or disable many panels at once as well as toggle their visibility.

any clues.

rod.

foreach i ( `execute("lc")` ) if (`strcmp(opsubtype("$i"),"panel")==0`) opparm $i ... endif end

this should list & pick out the panels in your network.

Selina

thanks Selina,

I’m also trying to go through a project and lock each moviein TOP and set its file parameter to “”

(to send an example file for a bug report :slight_smile:

I got the syntax wrong but can’t think how to fix it (tired with deadline looming as usual)
" /project1/text1 (line 2 - if (strcmp(optype("$i"),"moviein")==0)): Expression error: Bad path argument"

[code]foreach i ( execute("lc -R") )
if (strcmp(optype("$i"),"TOP:moviein")==0)

opset $i -l on
opparm $i file ( "" )

endif
end[/code]

unfortunately, lc doesn’t list full paths, and you are also running into problems with empty strings in the foreach. below is a working example. note that the script should be excecuted in the component you want to recurse through, and the script is called recursively to execute in the current path. hope this helps.

[code]foreach i ( execute("lc") )
if (strcmp("$i","")==0)
break;
endif

set net = `opfullpath(".")`
if (`strcmp(optype("$i"),"TOP:moviein")==0`)
	echo "	do stuff to " $net/$i

else if (`strmatch("COMP:*",optype("$i"))`)
	echo "	go in network " $net/$i
	cc $i
	run -c $arg0
	cc ..
endif

end
[/code]

Thanks Selina,

I think I need to make sure I do a little scripting once a week just so my head stays in that mindset long enough to start rememberings stuff. :slight_smile:

are folks still thinking of switching to python? that would be cool but not without problems.

looking forward to it if it’s happeing though.

rod.