{"id":4296,"date":"2013-09-28T05:03:09","date_gmt":"2013-09-27T19:03:09","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4296"},"modified":"2016-06-21T10:16:02","modified_gmt":"2016-06-21T00:16:02","slug":"autohotkey-stayawake-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/autohotkey-stayawake-tutorial\/","title":{"rendered":"AutoHotKey StayAwake Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/StayAwake\/\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"AutoHotKey StayAwake Tutorial ... http:\/\/www.autohotkey.com\" src=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/StayAwake\/AutoHotKey_StayAwake-36of.jpg\" title=\"AutoHotKey StayAwake Tutorial ... http:\/\/www.autohotkey.com\"  \/><\/a><p class=\"wp-caption-text\">AutoHotKey StayAwake Tutorial ... www.autohotkey.com<\/p><\/div>\n<p>Have you heard of AutoHotKey?<br \/>\nIt is a Windows application (that is quite brilliant) which can record and replay mouse and keystrokes, or assign a group of actions to a HotKey.    Anybody into procedures and the operations side of I.T. will want to know about it, am sure.  <\/p>\n<p>We have introduced you to AutoHotKey with this previous AutoHotKey Primer Tutorial <a href=\"#pahkpt\">here<\/a>.<\/p>\n<p>Then we went a bit further with AutoHotKey with this previous More AutoHotKey Primer Tutorial <a href=\"#mat\">here<\/a>.<\/p>\n<p>We talked about <a target=_blank title='Terminate and Stay Resident concept explained by Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Terminate_and_Stay_Resident'>stay-resident<\/a> programs earlier with <a target=_blank title='Menu for Windows Command Prompt Via Batch File Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4196'>Menu for Windows Command Prompt Via Batch File Tutorial<\/a>.   Our tutorial today uses AutoHotKey to create one.   It uses the ToolTip functionality of Windows to keep the cursor busy.   In the tutorial we show it being run:<\/p>\n<ul>\n<li>right-click on AutoHotKey script file<\/li>\n<li>compile script into StayAwake.exe and Run As Administrator (but you could also run it as a mere mortal!)<\/li>\n<li>copy StayAwake.exe into All Users startup programs directory, logout and login for it to stay resident<\/li>\n<\/ul>\n<p>Please enjoy our tutorial with some stay-resident approaches shown <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/StayAwake\/' title='AutoHotKey StayAwake Tutorial'>here<\/a>.  <\/p>\n<p>Link to downloadable AutoHotKey programming script file <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/StayAwake\/StayAwake.ahk_GETME' title='StayAwake.ahk'>StayAwake.ahk<\/a><\/p>\n<hr \/>\n<p id=\"mat\">Previous <a target=_blank title='More AutoHotKey Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=3606'>More AutoHotKey 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\/More\/\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"More AutoHotKey Tutorial ... http:\/\/www.autohotkey.com\" src=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/More\/AutoHotKey_More-14of.jpg\" title=\"AutoHotKey Primer Tutorial ... http:\/\/www.autohotkey.com\"  \/><\/a><p class=\"wp-caption-text\">More AutoHotKey Tutorial ... http:\/\/www.autohotkey.com<\/p><\/div>\n<p>Have you heard of AutoHotKey?<br \/>\nIt is a Windows application (that is quite brilliant) which can record and replay mouse and keystrokes, or assign a group of actions to a HotKey.    Anybody into procedures and the operations side of I.T. will want to know about it, am sure.  <\/p>\n<p>We have introduced you to AutoHotKey with this previous AutoHotKey Primer Tutorial <a href=\"#pahkpt\">here<\/a>.<\/p>\n<p>On a previous tutorial Windows Command Prompt Via Batch File we introduced you to some Windows Command Prompt commands and you can see that tutorial <a target=_blank href='#pwcpvbf' title='Windows Command Prompt Via Batch File'>here<\/a>.   Our tutorial here builds on this in that the Windows Command Prompt batch file used for making that tutorial and downloadable here with rename to <a target=_blank title='Rename to xxx.bat and put into directory c:Usersuser please' href='http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/More\/xxx.bat_GETME'>xxx.bat<\/a> created\/copied into c:Usersuser please (if no good you will have to dive in and adjust redo351.ahk yourself now, and learn about the wonders of AutoHotKey!), was deliberately made so that it can be stepped through slowly by entering {ENTER} key a lot (in xxx.bat this is done by set \/p commands), and we have here the pressing of those {ENTER}s (ie. simulating answer to set \/p sleeping for 2 seconds between each one &#8230; here is your homework &#8230; make it wait for 3 seconds between each {ENTER} then compile it then rerun it) with an AutoHotKey script largely created by hand (or via leads from recordings (do you remember <a target=_blank title='Microsoft Excel VBA for CSV Primer Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=2557'>Microsoft Excel VBA for CSV Primer Tutorial<\/a> where similar thoughts were discussed as ideas for how to &#8220;get into programming&#8221;?)) and you can also download this here and rename to <a target=_blank title='Rename to xxx.bat and put into directory c:Usersuser please ... if no good you will have to dive in and adjust redo351.ahk yourself now, and learn about the wonders of AutoHotKey!' href='http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/More\/redo351.ahk_GETME'>redo351.ahk<\/a> and compile to redo351.exe using AutoHotKey&#8217;s compiler.   If, when you do all that you run it and it stands there looking at you like a dead mullet it will be because your Command Prompt window for such a scenario does not end up being called &#8220;C:Windowssystem32cmd.exe&#8221; and you will need to change this throughout redo351.ahk and then recompile (after stopping previous go (with <a target=_blank title='Windows Task Manader and Command Prompt Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=1352'>Windows Task Manager<\/a> maybe)) and test again.   An AutoHotKey program called AU3_Spy.exe can help identify the names (or titles) of Windows, as required.<\/p>\n<p>Please enjoy our tutorial with some recording functionality shown as well as the little &#8220;subplot&#8221; above (where the butler actually &#8220;did it&#8221;) <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/More' title='More AutoHotKey Tutorial'>here<\/a>.   The subplot is represented by the last 6 slides of the tutorial.<\/p>\n<hr \/>\n<p id=\"pahkpt\">Previous tutorial <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=616' title='AutoHotKey Primer Tutorial'>AutoHotKey Primer Tutorial<\/a> below &#8230;<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/Example\/\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"AutoHotKey Primer Tutorial ... http:\/\/www.autohotkey.com\" src=\"http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/Example\/ahk_0of.png\" title=\"AutoHotKey Primer Tutorial ... http:\/\/www.autohotkey.com\"  \/><\/a><p class=\"wp-caption-text\">AutoHotKey Primer Tutorial ... http:\/\/www.autohotkey.com<\/p><\/div>\n<p>Have you heard of AutoHotKey?<\/p>\n<p>It is a Windows application (that is quite brilliant) which can record and replay mouse and keystrokes, or assign a group of actions to a HotKey.    Anybody into procedures and the operations side of I.T. will want to know about it, am sure.<\/p>\n<p>Don&#8217;t want to show my age, but first got keen about AutoHotKey because I couldn&#8217;t believe the day  (was it when Windows 5 came out?) that Microsoft abandoned the cute program called Recorder, that came with Windows.  For myself, this was a moment of deep mourning, like when <a target=_blank title='Second half is not worth watching!' href='https:\/\/www.youtube.com\/watch?v=T52404rbsa0'>Collingwood lost to Carlton in the 1970 Grand Final<\/a>.<\/p>\n<p>In this primer  <a target=_blank title='click picture' href='http:\/\/www.rjmprogramming.com.au\/AutoHotKey\/Example\/'>tutorial<\/a> see a brief install then a record-compile-replay cycle.<br \/>\nIn this link you can look at some of the <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/AutoHotKey' title='AutoHotKey usage'>personal usage<\/a> of AutoHotKey.\n<\/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='#d616' onclick='var dv=document.getElementById(\"d616\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=AutoHotKey\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d616' 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='#d3606' onclick='var dv=document.getElementById(\"d3606\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=AutoHotKey\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d3606' 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='#d4296' onclick='var dv=document.getElementById(\"d4296\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=AutoHotKey\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d4296' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Have you heard of AutoHotKey? It is a Windows application (that is quite brilliant) which can record and replay mouse and keystrokes, or assign a group of actions to a HotKey. Anybody into procedures and the operations side of I.T. &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/autohotkey-stayawake-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,37],"tags":[118,997,1197,1319],"class_list":["post-4296","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-autohotkey","tag-programming","tag-stay-resident","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4296"}],"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=4296"}],"version-history":[{"count":1,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4296\/revisions"}],"predecessor-version":[{"id":22929,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4296\/revisions\/22929"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=4296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=4296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=4296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}