*AutoHotkey [#h82df47d]
#contents
**概要 [#adea700f]
[[AutoHotkeyを流行らせるページ:http://lukewarm.s101.xrea.com/]]より~
>
 AutoHotkeyはホットキーへの機能の割り当てなど常駐ソフトの作成に特化したスクリプトエンジンである。
 多彩なコマンドが用意されており、GUIを持ったプログラムの作成も可能。
 GNU GENERAL PUBLIC LICENSE Version 2の下で配布されるフリーソフトで、C++で作られている。
 公式サイト(http://www.autohotkey.com/)にて、インストーラー版とZIPアーカイブ版の2種類が配布されている。
 インストーラーを実行すると、スタートメニュー、新規作成メニュー、関連付けに変更が加えられる。 

-自動化 - 所謂マクロ。 
-ホットキー - スクリプトを常駐、特定のキーやボタンが押されたときにひとつ、あるいは複数の機能を割り当て。
-[[Hotstring:http://lukewarm.s101.xrea.com/Hotstrings.html]] - 日本語での利用には多少工夫が必要。
-GUI - GUI を設定できる。CUIのソフトのフロントエンドなどはおてのもの。 
-[[リマップ:http://lukewarm.s101.xrea.com/remap.html]] - キーやボタンをリマップできる。 特定のウィンドウやウインドウ毎にリマップすることも可能。
-実行ファイル - スクリプトを実行ファイルに変換可能。AHKがインストールされてない環境でも利用可能になるので他者への配布も容易に。

詳しい特徴と機能についての紹介は [[AutoHotkeyを流行らせるページ → イントロダクション:http://lukewarm.s101.xrea.com/Introduction.html]] でされています。

//''初心者の場合''、作業の省力化、効率化、自動化などを目的にホットキーへの機能の割り当て、キーボードリマップ、マクロを組む、といった用途でAHK(AutoHotkey)を利用するのは問題ないんですが、(きっかけとしてはありかもしれませんが)'''プログラミング学習目的'''でAHKの選択はしない方が賢明だと思います。

**スクリプト [#e4410784]
//解説待ち

**DllCall [#b8001daa]
ホットキーへの機能の割り当て以外に、GUIがあり、[[DllCall():http://lukewarm.s101.xrea.com/commands/DllCall.html]](AutoHotkeyを流行らせるページ)がかなり強力な事もあり(向き不向きはありますが)大抵の事は出来ると思います。

//解説待ち

-→[[参考リンク>#yc223dfb]]

**COM [#xe018ac5]
COM([[Component Object Model - Wikipedia:http://ja.wikipedia.org/wiki/Component_Object_Model]])を利用する事も出来ます。

//解説待ち

-→[[参考リンク>#udcd699d]]

**FAQ [#kcda885c]
本家:AutoHotkeyを流行らせるページ →[[FAQのスレ:http://lukewarm.s101.xrea.com/test/read.cgi/bbs/1200674082/]]
***文字化け?ダメ文字? [#oc2f06dc]
:[[AutoHotkey スレッド part6:http://pc11.2ch.net/test/read.cgi/software/1219130051/]]より~|
>
 Q:「~AチЯ㌔荏柿義形港餐汁秦疏蛋伝覗描冒輿倭兪啻嫣彖拜杼歔」を含む文字列がうまく扱えないよ
 A:これらの文字の2バイト目が、AHKのエスケープ文字である0x60[`]なため。
   対処としてはこれらの文字の"直後"に「`」を記述する(例:「線形`代数」)か、
   #EscapeCharでエスケープ文字を別のものに変えるべし。 

::関連|
[[エスケープ文字:http://lukewarm.s101.xrea.com/Scripts.htm#escape]]、
[[AutoHotkey - #EscapeChar (and discussion of escape sequences):http://lukewarm.s101.xrea.com/commands/_EscapeChar.htm]] (ともにAutoHotkeyを流行らせるページ)

対策用の関数、ライブラリは[[参考リンク>ダメ文字問題対策>#w52e9b62]]を参照。

***コンパイルした実行ファイルがアンチウイルスソフトに怒られるんだけど? [#ia1516a8]
Compile_AHK II([[mini info > Compile_AHK II>#v3454dba]]) を試してみて下さい(08年12月14日現在)。"No UPX"オプションがあるので、UPXで圧縮しないでコンパイルしてみて下さい。
もしかしたら改善されるかもしれません。~
関連用語:[[実行ファイル圧縮>プログラミング用語#exe_comp-ja]]

//{{追加お願いします。}}

**参考リンク [#la6d4373]
:[[AutoHotkey - Free Mouse and Keyboard Macro Program with Hotkeys and AutoText:http://www.autohotkey.com/]]|
公式サイト
:[[AutoHotkeyを流行らせるページ:http://lukewarm.s101.xrea.com/]]|
日本に於ける総本山

***スクリプト [#v67b1dcd]
:[[AutoHotkey Script Showcase:http://www.autohotkey.com/docs/scripts/]]|
代表的なスクリプト。
:[[AutoHotkey wiki - Category:Scripts - AutoHotkey:http://www.autohotkey.com/wiki/index.php?title=Category:Scripts]]|
目当てのスクリプト(の記事)を見つけるのに[[Forum:http://www.autohotkey.com/forum/]]から検索して探すのが大変なら、先ずこのページにあるリンクからあたってみましょう。

:[[AutoHotkeyを流行らせるページ → My Scripts:http://lukewarm.s101.xrea.com/myscripts/index.html]]|
AutoHotkeyを流行らせるページの管理人さんが作成したスクリプト、ライブラリ各種。

***DllCall [#yc223dfb]
:[[API Wrappers - AutoHotkey wiki:http://www.autohotkey.com/wiki/index.php?title=API_Wrappers]]|
WinAPI関連:WinAPI ( [[Windows API - Wikipedia:http://ja.wikipedia.org/wiki/Windows_API]] )(Windowsが提供するさまざまな機能)にアクセス出来ます。

:[[Windows Data Types lookup tool - Autohotkey forums:http://www.autohotkey.com/forum/viewtopic.php?t=12036]]|
WinAPI関連:補助ツール

:[[Crazy Scripting : A handy tool to lookup Win32 Constants - Autohotkey forums:http://www.autohotkey.com/forum/topic19766.html]]|
WinAPI関連:補助ツール "W32C_R01.CSV is a listing of 11836 Constants"

:[[Easy WinAPI - WinAPI Parser, DllCall with single hotkey - Autohotkey forums:http://www.autohotkey.com/forum/viewtopic.php?t=33464]]|
WinAPI関連:補助ツール

:[[StructParser (for C/C++ structs) - Autohotkey forums:http://www.autohotkey.com/forum/viewtopic.php?t=27644]]|
補助ツール: →[[Known Issues - Autohotkey forums:http://www.autohotkey.com/forum/post-172883.html&sid=9497a16de8656b80cdf59bb961cb2ec1#172883]]

:[[OpenGL DllCalls - Autohotkey forums:http://www.autohotkey.com/forum/topic31078.html&sid=aedbea1e05c43ff9162903c45407c8d2]]|
OpenGL in AHK.~
関連:[[Zippos OpenGL - AHK 3D-Engine. - Autohotkey forums(独語):http://de.autohotkey.com/forum/topic3977.html&sid=c0317e48d9b3089947041249d742ac60]]→[[操作解説(英語)-Keys - Autohotkey forums:http://www.autohotkey.com/forum/post-233842.html&sid=9d3510f63696c83c85be97d91f0a2253#233842]]

***COM [#udcd699d]
:[[COM Wrappers - AutoHotkey wiki:http://www.autohotkey.com/wiki/index.php?title=COM_Wrappers]]|
いくつかCOMラッパーの提供もされています。

:[[COM Standard Library - Autohotkey forums:http://www.autohotkey.com/forum/topic22923.html&highlight=ws4ahk+ahk&sid=fb965ac2c916550b56c4a6b092c416a6]]|
→ [[関数ライブラリスクリプト:http://lukewarm.s101.xrea.com/Function.html#library]]、[[#Include:http://lukewarm.s101.xrea.com/commands/_Include.html]] (ともにAutoHotkeyを流行らせるページ)

:[[Embed an Internet Explorer control in your AHK Gui via COM - Autohotkey forums:http://www.autohotkey.com/forum/viewtopic.php?t=19225]]|
"This is a standard library for IE/WebBrowser controls."~
関連:[[IE and Gui Browser Com Tutorial - Autohotkey forums:http://www.autohotkey.com/forum/topic34972.html&sid=571b0156e248dca403d12412d3502571]]

:[[Windows Scripting for Autohotkey - official homepage:http://www.autohotkey.net/~easycom/]]|
"Embed VBScript or JScript directly in your Autohotkey programs."~
[[Embedded Windows Scripting (VBScript & JScript) and COM - official thread in the Autohotkey forums:http://www.autohotkey.com/forum/topic21674.html]]

:[[AutoHotkeyを流行らせるページ → My Scripts → ActiveX:http://lukewarm.s101.xrea.com/myscripts/index.html]]|
WSH等で使われるActiveXObjectを扱えるようにする

***ダメ文字問題対策 [#w52e9b62]
-[[新・なまず日記(2006-01-11) - AutoHotkeyのダメ文字問題対策:http://www.tierra.ne.jp/~aki/diary/?date=20060111#p01]]
-[[(AutoHotkey)(IMEの制御をする 編) - もらかなです。:http://d.hatena.ne.jp/morakana/20080213/1202876561]]
-[[クリップボードを使わないで全角文字を貼付ける - eamatの日記:http://d.hatena.ne.jp/eamat/20050921/p1]]
-[[AutoHotkeyでマルチバイト(全角)文字を文字化けなしで出力する関数 - ナレッジデータベース モバイル:http://it.kndb.jp/m/entry/id/1188]]

***デバッグ あれこれ [#c2514e63]
:[[AutoHotkeyを流行らせるページ → スクリプト → スクリプトのデバッグ:http://lukewarm.s101.xrea.com/Scripts.html]]|
スクリプトが期待通りに動作しているかを確認するには

:[[AutoHotkeyを流行らせるページ → リファレンス → OutputDebug:http://lukewarm.s101.xrea.com/commands/OutputDebug.html]]|
デバッガ(DebugView for Windowsなど)に文字列を出力

:[[Debugging - Autohotkey forums:http://www.autohotkey.com/forum/topic23678.html&highlight=debugview&sid=0a79db6b51152cae18afddfaa7e71364]]|
Debug helper スクリプト など

:[[Debug() [Func] - Autohotkey forums:http://www.autohotkey.com/forum/topic31416.html&highlight=debug&sid=632cf754985f59737c010cfc4aa11122]]|
>
 if you're working with #Include files
 function must be called from itself rather than calling from d.ahk
 to show correct info for currently executing function/filename 

:[[debugging using A_LIneNumber - Autohotkey forums:http://www.autohotkey.com/forum/topic24397.html&highlight=debugview&sid=0a79db6b51152cae18afddfaa7e71364]]|
RunDebugView.ahk - DebugView for Windowsを利用。

:[[Gui, Show bug - Autohotkey forums:http://www.autohotkey.com/forum/topic17316.html&highlight=debugview&sid=0a79db6b51152cae18afddfaa7e71364]]|
Trace.ahk - DebugView for Windowsを利用。

:関連ツール:[[DebugView for Windows - © Microsoft Corporation.:http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx]]|
デバッグトレースを表示
::使い方 - 参考:|[[差をつけるデバッグ術! ~ 知られざるログ出力 - プログラミング徹底解説:http://keicode.com/windows/win15.php]]

**mini info [#v3454dba]
:[[Beta version pre-v1.0.48: Up to 3x faster performance - Autohotkey forums:http://www.autohotkey.com/forum/viewtopic.php?t=38034]]|
赤くは無いけど、AutoHotkey本体のBetaバージョン(pre-v1.0.48)は三倍速くなってるそうです。

:[[Compile_AHK II - for those who compile! - Autohotkey forums:http://www.autohotkey.com/forum/topic22975.html&sid=33358f6aa787500258f3d79fa92411f3]]|
([[Update of 2008-11-05 以降:http://www.autohotkey.com/forum/post-228565.html&sid=9889f936104bf1bec3108a8a07787c4d#228565]])"No UPX"オプションが付きました。~
コンパイラ[[最新版(Update of 2008-11-25):http://www.autohotkey.com/forum/post-233126.html&sid=33358f6aa787500258f3d79fa92411f3#233126]]~
(コンパイラそのものは公式サイトで配布されているものには標準で付いて来ます)
[[Update of 2008-11-05:http://www.autohotkey.com/forum/post-228565.html&sid=9889f936104bf1bec3108a8a07787c4d#228565]] 以降、"No UPX"オプションが付いています。~
//コンパイラ[[最新版(Update of 2008-11-25):http://www.autohotkey.com/forum/post-233126.html&sid=33358f6aa787500258f3d79fa92411f3#233126]]~
(コンパイラそのものは公式サイトで配布されているものに標準で付いて来ます)

:[[SciTE4AutoHotkey - メニューの日本語化and日本語入力:http://www8.uploader.jp/dl/vipprog/vipprog_uljp00625.txt.html]]|
SciTE をAutoHotkey用に最適化された [[SciTE4AutoHotkey:http://www.autohotkey.net/~fincs/SciTE4AutoHotkey/index.htm]] の日本語化手順。~
Forum内のスレッド:[[SciTE4AutoHotkey - New version:http://www.autohotkey.com/forum/topic19323.html]]

:[[ironahk - Google Code:http://code.google.com/p/ironahk/]]|
クロスプラットホーム向けに開発が進められているAutoHotkeyのフォーク。~
Forum内のスレッド:[[IronAHK - .NET port of AutoHotkey for Windows, Linux, Mac...:http://www.autohotkey.com/forum/topic34421.html]]


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS