2017-11-27 9 views
1

どのように私はオートセットコマンドに単語を作ることができますか?単語をオートセットコマンドにする方法 - ホットストリングセットオルタナティブ

このコードは、私は、キーボードのホットキーの組み合わせを入力する場合にのみ機能します(私はAutoItのコードを実行する単語を入力します。)

HotKeySet例:

HotKeySet (“{F1}”, “calc”) 

Func calc() 
Local $iPID = ShellExecute (“calc.exe”) 
EndFunc 

はHotstringset代替はあります。

私は今autohotkeyでコマンドに任意の単語を作ることができます。

AutoHotkeyを言語の例:私はAutoHotkeyをコードを実行するカルク入力した場合

:*:calc:: 
run calc.exe 
return 

答えて

2

これでオートチェンジャコマンドに任意の単語を入力できます。

ステップ1 - ここでHotStringSet.zipファイルをダウンロードできます。 (HotString.au3に付属)HotKeySet vs HotStringSet

ステップ2 - それはパスCに手動HotString.au3をコピー+解凍します - 今、あなたは準備ができている\プログラムファイル(x86の)\ AutoIt3 \は

ステップ3を含めます任意の自動スクリプトでHotStringSetを使用します。あなたがワードパッドで、たとえば、キーボード上の任意のテキストを入力することができます

enter image description here

:タイプCALC +スペースを、それは電卓を実行すると、あなたはKBC +スペースを入力した場合、それはキーボードコントロールにテキストKBCに置き換えられますし、 pi + Spaceと入力すると、テキストpiがSymbol piに置き換えられます。

このオートスタイルコードを記述してください。

#include <HotString.au3> 

HotKeySet ('{F1}', 'quit') 

HotStringSet('kbc{SPACE}', replace1) 
HotStringSet('pi{SPACE}', replace2) 
HotStringSet('calc{SPACE}', replace3) 

Func quit() 
Exit 
EndFunc 

Func replace1() 
;MsgBox(0,'','You did typed kbc! :)') 
send ('{BS 4}keyboard control ') ; replace [kbc] into [keyboard control] 
EndFunc 

Func replace2() 
;MsgBox(0,'','You did typed pi! :)') 
send ('{BS 3}{ASC 960} ') ; replace [pi] into [symbol p] 
EndFunc 

Func replace3() 
;MsgBox(0,'','You did typed calc! :)') 
Local $iPID = ShellExecute ('calc.exe') ; If you type calc it wil run the application calculator. 
EndFunc 

While 1 
Sleep(10) 
WEnd 
関連する問題