AutoHotkey: Inplace rename facilities: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 6: Line 6:
; #1 = Win Key + 1
; #1 = Win Key + 1
  #1::
  #1::
ControlGetFocus, ActiveControl, A
ControlGetFocus, ActiveControl, A
Send, ^c
Send, ^c
StringLower, lowercase_string, clipboard
StringLower, lowercase_string, clipboard
Send, %lowercase_string%
Send, %lowercase_string%
Return  
Return  


;First letter uppercase
;First letter uppercase
  #2::
  #2::
ControlGetFocus, ActiveControl, A
ControlGetFocus, ActiveControl, A
Send, ^c
Send, ^c
StringLower, lowercase_string, clipboard
StringLower, lowercase_string, clipboard
StringLeft, first_letter_of_string, lowercase_string, 1
StringLeft, first_letter_of_string, lowercase_string, 1
StringUpper, first_letter_of_string_uppercase, first_letter_of_string
StringUpper, first_letter_of_string_uppercase, first_letter_of_string
StringTrimLeft, rest_of_string, lowercase_string, 1
StringTrimLeft, rest_of_string, lowercase_string, 1
Send, %first_letter_of_string_uppercase%%rest_of_string%
Send, %first_letter_of_string_uppercase%%rest_of_string%
Return  
Return  


;First Of Each Word Uppercase
;First Of Each Word Uppercase
  #3::
  #3::
ControlGetFocus, ActiveControl, A
ControlGetFocus, ActiveControl, A
Send, ^c
Send, ^c
;StringUpper, OutputVar, InputVar [, T]  
;StringUpper, OutputVar, InputVar [, T]  
;StringLower, OutputVar, InputVar [, T]  
;StringLower, OutputVar, InputVar [, T]  
;[, T] = If the parameter is the letter T, the string will be converted to title case.
;[, T] = If the parameter is the letter T, the string will be converted to title case.
StringLower, first_each_word_uppercase_string, clipboard, T
StringLower, first_each_word_uppercase_string, clipboard, T
Send, %first_each_word_uppercase_string%
Send, %first_each_word_uppercase_string%
Return  
Return  


;ALL UPPERCASE
;ALL UPPERCASE
  #4::
  #4::
ControlGetFocus, ActiveControl, A
ControlGetFocus, ActiveControl, A
Send, ^c
Send, ^c
StringUpper, uppercase_string, clipboard
StringUpper, uppercase_string, clipboard
Send, %uppercase_string%
Send, %uppercase_string%
Return  
Return  


;Replace Space by Underscore
;Replace Space by Underscore
#5::
#5::
  ControlGetFocus, ActiveControl, A
ControlGetFocus, ActiveControl, A
  Send, ^c
Send, ^c
  ;StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]   
;StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]   
  StringReplace, string_space2underscore, clipboard, %A_SPACE%, _, All
StringReplace, string_space2underscore, clipboard, %A_SPACE%, _, All
  Send, %string_space2underscore%
Send, %string_space2underscore%
Return  
Return  


;Replace Underscore by Space (Remove Underscore)
;Replace Underscore by Space (Remove Underscore)
#6::
#6::
  ControlGetFocus, ActiveControl, A
ControlGetFocus, ActiveControl, A
  Send, ^c
Send, ^c
  ;StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]   
;StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]   
  StringReplace, string_underscore2space, clipboard, _, %A_SPACE%, All
StringReplace, string_underscore2space, clipboard, _, %A_SPACE%, All
  Send, %string_underscore2space%
Send, %string_underscore2space%
Return
Return


;Replace Dot by Space (Remove Underscore)
;Replace Dot by Space (Remove Underscore)
#7::
#7::
  ControlGetFocus, ActiveControl, A
ControlGetFocus, ActiveControl, A
  Send, ^c
Send, ^c
  ;StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]   
;StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]   
  StringReplace, string_underscore2space, clipboard, ., %A_SPACE%, All
StringReplace, string_underscore2space, clipboard, ., %A_SPACE%, All
  Send, %string_underscore2space%
Send, %string_underscore2space%
Return
Return


;Replace \ by /  
;Replace \ by /  
#8::   
#8::   
  ControlGetFocus, ActiveControl, A
ControlGetFocus, ActiveControl, A
  Send, ^c
Send, ^c
  ;StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]   
;StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]   
  StringReplace, string_underscore2space, clipboard, \, /, All
StringReplace, string_underscore2space, clipboard, \, /, All
  Send, %string_underscore2space%
Send, %string_underscore2space%
Return
Return


Back to [[AutoHotkey]]
Back to [[AutoHotkey]]

Revision as of 10:06, 2 May 2006

Set of small AHK scripts allowing to perform different tasks in Inplace rename field (or any other place).

UPPERCASE LOWERCASE UNDERSCORE FACILITIES###
All lowercase
#1 = Win Key + 1
#1::

ControlGetFocus, ActiveControl, A Send, ^c StringLower, lowercase_string, clipboard Send, %lowercase_string% Return

First letter uppercase
#2::

ControlGetFocus, ActiveControl, A Send, ^c 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 Send, %first_letter_of_string_uppercase%%rest_of_string% Return

First Of Each Word Uppercase
#3::

ControlGetFocus, ActiveControl, A Send, ^c

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 Send, %first_each_word_uppercase_string% Return

ALL UPPERCASE
#4::

ControlGetFocus, ActiveControl, A Send, ^c StringUpper, uppercase_string, clipboard Send, %uppercase_string% Return

Replace Space by Underscore
#5::

ControlGetFocus, ActiveControl, A Send, ^c

StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]

StringReplace, string_space2underscore, clipboard, %A_SPACE%, _, All Send, %string_space2underscore% Return

Replace Underscore by Space (Remove Underscore)
#6::

ControlGetFocus, ActiveControl, A Send, ^c

StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]

StringReplace, string_underscore2space, clipboard, _, %A_SPACE%, All Send, %string_underscore2space% Return

Replace Dot by Space (Remove Underscore)
#7::

ControlGetFocus, ActiveControl, A Send, ^c

StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]

StringReplace, string_underscore2space, clipboard, ., %A_SPACE%, All Send, %string_underscore2space% Return

Replace \ by /
#8::  

ControlGetFocus, ActiveControl, A Send, ^c

StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]

StringReplace, string_underscore2space, clipboard, \, /, All Send, %string_underscore2space% Return

Back to AutoHotkey