Button to toggle comment in descript.ion?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
brontosaurusrex
Junior Member
Junior Member
Posts: 18
Joined: 2021-01-01, 17:56 UTC

Button to toggle comment in descript.ion?

Post by *brontosaurusrex »

I'd like to have a button to toggle a little text like '✓' or 'done' to comment section (descript.ion), how would i go about that? p.s. I've found cm_SetAttrib and ctrl+z, but not sure how or if possible to turn one of this into simple toggle.
User avatar
white
Power Member
Power Member
Posts: 4647
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Toggle comment?

Post by *white »

You can make a button to set the comment to 'done' and a button to remove it by using the OpenAttributes command. Search the Help and see if you can figure it out.
User avatar
Hacker
Moderator
Moderator
Posts: 13081
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Toggle comment?

Post by *Hacker »

brontosaurusrex,
Check this helpful post by tuska.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
brontosaurusrex
Junior Member
Junior Member
Posts: 18
Joined: 2021-01-01, 17:56 UTC

Re: Button to toggle comment in descript.ion?

Post by *brontosaurusrex »

white, Roman, thanks. The tuska post seems to describe single-click set to some value variant, so no toggle, but I'm gonna call this good enough and file under 'solved' :).
p.s. I've actually tried to write a bash script, but non-utf/non-unix line endings and possibility of multiline comments set via TC would make that hard to write.
User avatar
Hacker
Moderator
Moderator
Posts: 13081
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Button to toggle comment in descript.ion?

Post by *Hacker »

brontosaurusrex,
The tuska post seems to describe single-click set to some value variant, so no toggle
True, you'd need two buttons for that.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
tuska
Power Member
Power Member
Posts: 3786
Joined: 2007-05-21, 12:17 UTC

Re: Button to toggle comment in descript.ion?

Post by *tuska »

Here is the description for a second button.

Delete TC file comments without asking(!):

Code: Select all

OPENATTRIBUTES=Comment-DEL_for_Files&Folders
  1. "Change Attributes..." - Create template
    1. Position cursor on a file or folder where NO TC comment is present,
      press and hold the Ctrl key and position cursor on the "Files" menu,
      then release the Ctrl key.
    2. Click on Menu "Files" > "Change Attributes..." > ☑️ Change plugin attributes:
    3. Code: Select all

      Plugin:	  Property:   Value:
      tc	  comment     (leave blank!)
    4. F2 Load/save settings > Save settings: Comment-DEL_for_Files&Folders > OK, OK
    5. See: wincmd.ini - section [attrplugin]

      Code: Select all

      Comment-DEL_for_Files&Folders=tc.comment := ""
      
  2. Button (copy/paste onto your buttonbar)

    Code: Select all

    TOTALCMD#BAR#DATA
    OPENATTRIBUTES=Comment-DEL_for_Files&Folders
    
    wcmicon2.dll,40
    OPENATTRIBUTES=Comment-DEL_for_Files&Folders || DELETE TC file comments WITHOUT ASKING!|https://www.ghisler.ch/board/viewtopic.php?t=80031|https://www.ghisler.ch/board/viewtopic.php?t=79725
    
    
    -1
    
    
  3. Mark files and/or folders WITH TC-comments and click the button
  4. Attention: Any existing TC-comments will be deleted without asking(!).
