About using the comment/descript.ion function from external script
Moderators: Hacker, petermad, Stefan2, white
About using the comment/descript.ion function from external script
is there any way of using the totalcmd comment function from an outside script (without any gui or further confirmation)?
or is there any fast way of settings descript.ion comments (which handles all the linebreaks, existing comments and all that stuff)?
or is there any fast way of settings descript.ion comments (which handles all the linebreaks, existing comments and all that stuff)?
Last edited by Stiltzkin on 2021-05-22, 17:52 UTC, edited 1 time in total.
Re: Abou using the comment/descript.ion function from external script
There is no problem to write anything into descript.ion
as long as your script follows the rules.
Of course its not a good idea to do that while Tc is updating the contents
because of file operations.
as long as your script follows the rules.
Of course its not a good idea to do that while Tc is updating the contents
because of file operations.
Windows 11 Home, Version 24H2 (OS Build 26100.4061)
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
Re: Abou using the comment/descript.ion function from external script
jeah, i have scripts that work "good enough", but i usuallycall them from inside totalcmd anways.
so i was wondering if i couldn't just use an existing function instead of implementing my own buggy one in every language i happen to be using.
calling a powershell/batch script from a totalcmd button which then calls a java app which modifies a descript.ion file is kinda silly when totalcmd has that functionality already inside.
so i was wondering if i couldn't just use an existing function instead of implementing my own buggy one in every language i happen to be using.
calling a powershell/batch script from a totalcmd button which then calls a java app which modifies a descript.ion file is kinda silly when totalcmd has that functionality already inside.
Re: Abou using the comment/descript.ion function from external script
Another workaround suggestion:
The descript.ion format was introduced by 4DOS, a command prompt alternative. It's successor - TCMD - has a free version, TCC/LE.
With that, you can:
The descript.ion format was introduced by 4DOS, a command prompt alternative. It's successor - TCMD - has a free version, TCC/LE.
With that, you can:
Code: Select all
tcc.exe /c describe "c:\path to\filename.txt" /D"some description"
Re: Abou using the comment/descript.ion function from external script
jeah, that's something i was looking for. shame it's not just a standalone *.exe.
and i think it doesn't have the same extended functionality as totalcmds comment feature has now (comment length, line breaks,[char]0x04 [char]0xC2)?
would be great if you could use those parameters for the totalcmd.exe.
and i think it doesn't have the same extended functionality as totalcmds comment feature has now (comment length, line breaks,[char]0x04 [char]0xC2)?
would be great if you could use those parameters for the totalcmd.exe.
Re: Abou using the comment/descript.ion function from external script
One(!) TC comment can also be assigned to several files/folders, e.g. as follows:Stiltzkin wrote: 2021-05-20, 11:59 UTC ... or is there any fast way of settings descript.ion comments ...?
- Mark files
- Menu "Files" - "Change Attributes..."
- [✓] Change plugin attributes:
Plugin Property Value
tc comment Click on ">>" - Enter TC-comment, "F2 OK", OK (so you can also delete TC-comments by deleting the comment and pressing F2...)
- The TC-comment was assigned to the files and the hidden file "descript.ion" was created in the same folder
- Attention1: If a file already has a TC-comment and this file has been marked again for example with other files,
and then a new/different TC-comment is entered, the previous TC comment is overwritten without a message! - Attention2: If you try to enter 2 or more TC comments via the "tc" plug-in, only the last TC comment will be assigned to the file(s)!
- It is recommended to save the setting for TC comments: "F2 Load/save settings" -> "Save settings".
- Don't forget to backup your 'descript.ion'-files
Re: Abou using the comment/descript.ion function from external script
jeah, i'm using that (with OPENATTRIBUTES from the buttonbar) since it was implemented (viewtopic.php?f=14&t=57060).tuska wrote: 2021-05-20, 22:52 UTCOne(!) TC comment can also be assigned to several files/folders, e.g. as follows:Stiltzkin wrote: 2021-05-20, 11:59 UTC ... or is there any fast way of settings descript.ion comments ...?
- Mark files
- Menu "Files" - "Change Attributes..."
- [✓] Change plugin attributes:
Plugin Property Value
tc comment Click on ">>"- Enter TC-comment, "F2 OK", OK (so you can also delete TC-comments by deleting the comment and pressing F2...)
- The TC-comment was assigned to the files and the hidden file "descript.ion" was created in the same folder
- Attention1: If a file already has a TC-comment and this file has been marked again for example with other files,
and then a new/different TC-comment is entered, the previous TC comment is overwritten without a message!- Attention2: If you try to enter 2 or more TC comments via the "tc" plug-in, only the last TC comment will be assigned to the file(s)!
- It is recommended to save the setting for TC comments: "F2 Load/save settings" -> "Save settings".
- Don't forget to backup your 'descript.ion'-files
but i need a quick way to set a comment for a file/folder without gui interaction from any source (buttonbar, batch, powershell, python,...)
like tcc.exe's describe feature but with totalcmds feature set.
Re: Abou using the comment/descript.ion function from external script
I did a *very* quick test. Line breaks are a simple \n, like first\nsecond. Special characters are possible too.Stiltzkin wrote: 2021-05-20, 23:18 UTC like tcc.exe's describe feature but with totalcmds feature set.
This should work:
Code: Select all
tcc.exe /c describe "c:\path to\filename.txt" /D"some description\nsecond line%@char[0x04]%@char[0xC2]"
But all will depend on how you integrate it, because typing all this is more work than any alternative.
Re: Abou using the comment/descript.ion function from external script
it works fine with ansi filenames, true.
i was testing it with "大 Test ✔ Tęśćt ✗ “Test” (Test) [Test].ext"
calling from AHK with:
result with tcc.exe: (DESCRIPT.ION is ANSI)
result with totalcmd gui: (descript.ion is UTF-8-BOM)
but it's a lot faster than any other implementation i've used so far.
i was testing it with "大 Test ✔ Tęśćt ✗ “Test” (Test) [Test].ext"
calling from AHK with:
Code: Select all
Run %ComSpec% /c "`"tcc.exe`" /c describe `"%FilePath%`" /D"%UserInput%`%@char[0x04]`%@char[0xC2]""
Code: Select all
"? Test ? Tesct ? "Test" (Test) [Test].mp4" This is a comment¶
Code: Select all
"大 Test ✔ Tęśćt ✗ “Test” (Test) [Test].mp4" This is a comment
Re: Abou using the comment/descript.ion function from external script
Too bad it doesn't work with unicode ...
The (somewhat) good news: you can impove the speed even further as at the moment you start ahk, which starts cmd, which starts tcc.
Running cmd is not needed; you can start tcc directly from ahk.
The (somewhat) good news: you can impove the speed even further as at the moment you start ahk, which starts cmd, which starts tcc.
Running cmd is not needed; you can start tcc directly from ahk.
Re: Abou using the comment/descript.ion function from external script
ran into some parameter escaping problems without the start from cmd.
i found out that you can set the codepage if you create a "TCSTART.BTM" next to the tcc.exe file.
for example:
then you get a UTF-8 DESCRIPT.ON with proper unicode characters from tcc.
but totalcmd doesn't recognize the DESCRIPT.ON until you change the UTF-8 DESCRIPT.ON to UTF8-BOM.
so jeah...
i found out that you can set the codepage if you create a "TCSTART.BTM" next to the tcc.exe file.
for example:
Code: Select all
CHCP 65001
but totalcmd doesn't recognize the DESCRIPT.ON until you change the UTF-8 DESCRIPT.ON to UTF8-BOM.
so jeah...

