Wednesday, August 13, 2008

AHK - Function Linker for forums

This is a script I just threw together that will replace names of functions and built-in variables with links to the online documentation. For example, when I type MsgBox it replaces it with [url=http://www.autohotkey.com/docs/commands/MsgBox.htm]MsgBox[/url].

Toggles suspend with the insert key, suspends when you type [code] and un-suspends when you type [/code].

*Note - I left out the special loops because the didn't have a standard page (yes, I'm lazy, might add them later). I also left out the "If var" commands because I didn't feel like including them
#Hotstring NoMouse
SendMode, Input

; ----------
; Toggle Keys
; ----------
~Insert::Suspend
:*b0?:[code]::
Suspend On
Return
:*b0?:[/code]::
Suspend Off
Return

; ----------
; Built in variables
; ----------
::A_AhkPath::
::A_AhkVersion::
::A_AppData::
::A_AppDataCommon::
::A_AutoTrim::
::A_BatchLines::
::A_CaretX::
::A_CaretY::
::A_ComputerName::
::A_ControlDelay::
::A_Cursor::
::A_DD::
::A_DDD::
::A_DDDD::
::A_DefaultMouseSpeed::
::A_Desktop::
::A_DesktopCommon::
::A_DetectHiddenText::
::A_DetectHiddenWindows::
::A_EndChar::
::A_EventInfo::
::A_ExitReason::
::A_FormatFloat::
::A_FormatInteger::
::A_Gui::
::A_GuiControl::
::A_GuiControlEvent::
::A_GuiEvent::
::A_GuiHeight::
::A_GuiWidth::
::A_GuiX::
::A_GuiY::
::A_Hour::
::A_IconFile::
::A_IconHidden::
::A_IconNumber::
::A_IconTip::
::A_Index::
::A_IPAddress::
::A_IsAdmin::
::A_IsCompiled::
::A_IsSuspended::
::A_KeyDelay::
::A_Language::
::A_LastError::
::A_LineNumber::
::A_LoopField::
::A_LoopFileAttrib::
::A_LoopFileDir::
::A_LoopFileExt::
::A_LoopFileLongPath::
::A_LoopFileName::
::A_LoopFileShortName::
::A_LoopFileShortPath::
::A_LoopFileSize::
::A_LoopFileSizeKB::
::A_LoopFileSizeMB::
::A_LoopFileTimeAccessed::
::A_LoopFileTimeCreated::
::A_LoopFileTimeModified::
::A_LoopReadLine::
::A_LoopRegKey::
::A_LoopRegName::
::A_LoopRegSubKey::
::A_LoopRegTimeModified::
::A_LoopRegType::
::A_MDay::
::A_Min::
::A_MM::
::A_MMM::
::A_MMMM::
::A_Mon::
::A_MouseDelay::
::A_MSec::
::A_MyDocuments::
::A_Now::
::A_NowUTC::
::A_NumBatchLines::
::A_OSType::
::A_OSVersion::
::A_PriorHotkey::
::A_ProgramFiles::
::A_Programs::
::A_ProgramsCommon::
::A_ScreenHeight::
::A_ScreenWidth::
::A_ScriptDir::
::A_ScriptFullPath::
::A_ScriptName::
::A_Sec::
::A_Space::
::A_StartMenu::
::A_StartMenuCommon::
::A_Startup::
::A_StartupCommon::
::A_StringCaseSense::
::A_Tab::
::A_Temp::
::A_ThisFunc::
::A_ThisHotkey::
::A_ThisLabel::
::A_ThisMenu::
::A_ThisMenuItem::
::A_ThisMenuItemPos::
::A_TickCount::
::A_TimeIdle::
::A_TimeIdlePhysical::
::A_TimeSincePriorHotkey::
::A_TimeSinceThisHotkey::
::A_TitleMatchMode::
::A_TitleMatchModeSpeed::
::A_UserName::
::A_WDay::
::A_WinDelay::
::A_WinDir::
::A_WorkingDir::
::A_YDay::
::A_Year::
::A_YWeek::
::A_YYYY::
Var := RegExReplace(A_ThisHotkey,"^::A_","")
Send, [url=http://www.autohotkey.com/docs/Variables.htm{#}%Var%]A_%Var%[/url]%A_EndChar%
Return


; ----------
; Built in functions
; ----------
::Abs()::
::ACos()::
::Asc()::
::ASin()::
::ATan()::
::Ceil()::
::Chr()::
::Cos()::
::DllCall()::
::Exp()::
::FileExist()::
::Floor()::
::GetKeyState()::
::InStr()::
::IsLabel()::
::Ln()::
::Log()::
::Mod()::
::NumGet()::
::NumPut()::
::OnMessage()::
::RegExMatch()::
::RegExReplace()::
::RegisterCallback()::
::Round()::
::Sin()::
::SubStr()::
::Sqrt()::
::StrLen()::
::Tan()::
::VarSetCapacity()::
::WinActive()::
::WinExist()::
Var := RegExReplace(A_ThisHotkey,"^::(.*)\(\)$","$1")
Send, [url=http://www.autohotkey.com/docs/Functions.htm{#}%Var%]%Var%()[/url]%A_EndChar%
Return


; ----------
; # Commands
; ----------
::#AllowSameLineComments::
::#ClipboardTimeout::
::#CommentFlag::
::#ErrorStdOut::
::#EscapeChar::
::#HotkeyInterval::
::#HotkeyModifierTimeout::
::#Hotstring::
::#IfWinActive::
::#IfWinExist::
::#IfWinNotActive::
::#IfWinNotExist::
::#Include::
::#IncludeAgain::
::#InstallKeybdHook::
::#InstallMouseHook::
::#KeyHistory::
::#LTrim::
::#MaxHotkeysPerInterval::
::#MaxMem::
::#MaxThreads::
::#MaxThreadsBuffer::
::#MaxThreadsPerHotkey::
::#NoEnv::
::#NoTrayIcon::
::#Persistent::
::#SingleInstance::
::#UseHook::
::#WinActivateForce::
Var := RegExReplace(A_ThisHotkey,"^::#","")
Send, [url=http://www.autohotkey.com/docs/commands/_%Var%.htm]#%Var%[/url]%A_EndChar%
Return


; ----------
; Commands
; ----------
::AutoTrim::
::BlockInput::
::Break::
::Click::
::ClipWait::
::Continue::
::Control::
::ControlClick::
::ControlFocus::
::ControlGet::
::ControlGetFocus::
::ControlGetPos::
::ControlGetText::
::ControlMove::
::ControlSend::
::ControlSendRaw::
::ControlSetText::
::CoordMode::
::Critical::
::DetectHiddenText::
::DetectHiddenWindows::
::Drive::
::DriveGet::
::DriveSpaceFree::
::Edit::
::Else::
::EnvAdd::
::EnvDiv::
::EnvGet::
::EnvMult::
::EnvSet::
::EnvSub::
::EnvUpdate::
::Exit::
::ExitApp::
::FileAppend::
::FileCopy::
::FileCopyDir::
::FileCreateDir::
::FileCreateShortcut::
::FileDelete::
::FileGetAttrib::
::FileGetShortcut::
::FileGetSize::
::FileGetTime::
::FileGetVersion::
::FileInstall::
::FileMove::
::FileMoveDir::
::FileRead::
::FileReadLine::
::FileRecycle::
::FileRecycleEmpty::
::FileRemoveDir::
::FileSelectFile::
::FileSelectFolder::
::FileSetAttrib::
::FileSetTime::
::FormatTime::
::GetKeyState::
::Gosub::
::Goto::
::GroupActivate::
::GroupAdd::
::GroupClose::
::GroupDeactivate::
::Gui::
::GuiControl::
::GuiControlGet::
::Hotkey::
::IfEqual::
::IfExist::
::IfGreater::
::IfGreaterOrEqual::
::IfInString::
::IfLess::
::IfLessOrEqual::
::IfMsgBox::
::IfNotEqual::
::IfNotExist::
::IfNotInString::
::IfWinActive::
::IfWinExist::
::IfWinNotActive::
::IfWinNotExist::
::ImageSearch::
::IniDelete::
::IniRead::
::IniWrite::
::Input::
::InputBox::
::KeyHistory::
::KeyWait::
::ListHotkeys::
::ListLines::
::ListVars::
::Loop::
::Menu::
::MouseClick::
::MouseClickDrag::
::MouseGetPos::
::MouseMove::
::MsgBox::
::OnExit::
::OutputDebug::
::Pause::
::PixelGetColor::
::PixelSearch::
::PostMessage::
::Process::
::Progress::
::Random::
::RegDelete::
::RegRead::
::RegWrite::
::Reload::
::Repeat::
::Return::
::Run::
::RunAs::
::RunWait::
::Send::
::SendEvent::
::SendInput::
::SendMessage::
::SendMode::
::SendPlay::
::SendRaw::
::SetBatchLines::
::SetCapslockState::
::SetControlDelay::
::SetDefaultMouseSpeed::
::SetEnv::
::SetFormat::
::SetKeyDelay::
::SetMouseDelay::
::SetNumlockState::
::SetScrollLockState::
::SetStoreCapslockMode::
::SetTimer::
::SetTitleMatchMode::
::SetWinDelay::
::SetWorkingDir::
::Shutdown::
::Sleep::
::Sort::
::SoundBeep::
::SoundGet::
::SoundGetWaveVolume::
::SoundPlay::
::SoundSet::
::SoundSetWaveVolume::
::SplashImage::
::SplashTextOff::
::SplashTextOn::
::SplitPath::
::StatusBarGetText::
::StatusBarWait::
::StringCaseSense::
::StringGetPos::
::StringLeft::
::StringLen::
::StringLower::
::StringMid::
::StringReplace::
::StringRight::
::StringSplit::
::StringTrimLeft::
::StringTrimRight::
::StringUpper::
::Suspend::
::SysGet::
::Thread::
::ToolTip::
::Transform::
::TrayTip::
::URLDownloadToFile::
::WinActivate::
::WinActivateBottom::
::WinClose::
::WinGet::
::WinGetActiveStats::
::WinGetActiveTitle::
::WinGetClass::
::WinGetPos::
::WinGetText::
::WinGetTitle::
::WinHide::
::WinKill::
::WinMaximize::
::WinMenuSelectItem::
::WinMinimize::
::WinMinimizeAll::
::WinMinimizeAllUndo::
::WinMove::
::WinRestore::
::WinSet::
::WinSetTitle::
::WinShow::
::WinWait::
::WinWaitActive::
::WinWaitClose::
::WinWaitNotActive::
Var := RegExReplace(A_ThisHotkey,"^::","")
Send, [url=http://www.autohotkey.com/docs/commands/%Var%.htm]%Var%[/url]%A_EndChar%
Return


*Note - See my post on the AHK Forums Here

No comments: