{"id":55128,"date":"2022-03-13T03:01:59","date_gmt":"2022-03-12T17:01:59","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=55128"},"modified":"2022-03-11T22:04:41","modified_gmt":"2022-03-11T12:04:41","slug":"windows-autohotkey-dynamic-compile-procedure-program-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-dynamic-compile-procedure-program-tutorial\/","title":{"rendered":"Windows AutoHotKey Dynamic Compile Procedure Program Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/calculator.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Windows AutoHotKey Dynamic Compile Procedure Program Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/windows-calculator-dynamic-autohotkey-script-execution.gif\" title=\"Windows AutoHotKey Dynamic Compile Procedure Program Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Windows AutoHotKey Dynamic Compile Procedure Program Tutorial<\/p><\/div>\n<p>There might be more to do with the Windows AutoHotKey Script Program creator tool we&#8217;ve been developing up to yesterday&#8217;s <a title='Windows AutoHotKey Dynamic Compile Procedure Content Tutorial' href='#wahkdcpct'>Windows AutoHotKey Dynamic Compile Procedure Content Tutorial<\/a>, but, today, we take a step sideways and roadtest that tool.<\/p>\n<p>We&#8217;ve integrated it with our inhouse calculator web application mentioned in <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tcl-and-php-calculator-tutorial\/' title='Tcl and PHP Calculator Tutorial'>Tcl and PHP Calculator Tutorial<\/a>.   If all those <a href='#myul' title='Conditions'>many stars aline<\/a> we can integrate a Windows Calculator dynamically created AutoHotKey script program into the mix to add a bit of interest.<\/p>\n<p>Interestingly, our tool needed no changes to integrate, here.  And so, you may see all this trying <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/calculator.php---GETME\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/calculator.php---GETME\">calculator.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/calculator.php\">calculator tool as a standalone web application<\/a>, now, perhaps, integrating some button press control programming!<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-dynamic-compile-procedure-program-tutorial\/'>Windows AutoHotKey Dynamic Compile Procedure Program Tutorial<\/a>.<\/p-->\n<hr>\n<p id='wahkdcpct'>Previous relevant <a target=_blank title='Windows AutoHotKey Dynamic Compile Procedure Content Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-dynamic-compile-procedure-content-tutorial\/'>Windows AutoHotKey Dynamic Compile Procedure Content Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/send_over.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Windows AutoHotKey Dynamic Compile Procedure Content Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/ahkcompilertoexe.jpg\" title=\"Windows AutoHotKey Dynamic Compile Procedure Content Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Windows AutoHotKey Dynamic Compile Procedure Content Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Windows AutoHotKey Self Compile Procedure Content Tutorial' href='#wahkscpct'>Windows AutoHotKey Self Compile Procedure Content Tutorial<\/a> had us &#8230;<\/p>\n<ul id=myul>\n<li>with an underlying Windows operating system &#8230;<\/li>\n<li>with a Windows <a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'>MAMP<\/a> environment installed and activated &#8230;<\/li>\n<li>with the PHP (<a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/send_over.php-GETME\">now changed<\/a>) <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/send_over.php-GETME\">send_over.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/send_over.php\" title=\"Click picture\">web application<\/a> both on the public RJM Programming domain web server (Document Root) and at the local<font size=1>host<\/font> Windows <a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'>MAMP<\/a> Apache\/PHP\/MySql web server (Document Root) &#8230;<\/li>\n<li>with <a target=_blank title='AutoHotKey' href='HTTP:\/\/www.autohotkey.com'>AutoHotKey<\/a> scripting, to create Windows executable programs and desktop applications, installed &#8230;<\/li>\n<li>with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/compileahk.ahk_GETME\">compileahk.ahk<\/a> self compiler AutoHotKey scripting downloaded to user home directory on <a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'>MAMP<\/a> environment &#8230;<\/li>\n<\/ul>\n<p> &#8230; we ended up with a Windows executable for that <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/compileahk.ahk_GETME\">compileahk.ahk<\/a> self compiler AutoHotKey script be created from that &#8220;online public world&#8221; <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/send_over.php\" title=\"Click picture\">web application<\/a> in that &#8220;Intranet feeling&#8221; way we&#8217;ve been looking for.<\/p>\n<p>But today we extend that to other AutoHotKey script (scenarios) entered into that &#8220;online public world&#8221; <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/send_over.php\" title=\"Click picture\">web application<\/a>&#8216;s textarea, along with a base filename different to &#8220;compileahk.ahk&#8221; we&#8217;re hoping (with users who are using this software seriously) to &#8230;<\/p>\n<ol>\n<li>dynamically &#8220;chunk&#8221; send that content to the Windows <a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'>MAMP<\/a> environment&#8217;s place of choice with the name of choice &#8230;<\/li>\n<li>choose a Windows executable filename (not the hardest bit of the project) &#8230;<\/li>\n<li>use the AutoHotKey compiler (via PHP exec) to compile the script into an executable &#8230;<\/li>\n<li>as required, take any user entered arguments into account, as we use PHP <a target=_blank title='PHP exec() method information' href='http:\/\/php.net\/manual\/en\/function.exec.php'>exec<\/a> to execute that AutoHotKey derived executable &#8230;<\/li>\n<li>which we did <a href='#utcasoafda' title='Calculator AutoHotKey script'See the >using the Calculator AutoHotKey script of a few days ago<\/a> in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/ahkcompilertoexe.jpg\" title=\"Tutorial picture\">today&#8217;s tutorial picture<\/a><\/li>\n<\/ol>\n<p> &#8230; to open the Windows Calculator desktop application with those button press logics.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-dynamic-compile-procedure-content-tutorial\/'>Windows AutoHotKey Dynamic Compile Procedure Content Tutorial<\/a>.<\/p-->\n<hr>\n<p id='wahkscpct'>Previous relevant <a target=_blank title='Windows AutoHotKey Self Compile Procedure Content Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-self-compile-procedure-content-tutorial\/'>Windows AutoHotKey Self Compile Procedure Content Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/send_over.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Windows AutoHotKey Self Compile Procedure Content Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/send_over.jpg\" title=\"Windows AutoHotKey Self Compile Procedure Content Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Windows AutoHotKey Self Compile Procedure Content Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Windows AutoHotKey Self Compile Procedure Tutorial' href='#wahkscpt'>Windows AutoHotKey Self Compile Procedure Tutorial<\/a> set up a second step &#8230;<\/p>\n<blockquote><p>\nfeed the work above a prearranged Windows localhost user&#8217;s getenv(&#8216;USERPROFILE&#8217;) (ie. HOME directory) script filename that has been populated, in parts as necessary via popup localhost calls from a public domain webpage (ours being the RJM Programming domain) using PHP code at both ends\n<\/p><\/blockquote>\n<p> &#8230; as a unit of work making the (Windows) <a target=_blank title='AutoHotKey' href='HTTP:\/\/autohotkey.com'>AutoHotKey<\/a> scripting a dynamically compiling concept, even from the &#8220;online world&#8221; view.<\/p>\n<p>And today addresses a starting point, an Intranet based one, in that &#8220;online world&#8221; interfacing, with our new &#8220;proof of concept&#8221; <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/send_over.php_GETME\">send_over.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/send_over.php\" title=\"Click picture\">web application<\/a> lives on &#8230;<\/p>\n<ul>\n<li>the Document Root of RJM Programming domain&#8217;s Apache\/PHP\/MySql web server &#8230; and what makes things interesting &#8230;<\/li>\n<li>we&#8217;d like you to download the <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/send_over.php_GETME\">send_over.php<\/a> PHP code to (the Document Root of) a macOS or Windows <a target=_blank title='MAMP' href='http:\/\/www.mamp.info'>MAMP<\/a> local Apache\/PHP\/MySql web server environment<\/li>\n<\/ul>\n<p> &#8230; as an &#8220;Intranet feeling&#8221; way for the online world (in the form of an HTML textarea element) formulate the &#8220;content&#8221; of the AutoHotKey scripting part of the jigsaw.<\/p>\n<p>So, try all this out, and we&#8217;ll be thinking of the next best way proceeding to create Windows executables via AutoHotKey scripting, at the very least.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-self-compile-procedure-content-tutorial\/'>Windows AutoHotKey Self Compile Procedure Content Tutorial<\/a>.<\/p-->\n<hr>\n<p id='wahkscpt'>Previous relevant <a target=_blank title='Windows AutoHotKey Self Compile Procedure Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-self-compile-procedure-tutorial\/'>Windows AutoHotKey Self Compile Procedure Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/ahk_self_compile.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Windows AutoHotKey Self Compile Procedure Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/ahk_self_compile.jpg\" title=\"Windows AutoHotKey Self Compile Procedure Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Windows AutoHotKey Self Compile Procedure Tutorial<\/p><\/div>\n<p>We have aims to involve the online world, in an Intranet way, in our, so far, just Windows, desktop focussed <a title='Windows AutoHotKey Procedure with Button Presses Tutorial' href='#wahkpbpt'>Windows AutoHotKey Procedure with Button Presses Tutorial<\/a> &#8220;<a target=_blank title='AutoHotKey' href='HTTP:\/\/autohotkey.com'>AutoHotKey<\/a> musings&#8221;.  There are two steps, at least, getting to where we want to go &#8230;<\/p>\n<ol>\n<li>get AutoHotKey scripting accept an AutoHotKey script and compile the script dynamically into a Windows executable (*.exe) program &#8230;<\/li>\n<li>feed the work above a prearranged Windows localhost user&#8217;s getenv(&#8216;USERPROFILE&#8217;) (ie. HOME directory) script filename that has been populated, in parts as necessary via popup localhost calls from a public domain webpage (ours being the RJM Programming domain) using PHP code at both ends<\/li>\n<\/ol>\n<p> &#8230; and today&#8217;s progress matches up with step 1 above.<\/p>\n<p>We ended up this work today, such that &#8230;<\/p>\n<table>\n<tr>\n<th>Call ( after <i>cd C:\\MAMP\\htdocs<\/i> ) to get us to Windows MAMP Document Root as we can execute a DOS command line command &#8230;<\/th>\n<\/tr>\n<tr>\n<td>compileahk &#8220;run calculator(])(])ExitApp&#8221;<\/td>\n<\/tr>\n<tr>\n<th>Calling on ( AutoHotKey compiled compileahk.exe (Windows executable) via script <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/compileahk.ahk_GETME\">compileahk.ahk<\/a> ) to get us a getenv(&#8216;USERPROFILE&#8217;) (ie. HOME directory) x.exe Windows executable, on the fly, to start up the Windows Calculator application &#8230;<\/th>\n<\/tr>\n<tr>\n<td><code><br \/>\nEnvGet, vUserProfile, USERPROFILE<br \/>\n<br \/>\nparam := \"\"<br \/>\nparamtwo := \"x.ahk\"<br \/>\nparamthree := \"x.exe\"<br \/>\nyeslf := \"\"<br \/>\ndq := Chr(34)<br \/>\n<br \/>\nLoop, %0%  ; For each parameter:<br \/>\n{<br \/>\n  if A_Index = 1<br \/>\n    ZZ_Index = \"%1%\"<br \/>\n  else<br \/>\n    if A_Index = 2<br \/>\n      ZZ_Index = \"%2%\"<br \/>\n    else<br \/>\n      if A_Index = 3<br \/>\n        ZZ_Index = \"%3%\"<br \/>\n<br \/>\n  If ZZ_Index contains \".ahk\"<br \/>\n  {<br \/>\n    paramtwo = \"%ZZ_Index%\"<br \/>\n    paramthree := StrReplace(paramtwo, \".ahk\", \".exe\")<br \/>\n  }<br \/>\n  else<br \/>\n  {<br \/>\n    If ZZ_Index contains \".AHK\"<br \/>\n    {<br \/>\n       paramtwo = \"%ZZ_Index%\"<br \/>\n       paramthree := StrReplace(paramtwo, \".AHK\", \".exe\")<br \/>\n    }<br \/>\n    else<br \/>\n    {<br \/>\n       yeslf := StrReplace(ZZ_Index, \"(])\", \"`r`n\")<br \/>\n       If StrLen(\"%yeslf%\") = StrLen(\"%ZZ_Index%\")<br \/>\n       {<br \/>\n<br \/>\n         If ZZ_Index contains \".\"<br \/>\n         {<br \/>\n           FileDelete, %vUserProfile%\\%paramtwo%<br \/>\n           FileCopy, %ZZ_Index%, %vUserProfile%\\%paramtwo%<br \/>\n         }<br \/>\n         else<br \/>\n         {<br \/>\n           If SubStr(yeslf, 1, 1) = Chr(34)<br \/>\n             yeslf := SubStr(yeslf, 2, (Strlen(yeslf) - 2))<br \/>\n<br \/>\n           param := \"yes\"<br \/>\n         }<br \/>\n       }<br \/>\n       else<br \/>\n         If SubStr(yeslf, 1, 1) = Chr(34)<br \/>\n           yeslf := SubStr(yeslf, 2, (Strlen(yeslf) - 2))<br \/>\n<br \/>\n         param := \"yes\"  ; Fetch the contents of the variable whose name is contained in A_Index.<br \/>\n    }<br \/>\n  }<br \/>\n}<br \/>\n<br \/>\nIf StrLen(param) != 0<br \/>\n{<br \/>\n  FileDelete, %vUserProfile%\\%paramtwo%<br \/>\n  FileAppend, %yeslf%, %vUserProfile%\\%paramtwo%<br \/>\n}<br \/>\n<br \/>\nIfWinExist Ahk2Exe.exe for AutoHotKey<br \/>\n  WinActivate<br \/>\nelse<br \/>\n{<br \/>\n  Run c:\\Program Files\\AutoHotkey\\Compiler\\Ahk2Exe.exe \/in %vUserProfile%\\%paramtwo% \/out %vUserProfile%\\%paramthree%<br \/>\n  WinActivate Ahk2Exe.exe for AutoHotKey<br \/>\n}<br \/>\n<br \/>\nRun %vUserProfile%\\%paramthree%<br \/>\n<br \/>\nreturn<br \/>\n<\/code>\n<\/td>\n<\/tr>\n<\/table>\n<p>Stay tuned for more pieces of the jigsaw to be resolved!<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/new-windows-autohotkey-self-compile-procedure-tutorial\/'>Windows AutoHotKey Self Compile Procedure Tutorial<\/a>.<\/p-->\n<hr>\n<p id='wahkpbpt'>Previous relevant <a target=_blank title='Windows AutoHotKey Procedure with Button Presses Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-procedure-with-button-presses-tutorial\/'>Windows AutoHotKey Procedure with Button Presses Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/ahk_button_press_procedure.gif\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Windows AutoHotKey Procedure with Button Presses Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/ahk_button_press_procedure.gif\" title=\"Windows AutoHotKey Procedure with Button Presses Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Windows AutoHotKey Procedure with Button Presses Tutorial<\/p><\/div>\n<p>We want to focus, today, on &#8230;<\/p>\n<ul>\n<li>underlying operating system (today, Windows) &#8230;<\/li>\n<li>desktop application &#8230; that addresses &#8230;<\/li>\n<li>repeatable procedure &#8230; that involves &#8230;<\/li>\n<li>button presses &#8230; at a position on that desktop application window<\/li>\n<\/ul>\n<p>.  Were you &#8220;all in&#8221; until that last limitation?  Yes, it makes the idea of turning such a task into a programmable (script<font size=1>able<\/font>) procedure that bit more difficult.<\/p>\n<p>But what about if we think about a great Windows third party &#8220;procedure scripting tool&#8221; called  <a target=_blank title='AutoHotKey' href='HTTP:\/\/autohotkey.com'>AutoHotKey<\/a>, as with the recent <a title='Windows AutoHotKey Communication Opener Tutorial' href='#wahkcot'>Windows AutoHotKey Communication Opener Tutorial<\/a>?<\/p>\n<p>Let&#8217;s start with a concept that one word is enough for a lot of us to imagine the issues and possibilities &#8230;<\/p>\n<p><code><br \/>\n<a target=_blank title='Windows Calculator' href='https:\/\/www.microsoft.com\/en-au\/p\/windows-calculator\/9wzdncrfhvn5#activetab=pivot:overviewtab'>Calculator<\/a><br \/>\n<\/code><\/p>\n<p>Now writing this AutoHotKey <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/calculator.ahk_GETME\">calculator.ahk<\/a> script that needs &#8220;button press positioning smarts&#8221; without the wonderful &#8220;Recorder&#8221; functionality of the past <font size=1>(boo, hoo)<\/font> you can turn to AutoHotKey&#8217;s <a target=_blank title='AutoHotKey Windows Spy' href='https:\/\/www.autohotkey.com\/board\/topic\/63365-using-window-spy\/'>Windows Spy<\/a> application as a reasonable alternative.  You can see it in action with today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/ahk_button_press_procedure.gif\" title=\"Click picture\">tutorial animated GIF<\/a> that helped us create &#8230;<\/p>\n<p><code id=utcasoafda><br \/>\nIfWinExist Calculator<br \/>\n  WinActivate<br \/>\nelse<br \/>\n  Run calculator:\/\/<br \/>\n  WinActivate calculator<br \/>\n<br \/>\n\/\/ 75 \/ 8 =<br \/>\n<br \/>\nCoordMode, Mouse, Window<br \/>\nClick 208,228<br \/>\nSleep, 2500<br \/>\nClick 48,338<br \/>\nSleep, 500<br \/>\nClick 129,397<br \/>\nSleep, 500<br \/>\nClick 286, 282<br \/>\nSleep, 500<br \/>\nClick 129, 338<br \/>\nSleep, 500<br \/>\nClick 286, 496<br \/>\nreturn<br \/>\n<\/code><\/p>\n<p> &#8230; to open (as required) the Windows Calculator desktop application and press buttons so as to solve &#8230;<\/p>\n<blockquote><p>\n75 &#10135; 8 =\n<\/p><\/blockquote>\n<p><a title='Spoiler alert or watch animated GIF' style='cursor:pointer;text-decoration:underline;' onclick=\"this.innerHTML='9.375';\">?<\/a><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-procedure-with-button-presses-tutorial\/'>Windows AutoHotKey Procedure with Button Presses Tutorial<\/a>.<\/p-->\n<hr>\n<p id='wahkcot'>Previous relevant <a target=_blank title='Windows AutoHotKey Communication Opener Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-communication-opener-tutorial\/'>Windows AutoHotKey Communication Opener Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/ahk_start_notepad_exe_body.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Windows AutoHotKey Communication Opener Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/ahk_start_notepad_exe_body.jpg\" title=\"Windows AutoHotKey Communication Opener Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Windows AutoHotKey Communication Opener Tutorial<\/p><\/div>\n<p>We wanted to work on the AutoHotKey scripting of yesterday&#8217;s <a title='Windows AutoHotKey Mail Opener Tutorial' href='#wahkmot'>Windows AutoHotKey Mail Opener Tutorial<\/a> in a few functionality improvements &#8230;<\/p>\n<ul>\n<li>set up to be #SingleInstance to make it that one Hot Key call equals one <a target=_blank title='AutoHotKey' href='HTTP:\/\/autohotkey.com'>AutoHotKey<\/a> program execution &#8230;<\/li>\n<li>be able to create a temporary file maintenance (via Ctrl+Alt+n) via call of Notepad to be able to edit a user defined email body content, optionally &#8230;<\/li>\n<li>that Notepad content be read and if first record integer content only &#8230; understand it as &#8230;<\/li>\n<li>SMS, rather than email &#8230; but, alas, the <i>sms:[SMSnumber]&#038;body=[BodyContent]<\/i> (URL) only worked on this Windows 10 with <a target=_blank title='Microsoft Messenger' href='https:\/\/www.microsoft.com\/en-us\/p\/messenger\/9wzdncrf0083#activetab=pivot:overviewtab'>Microsoft Messenger<\/a> just to open that app but not fill in either of [SMSnumber] nor [BodyContent] &#8230; but who&#8217;s to say is doesn&#8217;t work for your Windows setup?!<\/li>\n<\/ul>\n<p>Here&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/StartMail.ahk-GETME\">the changed<\/a> AutoHotKey script called <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/StartMail.ahk-GETME\">StartMail.ahk<\/a> that achieves this progress, once compiled  <a target=_blank title='?' href='https:\/\/www.youtube.com\/watch?v=PtR4cWb4HNg'>that is<\/a> &#8230;<\/p>\n<p><code><br \/>\n#SingleInstance<br \/>\n<br \/>\n^!n::<br \/>\nFormatTime timestamp, A_Now, yyyyMMdd<br \/>\nIfWinExist Untitled - Notepad<br \/>\n                WinActivate<br \/>\nelse<br \/>\n                Run, Notepad \"%TEMP%\\bodyidea_%timestamp%.txt\"<br \/>\nreturn<br \/>\n<br \/>\n^!g::<br \/>\nVerbVar := \"mailto:rmetcalfe15@gmail.com?subject=Which Old Thing...\"<br \/>\nFormatTime timestamp, A_Now, yyyyMMdd<br \/>\nAle := \"%0A\"<br \/>\nGetArg := \"&\"<br \/>\nZeroOne := 0<br \/>\nHBodyVar =<br \/>\nBodyVar =<br \/>\nifExist, %TEMP%\\bodyidea_%timestamp%.txt<br \/>\n    FileReadLine, HBodyVar, %TEMP%\\bodyidea_%timestamp%.txt, 1<br \/>\n    if HBodyVar is integer<br \/>\n    {<br \/>\n        VerbVar = sms:%HBodyVar%<br \/>\n        ZeroOne := \"1\"<br \/>\n        GetArg := \"&\"<br \/>\n    }<br \/>\n<br \/>\n    Loop, read, %TEMP%\\bodyidea_%timestamp%.txt<br \/>\n    {<br \/>\n        IfEqual, ZeroOne, 0<br \/>\n        {<br \/>\n            BodyVar = %BodyVar%%A_Space%%Ale%%A_LoopReadLine%<br \/>\n        }<br \/>\n<br \/>\n        ZeroOne := 0<br \/>\n    }<br \/>\n<br \/>\nIfWinExist Mail<br \/>\n                WinActivate<br \/>\nelse<br \/>\n                Run, \"%VerbVar%%GetArg%body=%BodyVar%\"<br \/>\nreturn<br \/>\n<br \/>\n^!r::<br \/>\nVerbVar := \"mailto:rmetcalfe@rjmprogramming.com.au.com?subject=That Old Thing...\"<br \/>\nFormatTime timestamp, A_Now, yyyyMMdd<br \/>\nAle := \"%0A\"<br \/>\nGetArg := \"&\"<br \/>\nZeroOne := 0<br \/>\nHBodyVar =<br \/>\nBodyVar =<br \/>\nifExist, %TEMP%\\bodyidea_%timestamp%.txt<br \/>\n    FileReadLine, HBodyVar, %TEMP%\\bodyidea_%timestamp%.txt, 1<br \/>\n    if HBodyVar is integer<br \/>\n    {<br \/>\n        VerbVar = sms:%HBodyVar%<br \/>\n        ZeroOne := \"1\"<br \/>\n        GetArg := \"&\"<br \/>\n    }<br \/>\n<br \/>\n    Loop, read, %TEMP%\\bodyidea_%timestamp%.txt<br \/>\n    {<br \/>\n        IfEqual, ZeroOne, 0<br \/>\n        {<br \/>\n            BodyVar = %BodyVar%%A_Space%%Ale%%A_LoopReadLine%<br \/>\n        }<br \/>\n<br \/>\n        ZeroOne := 0<br \/>\n    }<br \/>\n<br \/>\nIfWinExist Mail<br \/>\n                WinActivate<br \/>\nelse<br \/>\n                Run, \"%VerbVar%%GetArg%body=%BodyVar%\"<br \/>\nreturn<br \/>\n<\/code><\/p>\n<p>We hope you try this out!<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-communication-opener-tutorial\/'>Windows AutoHotKey Communication Opener Tutorial<\/a>.<\/p-->\n<hr>\n<p id='wahkmot'>Previous relevant <a target=_blank title='Windows AutoHotKey Mail Opener Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-mail-opener-tutorial\/'>Windows AutoHotKey Mail Opener Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/ahk_mail_to_subj_control_command_letters.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Windows AutoHotKey Mail Opener Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/ahk_mail_to_subj_control_command_letters.jpg\" title=\"Windows AutoHotKey Mail Opener Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Windows AutoHotKey Mail Opener Tutorial<\/p><\/div>\n<p>Just as you can revisit web applications, you might often revisit <i>whole concepts<\/i>, because as the years and software versions change, so might these <i>whole concepts<\/i>.  Today&#8217;s case in point is a great Windows tool for programmers called <a target=_blank title='AutoHotKey' href='HTTP:\/\/autohotkey.com'>AutoHotKey<\/a> we&#8217;ve talked a lot about <a target=_blank title='AutoHotKey blog posts' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/autohotkey'>at this blog<\/a> &#8230;<\/p>\n<blockquote cite='http:\/\/autohotkey.com'><p>\nAutoHotkey is a free, open-source scripting language for Windows that allows users to easily create small to complex scripts for all kinds of tasks such as: form fillers, auto-clicking, macros, etc.\n<\/p><\/blockquote>\n<p>Are you always in the &#8220;online woooorrrllldd&#8221; or are you on Windows and still find desktop jobs you want to automate?   If you are in the latter category, AutoHotKey could be your way to associate your own Hot Key combinations with whole sequences of a task, or just the starting bits, as with our entry level opening of Windows Mail with a To emailee and subject associated in the one AutoHotKey compiled *.exe for two Hot Key creations via the AutoHotKey script we&#8217;ve called <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/StartMail.ahk_GETME\">StartMail.ahk<\/a> &#8230;<\/p>\n<p><code><br \/>\n^!g::<br \/>\nIfWinExist Mail<br \/>\n                WinActivate<br \/>\nelse<br \/>\n                Run, \"mailto:rmetcalfe15@gmail.com?subject=Which Old Thing...\"<br \/>\nreturn<br \/>\n<br \/>\n^!r::<br \/>\nIfWinExist Mail<br \/>\n                WinActivate<br \/>\nelse<br \/>\n                Run, \"mailto:rmetcalfe@rjmprogramming.com.au?subject=That Old Thing...\"<br \/>\nreturn<br \/>\n<\/code><\/p>\n<p> &#8230; the Hot Key associated with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/ahk_mail_to_subj_control_command_letters.jpg\" title=\"Click picture\">today&#8217;s tutorial picture<\/a> being Ctrl+Alt+g (ie. that first, of two, Hot Key definitions in the AutoHotKey script above, whereas the second could be executed via Ctrl+Alt+r).<\/p>\n<p>This, to me, is like &#8220;looking under the hood&#8221; of Windows, especially if you start up AutoHotKey&#8217;s excellent &#8220;Window Spy&#8221; tool (that can help you glean a focussed window of interest&#8217;s details that you might be interested in).   Can you believe in years gone past you used to be able to Record your actions, though that is not offered free anymore, or not feasible anymore (the latter a reason that would not surprise us &#8230; but a little hard graft &#8230; &#8220;bliss&#8221; &#8230; I can hear you say?!)?   These Windows *.exe you can create via AutoHotKey used to be a less security restricted idea, but AutoHotKey can help you quickly realize that joy creating desktop programs can give you.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54391' onclick='var dv=document.getElementById(\"d54391\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/autohotkey\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54391' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54399' onclick='var dv=document.getElementById(\"d54399\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/sms\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54399' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d55103' onclick='var dv=document.getElementById(\"d55103\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/calculator\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55103' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d55106' onclick='var dv=document.getElementById(\"d55106\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/compile\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55106' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d55111' onclick='var dv=document.getElementById(\"d55111\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/script\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55111' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d55123' onclick='var dv=document.getElementById(\"d55123\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/exec\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55123' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d55128' onclick='var dv=document.getElementById(\"d55128\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/integration\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55128' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>There might be more to do with the Windows AutoHotKey Script Program creator tool we&#8217;ve been developing up to yesterday&#8217;s Windows AutoHotKey Dynamic Compile Procedure Content Tutorial, but, today, we take a step sideways and roadtest that tool. We&#8217;ve integrated &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-dynamic-compile-procedure-program-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,29,33,37],"tags":[118,174,3930,211,241,242,257,1683,405,3929,3838,614,624,2410,744,812,866,981,2738,996,997,1105,1106,1168,1262,1319,1435],"class_list":["post-55128","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-operating-system","category-software","category-tutorials","tag-autohotkey","tag-button","tag-chunk","tag-click","tag-compile","tag-compiler","tag-content","tag-dynamic","tag-exec","tag-executable","tag-integrate","tag-integration","tag-intranet","tag-localhost","tag-mamp","tag-mouse","tag-online","tag-press","tag-procedure","tag-program","tag-programming","tag-script","tag-scripting","tag-software-integration","tag-textarea","tag-tutorial","tag-windows"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/55128"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=55128"}],"version-history":[{"count":3,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/55128\/revisions"}],"predecessor-version":[{"id":55131,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/55128\/revisions\/55131"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=55128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=55128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=55128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}