Difference between revisions of "AutoHotkey: Inplace rename facilities"

From TotalcmdWiki
Jump to: navigation, search
(Save clipboard contents)
Line 27: Line 27:
 
   Clipboard := saved_clipboard
 
   Clipboard := saved_clipboard
 
   saved_clipboard = ; Free the memory in case the clipboard was very large.
 
   saved_clipboard = ; Free the memory in case the clipboard was very large.
  Return  
+
  Return
  
 
;First Of Each Word Uppercase
 
;First Of Each Word Uppercase
Line 107: Line 107:
 
   saved_clipboard = ; Free the memory in case the clipboard was very large.
 
   saved_clipboard = ; Free the memory in case the clipboard was very large.
 
  Return
 
  Return
 +
 +
;Add date at end of a filename
 +
#d::
 +
  FormatTime, TimeString,,_(dd_MMM_yyyy_hhmm)
 +
  Send %TimeString%
 +
return
  
 
{{translated|AutoHotkey: Umbenennbox: verschiedene Spezialfunktionen|AutoHotkey}}
 
{{translated|AutoHotkey: Umbenennbox: verschiedene Spezialfunktionen|AutoHotkey}}

Revision as of 12:37, 26 June 2006

Set of small AHK scripts allowing to perform different tasks (uppercase, lowercase, add or remove underscore ... from the highlighted file in Inplace rename field). It can also be used anywhere else just highlight the text you want to modify and press WinKey+1 or WinKey+2 ...

All lowercase
;#1 -> Win Key + 1
#1::
  saved_clipboard := ClipboardAll
  ControlGetFocus, ActiveControl, A
  Send, ^c
  ClipWait
  StringLower, lowercase_string, clipboard
  SendRaw, %lowercase_string%
  Clipboard := saved_clipboard
  saved_clipboard = ; Free the memory in case the clipboard was very large.
Return 
First letter uppercase
#2::
  saved_clipboard := ClipboardAll
  ControlGetFocus, ActiveControl, A
  Send, ^c
  ClipWait
  StringLower, lowercase_string, clipboard
  StringLeft, first_letter_of_string, lowercase_string, 1
  StringUpper, first_letter_of_string_uppercase, first_letter_of_string
  StringTrimLeft, rest_of_string, lowercase_string, 1
  SendRaw, %first_letter_of_string_uppercase%%rest_of_string%
  Clipboard := saved_clipboard
  saved_clipboard = ; Free the memory in case the clipboard was very large.
Return
First Of Each Word Uppercase
#3::
  saved_clipboard := ClipboardAll
  ControlGetFocus, ActiveControl, A
  Send, ^c
  ClipWait
  ;StringUpper, OutputVar, InputVar [, T] 
  ;StringLower, OutputVar, InputVar [, T] 
  ;[, T] = If the parameter is the letter T, the string will be converted to title case.
  StringLower, first_each_word_uppercase_string, clipboard, T
  SendRaw, %first_each_word_uppercase_string%
  Clipboard := saved_clipboard
  saved_clipboard = ; Free the memory in case the clipboard was very large.
Return 
ALL UPPERCASE
#4::
  saved_clipboard := ClipboardAll
  ControlGetFocus, ActiveControl, A
  Send, ^c
  ClipWait
  StringUpper, uppercase_string, clipboard
  SendRaw, %uppercase_string%
  Clipboard := saved_clipboard
  saved_clipboard = ; Free the memory in case the clipboard was very large.
Return 
Replace Space by Underscore
#5::
  saved_clipboard := ClipboardAll
  ControlGetFocus, ActiveControl, A
  Send, ^c
  ClipWait
  ;StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]  
  StringReplace, string_space2underscore, clipboard, %A_SPACE%, _, All
  SendRaw, %string_space2underscore%
  Clipboard := saved_clipboard
  saved_clipboard = ; Free the memory in case the clipboard was very large.
Return 
Replace Underscore by Space (Remove Underscore)
#6::
  saved_clipboard := ClipboardAll
  ControlGetFocus, ActiveControl, A
  Send, ^c
  ClipWait
  ;StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]  
  StringReplace, string_underscore2space, clipboard, _, %A_SPACE%, All
  SendRaw, %string_underscore2space%
  Clipboard := saved_clipboard
  saved_clipboard = ; Free the memory in case the clipboard was very large.
Return
Replace Dot by Space (Remove Underscore)
#7::
  saved_clipboard := ClipboardAll
  ControlGetFocus, ActiveControl, A
  Send, ^c
  ClipWait
  ;StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]  
  StringReplace, string_underscore2space, clipboard, ., %A_SPACE%, All
  SendRaw, %string_underscore2space%
  Clipboard := saved_clipboard
  saved_clipboard = ; Free the memory in case the clipboard was very large.
Return
Replace \ by /
#8::  
  saved_clipboard := ClipboardAll
  ControlGetFocus, ActiveControl, A
  Send, ^c
  ClipWait
  ;StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]  
  StringReplace, string_underscore2space, clipboard, \, /, All
  SendRaw, %string_underscore2space%
  Clipboard := saved_clipboard
  saved_clipboard = ; Free the memory in case the clipboard was very large.
Return
Add date at end of a filename
#d::
  FormatTime, TimeString,,_(dd_MMM_yyyy_hhmm)
  Send %TimeString% 
return

Back to AutoHotkey