October 14, 2024 at 7:35 am #30067
Participant
The VBScript Command is
editor.ExecuteCommandByID 3916
EmEditor Help: Negative (Filter Toolbar) command
——————————————————————-
The JavaScript above expressed as VBScript is
#title = "Set the negative filter flag to inactive"
#language = "VBScript"
#async = "off"
' get the filter toolbar’s negative status (id 3916)
Dim negFilterStatus
negFilterStatus = editor.QueryStatusByID(3916)
' if negative is enabled -> disable by toggling
If ((negFilterStatus And eeStatusLatched) = eeStatusLatched) Then
' case negative is enabled → run the toggle command
editor.ExecuteCommandByID 3916
End If
——————————————————————-
VBScript code to set all filters to 0 is (its ugly, couldn`t think of something better):
#title = "Set the negative filter flag to inactive"
#language = "VBScript"
#async = "off"
' reset the filters list
Dim filtersList
Set filtersList = document.filters
filtersList.Clear
filtersList.Add "dummy", False, 0, 0 ' add a single item with all flags set to 0 (off)
document.filters = filtersList ' apply the filter → flags are now 0
filtersList.Clear ' remove the filter again (removes ‘dummy’)
document.filters = filtersList ' empty filter + the flags stay as they are
——————————————————————-
Note that VBScript is deprecated.