Skip to main content
Topic: User Object suggestion: filesystem metadata with option to be a watermark. (Read 8086 times) previous topic - next topic

User Object suggestion: filesystem metadata with option to be a watermark.

Hi peoples,
I've just read the update from SEBC in this topic:
https://forum.noteworthycomposer.com/?topic=9684.0
and it got me to thinking.

Is there anything in the lua environment, NWC libraries, the user object environment, or any other method to allow one to extract file system metadata?

If such a thing is possible then it should be possible to create an object that can print selected metadata.

I envisage such an object would allow the user to print selected info, like the filename, last modified date and time, maybe even file size etc..  I also see this object being able to be selectively printed as a watermark, with user controlled scaling to enable coverage up to the whole page and at a selectable angle.
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: User Object suggestion: filesystem metadata with option to be a watermark.

Reply #1
I think we've discussed this sometime ago - and I think the answer is no, you can't access file system metadata. Actually, my working understanding of NWC's Lua subsystem is that you can exactly call the documented functions, nothing else - just because the backing Lua libraries of other functions are not bundled with NWC.

H.M.

Re: User Object suggestion: filesystem metadata with option to be a watermark.

Reply #2
I think we've discussed this sometime ago - and I think the answer is no, you can't access file system metadata. Actually, my working understanding of NWC's Lua subsystem is that you can exactly call the documented functions, nothing else - just because the backing Lua libraries of other functions are not bundled with NWC.
How about without lua?  Are user objects possible without using lua?

E.G. VBscript can be used to create user tools.  Can it, or any other language, be used to create user objects, and can it be used to extract the *filesystem metadata for the currently open file?

* I know it will return such metadata using OS calls, can such calls be made specifying the currently open file from within NWC?
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: User Object suggestion: filesystem metadata with option to be a watermark.

Reply #3
How about without lua?  Are user objects possible without using lua?

I am almost certain the answer to this is "no".  User tools can be written using any number of languages and subsystems, but tools are invoked directly by the user. User objects are invoked by NWC itself, while the score is being viewed, edited, played or printed, and I know of no other mechanism for calling or creating user objects other than the Lua framework that has been documented by NWC.

 

Re: User Object suggestion: filesystem metadata with option to be a watermark.

Reply #4
I am almost certain the answer to this is "no".  User tools can be written using any number of languages and subsystems, but tools are invoked directly by the user. User objects are invoked by NWC itself, while the score is being viewed, edited, played or printed, and I know of no other mechanism for calling or creating user objects other than the Lua framework that has been documented by NWC.
Hi Mike,
I had a look at the lua website and found a link to the lua binaries site ( http://luabinaries.sourceforge.net/ ) which in turn had a link to:
lua for Windows: https://github.com/rjpcomputing/luaforwindows
which includes a bunch of libraries.  Might one of these libraries be of assistance in accessing the metadata and able to be installed to NWC?

OTOH, this is starting to seem like too much work for too little actually useful return...
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: User Object suggestion: filesystem metadata with option to be a watermark.

Reply #5
Quote

OTOH, this is starting to seem like too much work for too little actually useful return...


While that may be true, experience gained may be useful to open up new horizons in scripting.

Re: User Object suggestion: filesystem metadata with option to be a watermark.

Reply #6
I had a look at the lua website and found a link to the lua binaries site ( http://luabinaries.sourceforge.net/ ) which in turn had a link to:
lua for Windows: https://github.com/rjpcomputing/luaforwindows
which includes a bunch of libraries.  Might one of these libraries be of assistance in accessing the metadata and able to be installed to NWC?

Lua integration requires that the programmer of, in this case, NWC adds certain Lua libraries. If he doesn't do that, you can't use them. If he does it, he should (and, looking at NWC's object documentation, would and will) document it. From this, "it follows" that it's not possible to use any Lua file etc. functions.

The only way it could work differently is when their are bugs in the Lua systems and/or its integration into NWC. But we wouldn't want to base objects on bugs, would we?

H.M.

Re: User Object suggestion: filesystem metadata with option to be a watermark.

Reply #7
Thanks guys, perhaps Eric will see this and possibly consider it worthwhile incorporating access to the needed library(ies).

Of course, it would need much more than my simple suggestion to justify it.  TBH I'm not sure I'd even have a need personally, I was mainly thinking about SEBC's problem.
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: User Object suggestion: filesystem metadata with option to be a watermark.

Reply #8
I have an idea for a tool I could write in the Python language, with which you could do some or all of the the following things:

- Add the 'date modified' to the File info comments.
- Insert a User Object 'PageTxt.nw'(+ PageTxtMaestro.nw, if not yet present) in the first not-hidden staff, that will print the' date modified' at the bottom left of each page.
- Save a read-only copy of the file with the date modified (or a 'blocking date'?) added as suffix to the file name.

A second (or the same tool) could take the read-only file as input, and save a new, writable version with an extra suffix to indicate the 'unblocking date'.
Always look on the bright side of life!

Re: User Object suggestion: filesystem metadata with option to be a watermark.

Reply #9
See the topic in the user tool subforum:File Organization
Always look on the bright side of life!