{"id":9682,"date":"2023-07-28T22:46:24","date_gmt":"2023-07-28T22:46:24","guid":{"rendered":"https:\/\/max-drake.cc\/?p=9682"},"modified":"2023-07-28T22:46:29","modified_gmt":"2023-07-28T22:46:29","slug":"autohotkey-v2-cycle-through-file-explorer-windows","status":"publish","type":"post","link":"https:\/\/max-drake.cc\/?p=9682","title":{"rendered":"AutoHotKey v2 cycle through file explorer windows"},"content":{"rendered":"\n<p>I&#8217;ve an original hotkey &#8211; ctrl+ Shift + A for cycling through File Explorer open window instances that I got from this video of Taran&#8217;s years ago, and love using it.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"My greatest, easiest AHK script ever - Instant application switching\" width=\"678\" height=\"381\" data-src=\"https:\/\/www.youtube.com\/embed\/OqyQABySV8k?list=PLH1gH0v9E3ruQn8vDcN9snxgPCJWft4QZ\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>I&#8217;ve also started to play with AutoHotKey V2 and am trying to adapt scripts from v1 to v2. I started by trying to acvtivate some python scripts using AutoHotKey v2 (a separate post) and wanted to extend it to popular scripts in v1  that I use. <\/p>\n\n\n\n<p>I came across this video yesterday by the Automator about Teran&#8217;s script adapted to v2 for general programs but it didn&#8217;t apply to File Explorer. They also demonstrated it but didn&#8217;t give the code so I used powerToys &#8216;Text Extractor&#8221; to grab the code off the screen. <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"? Unleash Your Program-Switching Skills! Jump &amp; Toggle with Ease!?\" width=\"678\" height=\"381\" data-src=\"https:\/\/www.youtube.com\/embed\/UY4AguaR6SY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>I spent a morning trying to get the script to work, and couldn&#8217;t, but while exploring through the v2 documentation I did see a reference to the File Explorer setup on<strong><a rel=\"noreferrer noopener\" href=\"https:\/\/www.autohotkey.com\/docs\/v2\/misc\/WinTitle.htm#ahk_id\" target=\"_blank\"> this page<\/a><\/strong> under the <strong>ahk_group (Window Group)<\/strong> subheading and after using it in the code I was able to get it to work as well as the original v1 script.  Here it is : <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#Requires AutoHotkey v2.0\n#SingleInstance force\n\nAppsKey:: runThing()\n\nrunThing()\n{   \nGroupAdd \"Explorer\", \"ahk_class CabinetWClass\"\t\nif not WinExist(\"ahk_class CabinetWClass\")\n {\t \n\tRun 'explorer.exe'\n\tWinwait \"ahk_exe explorer.exe\"\n} \nElse\n{\t\n\tGroupActivate \"Explorer\", 'R'\n}\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">End comment<\/h3>\n\n\n\n<p>I was really please with getting it to work finally. It was a frustrating process and only because I came across the documentation for <strong>hk_group (Window Group)<\/strong> did I finally get it to work. <\/p>\n\n\n\n<p>I may adapt it for BIM work in the future where I may have a couple of open projects that I need to cycle through, but generally I only have one instance of other programs open at one time. <\/p>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve an original hotkey &#8211; ctrl+ Shift + A for cycling through File Explorer open window instances that I got from this video of Taran&#8217;s years ago, and love using it. I&#8217;ve also started to play with AutoHotKey V2 and am trying to adapt scripts from v1 to v2. I started by trying to acvtivate [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9683,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[466,204,42],"tags":[],"class_list":["post-9682","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-autohotkey","category-automation","category-productivity"],"featured_image_src":"https:\/\/max-drake.cc\/wp-content\/uploads\/2023\/07\/Add-New-Post-\u2039-Vast-\u2014-WordPress-\u2014-Mozilla-Firefox43_21.jpg","featured_image_src_square":"https:\/\/max-drake.cc\/wp-content\/uploads\/2023\/07\/Add-New-Post-\u2039-Vast-\u2014-WordPress-\u2014-Mozilla-Firefox43_21.jpg","author_info":{"display_name":"Max Drake","author_link":"https:\/\/max-drake.cc\/?author=1"},"_links":{"self":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/9682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9682"}],"version-history":[{"count":1,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/9682\/revisions"}],"predecessor-version":[{"id":9684,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/9682\/revisions\/9684"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/media\/9683"}],"wp:attachment":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}