Skip to main content
Topic: The contents of the Meta Data (File info) (Read 4307 times) previous topic - next topic

The contents of the Meta Data (File info)

I haven't used my NWC in almost 4 years. A little forgotten.
Is there an easy way to edit the contents of the Meta Data (File info) from hundreds of NWC files at once without opening them one by one?
The goal is to match the text contents of the Copyright Notice 1 and Copyright Notice 2 fields of hundreds of NWC files.
Please help me.

Re: The contents of the Meta Data (File info)

Reply #1
Two ideas (not yet solutions), from a programming guy:

(a) Save every file as nwctxt file - this, you would have to do manually (but see (b)). Then, someone (you?) can write a simple program to replace all those Copyrights (I would write an AWK script; but any programming language will do).

(b) There is a tool called AHK - AutoHotKey -, which allows to automate keypresses (and mouse moves, but NWC can be almost perfectly controlled from the computer keyboard). With it, one can write a script to edit those copyrights.

Edit:
AHK can be downloaded at https://www.autohotkey.com/download/2.0/. The download page is very long; what you want right now is the setup file AutoHotkey_2.0.10_setup.exe, way down on the page.

I have attached an AHK script (inside a .zip file, as this forum does not allow upload of .ahk files) that changes the copyrights of an open file and then saves and closes the file. To use it:
1.  Install AHK
2.  Save my script somewhere (by downloading and extracting the ZIP file)
3. Install ("run") the script, by double-clicking it
4. Open NWC and open a .NWC file in it (use a new test file, please)
5. Press "Alt"+"Windows"+C (that's what the !#C in the script means)
- -> the script will change the copyrights, save the file and close NWC.

To modify the copyright texts inserted by the script, edit the SendText lines in the .ahk file (e.g. with notepad). Then, do again steps 3...5. above (you will be asked whether the script should be replaced - just hit enter).
Maybe this is helpful as a starting point.

It is possible to write e.g. loops over files in AHK to fully automate what you want (but I don't know [yet] how to do that). However, I would do it manually file by file, even over hundreds of files - just to be sure that I handle the right files. The process would be:

a. copy all your NWC files to a temporary "working folder" (dont work on the originals ...);
b. mark the first file (by pressing space)
c. hit enter - this opens NWC with the file
d. hit Alt+Win+C - this changes the copyrights and closes NWC; you are now back in the folder view
e. hit space (this marks the next file; for some reason Windows advances the mark to the next file, which is nice for opening all the files one after the other  :D)
... and repeat from c.!
It's really quick - I tried it; about 2 seconds per file.

H.M.

Re: The contents of the Meta Data (File info)

Reply #2
(a) Save every file as nwctxt file - this, you would have to do manually
Nope. Use a batch file like this (adding path if needed):
Code: [Select · Download]
for %%a in (*.nwc) do "nwc2.exe" -convert "%%a" "%%a.nwctxt"

Then, someone (you?) can write a simple program to replace all those Copyrights (I would write an AWK script; but any programming language will do).
They are text files. Many serious editors (e.g. Notepad++) can do "replace in files" of text lines.

Re: The contents of the Meta Data (File info)

Reply #3
N.B. You can also do the reverse after the deed:
Code: [Select · Download]
for %%a in (*.nwctxt) do "nwc2.exe" -convert "%%a" "%%a.nwc"

Re: The contents of the Meta Data (File info)

Reply #4
Better:
Code: [Select · Download]
for %%a in (*.nwc) do "nwc2.exe" -convert "%%a" "%%~dpna.nwctxt"

Re: The contents of the Meta Data (File info)

Reply #5
Thank you H.M.
I will try it.

Re: The contents of the Meta Data (File info)

Reply #6
Thank you H.M.
I have tried and used it.
Greatfull.
It,s work for me.

rtm sibuea

Re: The contents of the Meta Data (File info)

Reply #7
I have used it for more than 980 *.nwc files.
I checked one by one, everything worked.


Re: The contents of the Meta Data (File info)

Reply #9
Both methods mentioned work well. I've tried both.
- If you only need to change a few files (less than 30 files), use AutoHotKey (AHK).
- If you have to do this for more files (more than 30), it is much faster and more effective to use the method of changing nwc files to nwctxt files. Use batch file help as mentioned by Mr. Flurmy. That's very fast.

rtm sibuea

Re: The contents of the Meta Data (File info)

Reply #10
Well... what I understood was that you checked "more than 980 *.nwc files one by one"!  :))