Re: Abou using the comment/descript.ion function from external script
Any reason you are not simply using AutoHotkey and the FileAppend option? Works with your "test file"
( I do it here viewtopic.php?f=6&t=73131 - using AHK to start another program to write something to a file is overly complicated if you ask me, just skip that step )
( I do it here viewtopic.php?f=6&t=73131 - using AHK to start another program to write something to a file is overly complicated if you ask me, just skip that step )
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Re: Abou using the comment/descript.ion function from external script
jeah, i'm toying around with a lot of languages. java, python, powershell/batch, ahk, c#. so i don't really want to implement that function over and over again (i did a few times - but it's noticable slow).hi5 wrote: 2021-05-22, 08:12 UTC Any reason you are not simply using AutoHotkey and the FileAppend option? Works with your "test file"
tcc.exe is basically something the thing i wanted - a fast *.exe callable from every type of script. but it's not 100% compatible with the totalcmd-generated descript.ion files.
- Vochomurka
- Power Member
- Posts: 816
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
Re: About using the comment/descript.ion function from external script
I've written at least 4 scripts for PowerPro that handle TC comments.
Left column, chapter "File Comments (descript.ion)"
Left column, chapter "File Comments (descript.ion)"
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
Re: About using the comment/descript.ion function from external script
can i call them from another program/script to set comments? never worked with powerpro before.Vochomurka wrote: 2021-05-23, 07:58 UTC I've written at least 4 scripts for PowerPro that handle TC comments.
Left column, chapter "File Comments (descript.ion)"