2016-06-14 9 views
0

私はかなり体系化されたワークフローがあり、常に同じ名前が必要な画像があります。それはPNG(ポータブルネットワークグラフィックス)であり、それがデスクトップ上かフォルダ内かにかかわらず常にあります。AutoHotkey - 名前を変更するには、画像を選択してショートカットを押すだけで名前を変更してください。

ので、私はちょうど画像を選択したいと1文字のショートカット(例えば「L」)と名前を変更しは(関係なく、それは以前の名前です)、「LAYOUT」

答えて

0
F2:: 
ClipSaved := ClipboardAll  ; save the entire clipboard to the variable ClipSaved 
clipboard := ""     ; empty clipboard 
Send, ^c      ; copy the selected file 
ClipWait, 1      ; wait for the clipboard to contain data 
if (!ErrorLevel)    ; If NOT ErrorLevel clipwait found data on the clipboard 
{ 
    clipboard := clipboard  ; convert to text (= copy the path of the selected file) 
    Sleep, 300 
    ; MsgBox, %clipboard%  ; display the path 
    if (SubStr(clipboard, -2) != "png") 
    { 
     MsgBox, No PNG-file selected 
     clipboard := ClipSaved 
      return 
    } 
    ; otherwise: 
    SplitPath, clipboard, name, dir 
    FileMove, %clipboard%, %dir%\LAYOUT.png 
    Sleep, 100 
    clipboard := ClipSaved  ; restore original clipboard 
} 
else 
{ 
    MsgBox, No file selected 
    clipboard := ClipSaved 
} 
return 
+0

に「user3419297」あなたは神です!ありがとう! – Curioucity

関連する問題