AutoHotkey: CopyNamesToClipWithoutExt: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
m (interwiki added)
(Rewritten using AHK improvements like RegEx syntax)
Line 1: Line 1:
This script copies the filenames to the clipboard using the internal command cm_CopyNamesToClip, then removes the extension parts from the clipboard.
/*
'''''Ctrl+Alt+Shift+C''''' copies the filenames to the clipboard using the internal command cm_CopyNamesToClip,
then removes the extension parts from the clipboard.
*/


  ; Activates with Ctrl-Alt-Shift-C
  #IfWinActive, ahk_class TTOTAL_CMD
  $^!+c::
  ^!+c::                             ;*** Adjust hotkey when needed
  IfWinActive, ahk_class TTOTAL_CMD
  PostMessage, 1075, 2017
{
Return
PostMessage, 1075, 2017
Loop, Parse, Clipboard, `n, `r
OnClipboardChange:
{
Clipboard := RegExReplace(Clipboard, "(.+)\..+", "$1")
StringGetPos, DotPos, A_LoopField, ., R
StringLeft, TempString, A_LoopField, %DotPos%
TempClip = %TempClip%%TempString%`r`n
}
Clipboard = %TempClip%
Return
}
Send, ^!+c
  Return
  Return


{{translated|AutoHotkey: Kopiere Dateinamen ohne Erweiterung in die Zwischenablage|AutoHotkey}}
{{translated|AutoHotkey: Kopiere Dateinamen ohne Erweiterung in die Zwischenablage|AutoHotkey}}

Revision as of 06:49, 21 November 2007

/*
Ctrl+Alt+Shift+C copies the filenames to the clipboard using the internal command cm_CopyNamesToClip,
then removes the extension parts from the clipboard.
*/
#IfWinActive, ahk_class TTOTAL_CMD
^!+c::                              ;*** Adjust hotkey when needed
PostMessage, 1075, 2017
Return

OnClipboardChange:
Clipboard := RegExReplace(Clipboard, "(.+)\..+", "$1")
Return

Back to AutoHotkey