October 13, 2024 at 3:45 pm #30064
Participant
Correction: One must test for eeStatusLatched.
#title = "Set the negative filter flag to inactive"
#language = "V8"
#async = "off"
// get the filter toolbar’s negative status (id 3916)
let negFilterStatus = editor.QueryStatusByID(3916);
// if negative is enabled → disable by toggling
if ((negFilterStatus & eeStatusLatched) === eeStatusLatched ) {
// case negative is enabled → run the toggle command
editor.ExecuteCommandByID(3916);
}
EmEditor Help: Negative (Filter Toolbar) command
EmEditor Help: QueryStatusByID Method
Regarding (negFilterStatus & eeStatusLatched) === eeStatusLatched
EmEditor uses bitwise flags for statuses. The & is a bitwise and.