I needed the number of open tabs in NppExec script, and I found this way:
npp_sendmsg NPPM_GETNBOPENFILES 0 0 // = total, may be wrong +1 set local n ~ $(MSG_RESULT) npp_sendmsg NPPM_GETCURRENTDOCINDEX 0 0 // MainView, returns -1 if view is closed set local n ~ $(n) - ($(MSG_RESULT)<0) npp_sendmsg NPPM_GETCURRENTDOCINDEX 0 1 // SubView, returns -1 if view is closed set local n ~ $(n) - ($(MSG_RESULT)<0) echo $(n) // = right number of open tabsIf somebody knows simpler method, it’s very welcome.