Button to toggle Dual Display and associated icons

Extreme newbie here trying to learn my way around this program's extremely rich feature set.

I would like to create a toolbar button that does the following with the "Dual Display" view:

  1. If Dual Display is OFF, the button turns it on.
  2. If Dual Display is ON, the button toggles between horizontal and vertical layout.
  3. I also want the icon to change from one image when the layout is single, then to a second image when dual horizontal and yet another image when dual vertical. (I know how to assign an icon to a button but not how to toggle it when the lister state changes.)

The script below is my best effort, but it didn't work. Thanks for any help you can provide.

@ifset:DUAL=Off Prefs STYLE=ToggleLayout @ifset:Else Prefs STYLE=Dual

I just tried..

@ifset:dual Set DUAL=horiz,toggle @ifset:else Set DUAL=toggle
..but Set DUAL=horiz,toggle does not switch to horizontal (for me) when dual vertical is active, which is what I expected. It just switches dual off. This is on the latest v12 Beta. The help file says:


Regards, AB

[code]@icon:window,DUAL=off
@icon:dualdisplay,DUAL=vert
@icon:dualhorizontal,DUAL=horiz

@ifset:DUAL=vert
Set DUAL=horiz
@ifset:else
Set DUAL=vert[/code]

Thank you. Not just for correcting my script, but for helping with my understanding of the syntax.