Create file comment by external command/script

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Davey_D
Junior Member
Junior Member
Posts: 18
Joined: 2015-12-15, 23:29 UTC

Create file comment by external command/script

Post by *Davey_D »

Hi, I was wondering if there is some type of command that can be used from the command line/script that can add comments to files
I often have to add comments to multiple files and this would be a great help.

Is this possible?

Thanks,
Davey
User avatar
nsp
Power Member
Power Member
Posts: 1952
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Create comment by command/script

Post by *nsp »

Davey_D wrote:Hi, I was wondering if there is some type of command that can be used from the command line/script that can add comments to files
I often have to add comments to multiple files and this would be a great help.

Is this possible?

Thanks,
Davey
If you work on a single folder with descript.ion
The easiest way is to edit the descipt.ion file using filenames stored into clip.
A) you can make a user command to edit the descript.ion file from current folder (ex em_editComments notepad descript.ion)
You can than create as new command that call both:
cm_CopyNamesToClip , em_editComment
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3896
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

I often have to add comments to multiple files
The official way to do it, is to use file attributes:

1. select all the files you want to comment
2. Choose "Files - Change attributes" from main menu
3. Click on "More attributes" => "tc - comment" appears
4. enter the comment into edit field
5. Press "OK" to apply comment to files

Note: works for search results or bulk list (Ctrl-B) too
#5767 Personal license
Davey_D
Junior Member
Junior Member
Posts: 18
Joined: 2015-12-15, 23:29 UTC

Post by *Davey_D »

HI guys, thanks for your responses; Nice things that I didnt know about!
However, in this question, I was actually referring to doing this by external scripting.
I.e., I have a program which creates some files into a folder, and I would like to be able to insert a comment at file creation (by the program)

Is this possible?

Thanks,
Davey

(I dont know if this matters, but I'm using C# and Python)
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

Davey_D wrote: I.e., I have a program which creates some files into a folder, and I would like to be able to insert a comment at file creation (by the program)

Is this possible?
Yes, as mentioned above already: modify the file "descript.ion" with your app.




 
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

Your string for multiline TC descriptions should look like this (C#):

Code: Select all

'"filename with spaces.txt"' + ' ' + 'Description Line 1\nDescription Line 2' + (char)'\x0004' + (char)'\x00C2'
plus CRLF in any form.
Post Reply