Inspired by code snippets provided by Kundal and TBone, here is a VBScript user command to count the number of lines in eligible selected files and display the results in a pop-up. Selected folders are ignored and selected files are tested for eligibility against a built-in list of file extensions.
To install, simply save the attached Line Counter.osp to your Directory Opus Script Addins folder. This will add a $LC command which can then be invoked from a button. See below for a sample of what the output looks like. Note that this code uses the recently added DOpus MAP object to test for eligible file extensions. You must be using at least v11.5.1 for this to work.
Line Counter v1.1.osp (1.37 KB)