... in a (Lua) user tool?
Thx for any enlightenment!
If you save a song in NWCTXT format, you will see something like the following as the second line:
CaretIndex holds the cursor position when the file was saved. If there was an active selection, SelectIndex will hold that. I haven't figured out what CaretPos indicates.
I haven't verified this, but I would assume that this information is available if you are using file mode in the user tool.
I'd say CaretPos is how "high" the cursor is (like any other Pos) (whereas CaretIndex is its "x coordinate"). Unfortunately, I'm in clip mode for my user tool; and I would need the current cursor position - not the last saved one - anyway. Well, then this will be a option box ...
You are of course correct about CaretPos - it is in fact the vertical position on the staff.
I indicated a saved nwctxt file just as an example, but those values are also dynamically sent to a user tool. I would suggest running the "nwctxt File Explorer" user tool, which is installed as part of the NWC2 User Tool Starter Kit (https://noteworthycomposer.com/nwc2/usertools/). (You can find it under the .Developer Tools group). This is a handy tool for browsing the structure of a score from a user tool's perspective.
I seem to recall that it is possible for a clip text user tool to also access the score's file text, but I can't think of any examples off the top of my head. Hopefully one of the other user tool authors can provide an example.
I'm in clip mode for my user tool;
The cursor position is not available in Clip Mode. You would need to change your User Tool to use File Mode.
In File Mode, the '|Editor|...' info is for the the current view. It is possible to parse the '#/File:..' tag for the source file, if one exists.
This will not work for files opened via 'Open Sam
Thanks. I found that an additional prompt for the position is not really a problem, as pressing <enter> (for the default) or 12<enter> (for value 12) is practically as short as it gets ... So, I am happy, and have learned something.