{"id":54399,"date":"2021-12-25T03:01:51","date_gmt":"2021-12-24T17:01:51","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=54399"},"modified":"2021-12-24T16:47:53","modified_gmt":"2021-12-24T06:47:53","slug":"windows-autohotkey-communication-opener-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-communication-opener-tutorial\/","title":{"rendered":"Windows AutoHotKey Communication Opener Tutorial"},"content":{"rendered":"<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","protected":false},"excerpt":{"rendered":"<p>We wanted to work on the AutoHotKey scripting of yesterday&#8217;s Windows AutoHotKey Mail Opener Tutorial in a few functionality improvements &#8230; set up to be #SingleInstance to make it that one Hot Key call equals one AutoHotKey program execution &#8230; &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/windows-autohotkey-communication-opener-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,29,37],"tags":[96,118,155,1709,241,319,320,380,381,573,673,738,2314,885,2738,996,1159,2086,1855,1583,1686],"class_list":["post-54399","post","type-post","status-publish","format-standard","hentry","category-elearning","category-operating-system","category-tutorials","tag-application","tag-autohotkey","tag-body","tag-communication","tag-compile","tag-desktop","tag-desktop-application","tag-email","tag-email-client","tag-hotkey","tag-keyboard","tag-mail","tag-notepad","tag-operating-system-2","tag-procedure","tag-program","tag-sms","tag-subject","tag-task","tag-window","tag-windows-10"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54399"}],"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=54399"}],"version-history":[{"count":8,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54399\/revisions"}],"predecessor-version":[{"id":54407,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54399\/revisions\/54407"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=54399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=54399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=54399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}