Create a Button in the Buttonbar (copy/paste CODE)
  1. Click on "SELECT ALL" (to the right of CODE:), then press CTRL+C (copy to clipboard).
  2. Right-click on any place in the button bar, then click on "Paste".
     ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
  3. Option1: Point to the new button (slightly longer): 'Tooltip' is shown (-> description to the button).
                  A maximum of 259 characters is allowed for the tooltip. | = create line break, || = create | as separator character.
  4. Option2: Button bar - "Tooltip" field: A single space deactivates the display of the tooltip.
                  If the "Tooltip" field is empty, the content of the "Command" field is displayed.
  5. Option3: See FAQs and explanation: Button-code (TOTALCMD#BAR#DATA)  <-- <Ctrl+click on the link...>
User avatar
brontosaurusrex
Junior Member
Junior Member
Posts: 18
Joined: 2021-01-01, 17:56 UTC

Re: Button to toggle comment in descript.ion?

Post by *brontosaurusrex »

tuska, thanks. Did some more experimenting, trying to use '✓' with your method and somehow it doesn't stick, i get '?' instead when reopening 'files/change attributes menu trying to save the preset. I did set 'configuration/options/Operation/File comments - Preferred type to Unicode UTF8', but the behavior is the same, any clues?
User avatar
tuska
Power Member
Power Member
Posts: 3786
Joined: 2007-05-21, 12:17 UTC

Re: Button to toggle comment in descript.ion?

Post by *tuska »

brontosaurusrex wrote: 2023-09-05, 17:52 UTC ... Did some more experimenting, trying to use '✓' with your method and somehow it doesn't stick,
i get '?' instead when reopening 'files/change attributes menu trying to save the preset.

I did set 'configuration/options/Operation/File comments - Preferred type to Unicode UTF8',
but the behavior is the same, any clues?
Unfortunately, I don't know any solution at the moment.
But I am sure that someone will get back to you on this topic.
User avatar
white
Power Member
Power Member
Posts: 4647
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Button to toggle comment in descript.ion?

Post by *white »

brontosaurusrex wrote: 2023-09-05, 17:52 UTC Did some more experimenting, trying to use '✓' with your method and somehow it doesn't stick, i get '?' instead when reopening 'files/change attributes menu trying to save the preset.
Either a bug or not supported. Note that in the Change attributes dialog, if you change plugin field tc.comment and use the >> button to enter ✓, it also places ? in the value field.
User avatar
tuska
Power Member
Power Member
Posts: 3786
Joined: 2007-05-21, 12:17 UTC

Re: Button to toggle comment in descript.ion?

Post by *tuska »

I can only agree with what was said before...

Further example:
Configuration > Operation > File comments ...
  • Preferred type: Unicode UTF16
    wincmd.ini [Configuration] CommentPreferredFormat=1
    1. Ctrl+Z: ... OK
      Ctrl+Z displays '✓' as a TC file comment.
       
    2. OPENATTRIBUTES=Comment-OK_for_Files&Folders: ? ... Not OK?
      In the menu "Files" > Change Attributes... you can display '✓' if you do NOT click on '>>', but it cannot be saved.
      When trying to save '✓', only a ? is displayed although UNICODE is set.


Windows 11 Pro (x64) Version 22H2 (OS build Build 22621.2215) | TC 11.01 x64/x86
User avatar
tuska
Power Member
Power Member
Posts: 3786
Joined: 2007-05-21, 12:17 UTC

Re: Button to toggle comment in descript.ion?

Post by *tuska »

white wrote: 2023-09-05, 18:29 UTC
brontosaurusrex wrote: 2023-09-05, 17:52 UTC Did some more experimenting, trying to use '✓' with your method and somehow it doesn't stick, i get '?'
instead when reopening 'files/change attributes menu trying to save the preset.
Either a bug or not supported. ...
I would be interested in a statement on this subject, please.
User avatar
white
Power Member
Power Member
Posts: 4647
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Button to toggle comment in descript.ion?

Post by *white »

tuska wrote: 2023-09-12, 09:21 UTC
white wrote: 2023-09-05, 18:29 UTC Either a bug or not supported. ...
I would be interested in a statement on this subject, please.
I created a bug report here: viewtopic.php?t=80093

So soon, we will know.
User avatar
tuska
Power Member
Power Member
Posts: 3786
Joined: 2007-05-21, 12:17 UTC

Re: Button to toggle comment in descript.ion?

Post by *tuska »

tuska wrote: 2023-09-12, 09:21 UTC
white wrote: 2023-09-05, 18:29 UTC
brontosaurusrex wrote: 2023-09-05, 17:52 UTC Did some more experimenting, trying to use '✓' with your method and somehow it doesn't stick, i get '?'
instead when reopening 'files/change attributes menu trying to save the preset.
Either a bug or not supported. ...
I would be interested in a statement on this subject, please.
2white
Thanks for the bug report!
ghisler(Author) wrote: 2023-09-13, 09:15 UTC You are right, it doesn't currently support Unicode. Use Ctrl+Z instead. I will investigate the problem.
2ghisler(Author)
Thanks for investigating!
User avatar
tuska
Power Member
Power Member
Posts: 3786
Joined: 2007-05-21, 12:17 UTC

Re: Button to toggle comment in descript.ion?

Post by *tuska »

2ghisler(Author)
Thanks for the bug fixes.
HISTORY.TXT wrote:05.10.23 Release Total Commander 11.02 release candidate 1
13.09.23 Fixed: Change attributes: Field tc - comment didn't support setting Unicode comment (different codepage) (32/64)
HISTORY.TXT wrote:11.10.23 Release Total Commander 11.02 release candidate 2
06.10.23 Fixed: Change attributes: Field tc - comment didn't support setting Unicode comment via >> button (32/64)
The buttons listed here now work perfectly(!):
- Assign TC file comments "OK"
- Delete TC file comments without asking(!)

Note:
If you select several files or folders, you can assign a comment to them at the same time by pressing a button.


TC 11.02RC2 x64/x86
Post Reply