Get Read filename through switch


#1

I want get the filename through a Switch op to using as expression in a Write node.

I get the path and filename with [value Read1.file] but I need evaluate the which knob of Switch1 for return me the filename of the active Read node.

I thinking in a code like this but “transcode” to valid expression in Nuke.

if (Switch1.which == 0) {
 value Read1.file
}else
if (Switch1.which == 1) {
 value Read2.file
}else
if (Switch1.which == 2) {
 value Read3.file
}