AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Very Small AHK Editing Macro

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
bigboehmboy



Joined: 26 May 2009
Posts: 15

PostPosted: Wed Jan 06, 2010 2:34 pm    Post subject: Very Small AHK Editing Macro Reply with quote

I'm sure many of you already have some sort of macro like this, but I thought I'd share anyway. It definitely comes in handy when editing AHK scripts.

The script does 1 of 3 things:
If the window in focus is the AHK script (in a text editor): Save the script and reload AHK
Else, If the AHK script is open in a text editor: Switch to that window
Else: open the AHK script.

Code:
SetTitleMatchMode, 2
F9::
   IfWinActive, AutoHotkey.ahk
   {
      SendInput ^s
      reload
   }
   else
   {
      IfWinExist, AutoHotkey.ahk
      {
         WinActivate
      }
      else
      {
         Run notepad C:\Documents and Settings\mboehm2\My Documents\AutoHotkey.ahk
      }
   }
   return


If anyone wanted to run this, they'd have to of course change the path to point to their AHK script. Note that I set the TitleMatchMode to match partial titles since I will edit a script in various word processors sometimes.

I've got a few slightly less trivial scripts on my home desktop which I hope to post later, but thought I'd put this one up now.
Back to top
View user's profile Send private message Send e-mail
tonne



Joined: 06 Jun 2006
Posts: 1651
Location: Denmark

PostPosted: Wed Jan 06, 2010 2:39 pm    Post subject: Re: Very Small AHK Editing Macro Reply with quote

bigboehmboy wrote:
If anyone wanted to run this, they'd have to of course change the path to point to their AHK script.

Use A_ScriptFullPath
_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2
Back to top
View user's profile Send private message
bigboehmboy



Joined: 26 May 2009
Posts: 15

PostPosted: Wed Jan 06, 2010 6:32 pm    Post subject: Reply with quote

Ooh, thanks for the tip!
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group