AutoHotkey: Mark Important Files Permanently: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
(did not work with TC 8.50 / AHK 1.1.15.04 - control name changed to 'Edit1', also moved variable-declaration inside the #IfWinActive)
m (messed up the formating)
 
Line 7: Line 7:
tc -> comment -> contains -> ***  
tc -> comment -> contains -> ***  


 
#IfWinActive, ahk_class TTOTAL_CMD
#IfWinActive, ahk_class TTOTAL_CMD
^+z::
^+z::
PostMessage, 1075, 2700
PostMessage, 1075, 2700
WinWaitActive, ahk_class TCmtEditForm, , 1
WinWaitActive, ahk_class TCmtEditForm, , 1
If Errorlevel
If Errorlevel
  Return
  Return
Marker := "*** "
Marker := "*** "
ControlGetText, Comment, Edit1
ControlGetText, Comment, Edit1
StringLeft, Check, Comment, 4
StringLeft, Check, Comment, 4
If Check <> %Marker%
If Check <> %Marker%
  Comment := Marker Comment
  Comment := Marker Comment
Else
Else
  StringTrimLeft, Comment, Comment, 4
  StringTrimLeft, Comment, Comment, 4
ControlSetText, Edit1, %Comment%
ControlSetText, Edit1, %Comment%
SendInput, {F2}
SendInput, {F2}
Return
Return


{{translated|AutoHotkey: Wichtige Dateien dauerhaft markieren|AutoHotkey}}
{{translated|AutoHotkey: Wichtige Dateien dauerhaft markieren|AutoHotkey}}
[[Category:AutoHotkey scripts|Mark Important Files Permanently]]
[[Category:AutoHotkey scripts|Mark Important Files Permanently]]

Latest revision as of 13:57, 28 October 2014

Pressing Ctrl+Shift+Z marks/unmarks a file/folder by adding a string – defined in the variable Marker – to its comment (descript.ion file).

In order to colour these marked files and folders, have a look here:
Can_I_display_files_with_special_attributes,_directories_etc._in_a_different_color?

Switch to the Plugins tab and adjust the fields to look like that:
tc -> comment -> contains -> ***

#IfWinActive, ahk_class TTOTAL_CMD
^+z::
PostMessage, 1075, 2700
WinWaitActive, ahk_class TCmtEditForm, , 1
If Errorlevel
  Return
Marker := "*** "
ControlGetText, Comment, Edit1
StringLeft, Check, Comment, 4
If Check <> %Marker%
  Comment := Marker Comment
Else
  StringTrimLeft, Comment, Comment, 4
ControlSetText, Edit1, %Comment%
SendInput, {F2}
Return

Back to AutoHotkey