Is there some way to access to an object type Lister (especifically the current active Lister) from a OnClick function?
I ask because as I read the scripting info, the only way is via DOpus.Listers, althought you retrieve all the Listers, and there's no way to know who Lister is the current active(the one where OnCLick() applies), so there's no way to create Lister variables.
Ex. I want to do a hotkey/button that open/close the viewpane, with some modifications:
If the Viewpane is off, then:
first set a boolean variable (VIEWPANEDUAL) based on if dual is on or off.
If dual is on, turn it off, and then set a boolean variable (VIEWPANESWAP) based of if source is on left or right.
After that, turn on the viewpane.
If the VIewpane is on, then:
Close the viewpane.
if VIEWPANEDUAL is true, turn dual on
if VIEWPANEDUAL and VIEWPANESWAP are true, do a swap.
In Dopus 10, I achieve this with an Autohotkey Script, however in DO11 I decide to do it via a script, but there's no way to create/set Lister variables, since you (supposed you have 2 Listers with the same tabs,toolbars, selected items,etc) can't get the current Lister object.
Any help?. Here are the code:
Function OnClick(ByRef ClickData)
'I don't understand why this should be swapped,
If (ClickData.Func.Command.IsSet("VIEWPANE=Off")) Then
'if this says True, means that is on :?
DOpus.OutputString("VIEWPANE is on")
DOpus.OutputString("VIEWPANE is off")
Dim dual, swap
dual = false
swap = false
If DOpus.vars.Exists("VIEWPANEDUAL") Then
dual = DOpus.vars.Get("VIEWPANEDUAL")
'If the variable VIEWPANEDUAL is false, means that before open the viewpane,
'dual was off.
'We have to ask if currently dual is off, in case that was open it by the user after the viewpane
If (ClickData.Func.Command.IsSet("DUAL=Off")) and dual Then
If DOpus.vars.Exists("VIEWPANESWAP") Then
swap = DOpus.vars.Get("VIEWPANESWAP")
If swap Then
'If dual is on means that we have to close dual first (but with remember option)
If (ClickData.Func.Command.IsSet("DUAL=Off")) Then
DOpus.OutputString("dual is off")
DOpus.vars.Set "VIEWPANEDUAL", false
DOpus.OutputString("dual is on")
DOpus.vars.Set "VIEWPANEDUAL", true
'If the source tab is in the right, means we have to swap it after close the viewpane
If ClickData.Func.sourcetab.right Then
DOpus.vars.Set "VIEWPANESWAP", true
DOpus.vars.Set "VIEWPANESWAP", false
Perhaps if on a OnClick() function, you can access to a Lister object the same way as it is with the DOpus object?