User Tools

Site Tools


autohotkey

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
autohotkey [2015/03/09 17:56] – [HotKeys] ginkoautohotkey [2015/03/09 18:34] (current) – [Functions] ginko
Line 31: Line 31:
 Un [[http://ahkscript.org/boards/viewtopic.php?f=6&t=303|GUI editor]] pour AHK ! Un [[http://ahkscript.org/boards/viewtopic.php?f=6&t=303|GUI editor]] pour AHK !
  
 +===== Auto Reload =====
 +A insérer dans le script lui-même. Ne pas oublier d'adapter le nom du fichier !
 +<code autohotkey>~^s:: ; Slf : Reload script on save
 +WinGetActiveTitle, Reload
 + If InStr(Reload, "myscript.ahk")
 + Reload
 +Return</code>
 +Fonctionne avec SciTE4AutoHotkey et Notepad++ at least.
 ===== Syntaxe ===== ===== Syntaxe =====
 ==== Affectation ==== ==== Affectation ====
Line 56: Line 64:
   * faire un hotlink sur ''Ctrl'' + ''Alt'' + '':'' = ''RAlt & SC034::''   * faire un hotlink sur ''Ctrl'' + ''Alt'' + '':'' = ''RAlt & SC034::''
   * faire un hotlink sur ''Ctrl'' + ''Alt'' + '' '' = ''RAlt & Space::''   * faire un hotlink sur ''Ctrl'' + ''Alt'' + '' '' = ''RAlt & Space::''
 +
 +==== Functions ====
 +
 +  * [[http://www.autohotkey.com/docs/Functions.htm|Functions]]
 +  * [[https://ginkobox.fr/vamp/index.php?tag=autohotkey|Snippets]]
 +
 +Petit précis :
 +<code autohotkey>MyFunc(ByRef Var1, ByRef Var2)
 +{
 +    if (Var1 = "A")
 +    {
 +        Var3 := 5 * Var2
 +        return Var3
 +    }
 +    else if (Var1 = "B")
 +        return true
 +    else
 +        return false
 +}</code>
 +==== Clipboard ====
 +[[http://www.autohotkey.com/docs/misc/Clipboard.htm|Clipboard]]
 +<code autohotkey>clipboard = my text   ; Give the clipboard entirely new contents.
 +clipboard =   ; Empty the clipboard.
 +clipboard = %clipboard%   ; Convert any copied files, HTML, or other formatted text to plain text.
 +clipboard = %clipboard% Text to append.   ; Append some text to the clipboard.
 +StringReplace, clipboard, clipboard, ABC, DEF, All   ; Replace all occurrences of ABC with DEF (also converts the clipboard to plain text).</code>
 ===== Travailler avec des buffers ===== ===== Travailler avec des buffers =====
 Un design pattern qui marche assez bien consiste à sérialiser des données dans des buffers ficher séparés via une ou plusieurs HotKeys puis de les utiliser dans d'autres HotKeys. Ces buffers évitent d'avoir à développer une logique complexe de sérialisation/parsing tout en permettant de vérifier facilement les contenus bufferisés. Un design pattern qui marche assez bien consiste à sérialiser des données dans des buffers ficher séparés via une ou plusieurs HotKeys puis de les utiliser dans d'autres HotKeys. Ces buffers évitent d'avoir à développer une logique complexe de sérialisation/parsing tout en permettant de vérifier facilement les contenus bufferisés.
autohotkey.1425920175.txt.gz · Last modified: 2015/03/09 17:56 by ginko