Nested @ifset?

Hi, i want to switch to single lister view when the viewer panel is open and switch back to dual view when the panel is closed. Can i make nested @ifset blocks and if it isn't possible could someone make this work as a script?

[code]@ifSet: DUAL=on

@ifset:FOCUS=Right
@set glob:LastFocusRight=1
@ifset:else
@set glob:LastFocusRight
@ifset:common

Set DUAL=Remember,Dest,off
Set VIEWPANE=on
Select THIS

@ifset:else

Set DUAL=Remember,Dest,on
Set VIEWPANE=off
Select THIS

@ifset:$glob:LastFocusRight
Go SWAP
@ifset:common

@ifset:common[/code]

Doing it as a script probably makes most sense.

How do you plan to trigger this? Do you want it to happen automatically when the viewer is opened and closed (a script add-in can do that, but you might not want it if you need to override it sometimes)? Or do you only want a special button/hotkey that toggles between the two states?

i triggered this with "File Type Groups" for images and Event: "Left double click". I would make it as a script but i don't know anything about that.