{"id":7843,"date":"2021-12-10T20:00:28","date_gmt":"2021-12-10T20:00:28","guid":{"rendered":"https:\/\/max-drake.cc\/?p=7843"},"modified":"2022-11-27T08:06:49","modified_gmt":"2022-11-27T08:06:49","slug":"atext-premium-bash-adding-your-own-scripting-programs-confusing","status":"publish","type":"post","link":"https:\/\/max-drake.cc\/?p=7843","title":{"rendered":"aText Premium Bash &#038; Adding your own scripting programs &#8211; Confusing"},"content":{"rendered":"\n<p>While trying to run scripts in AutoHotKey I  started to look into getting the Bash scripts to work. I&#8217;d got all the other inbuilt scripting programs to run the example scripts so I thought I&#8217;d look into that too, just in case it had some effect on the AutoHotKey running issue <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"568\" data-src=\"http:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-1024x568.jpg\" alt=\"\" class=\"wp-image-7844 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-1024x568.jpg 1024w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-300x167.jpg 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-768x426.jpg 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-50x28.jpg 50w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-90x50.jpg 90w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-100x56.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-180x100.jpg 180w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-1153x640.jpg 1153w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-640x355.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-1384x768.jpg 1384w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences.jpg 1407w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/568;\" \/><\/figure>\n\n\n\n<h3 class=\"has-luminous-vivid-amber-background-color has-background wp-block-heading\">Bash scripts in aText <\/h3>\n\n\n\n<p>To run Bash, which is a linux program I looked to the interwongle about installing on windows. <\/p>\n\n\n\n<p>To install it I went through the process shown in this video, installing the Windows Sub-system for Linux: <\/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=\"How to Run Linux\/Bash on Windows 10 Using the Built-In Windows Subsystem for Linux\" width=\"678\" height=\"381\" data-src=\"https:\/\/www.youtube.com\/embed\/xzgwDbe7foQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>After installing Ubantu on my PC the bash scripts ran. I&#8217;m not sure if I have a use for it but it was an exercise and I now have Ubantu running on my PC. <\/p>\n\n\n\n<p>I did, in the past when playing with Raspberry Pi, install Ubantu, but in the end did not use it much, so I think it may not be of much use. <\/p>\n\n\n\n<h3 class=\"has-luminous-vivid-amber-background-color has-background wp-block-heading\">AutoHotKey in  aText <\/h3>\n\n\n\n<p>I get this error message:  <em>The system cannot find the file specified<\/em> and thought that this The system cannot find the file specified to the temp file in Appdata\/local\/tmp directory, but in fact it related to not finding the AutoHotKey executable file, even though the path was right. <\/p>\n\n\n\n<p>I got a reply from Tran Ky Nam about the issue and he said put the path to the AutoHotKey executable in quotes. I did so and it worked fine. <\/p>\n\n\n\n<p>The system cannot find the file specified reflected on this and reflected that I didn&#8217;t put the path in quotes because all of the other program exe files didn&#8217;t have quotes, so assumed the same. <\/p>\n\n\n\n<p>After setting up the script configuation (filetype and path (with quotes)) and closing the configuration window (to save changes) it then baulked on : <em>The directory name is invalid<\/em><\/p>\n\n\n\n<p>This is in the specific script, I pointed it to a different directory and it didn&#8217;t like it at all. <\/p>\n\n\n\n<p>Anyway, after that was fixed I have The directory name is invalid working inside  aText now, so &#8216;m very pleased. <\/p>\n\n\n\n<p>I&#8217;ve spent so much time trying to get it to work that I&#8217;ve forgotten what I wanted it for. <\/p>\n\n\n\n<p>I have a few scripts for Revit so I may need to split them and run them in aText. <\/p>\n\n\n\n<p>I&#8217;ve loaded aText onto 2 PC&#8217;s and only have the free version on a my Surface pro. I think I&#8217;m going to have to install the premium version on that as  PC I&#8217;m running revit on at the moment. <\/p>\n\n\n\n<h3 class=\"has-luminous-vivid-amber-background-color has-background wp-block-heading\">Python 10 in aText <\/h3>\n\n\n\n<p>There is a Python program already on aText but it doesn&#8217;t seem to import libraries. So, as I&#8217;ve Python 3.10 installed on my PC I thought I would try hooking up to that to see if I could call libraries using that program instead. <\/p>\n\n\n\n<p>I found the python 3.10 exe file and went to put the path &#8220;In quotes&#8221; in aText Script setp but it didn&#8217;t work. As soon as I took the quotes away it worked fine. <\/p>\n\n\n\n<p>I just tried the script below which uses an import of Date library and it worked fine. So that is good. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from datetime import date\n\n# Read the current date\ncurrent_date = date.today()\n\n# Print the formatted date\nprint(\"Today is :%d-%d-%d\" % (current_date.day,current_date.month,current_date.year))\n\n# Set the custom date\ncustom_date = date(2020, 12, 16)\nprint(\"The date is:\",custom_date)<\/code><\/pre>\n\n\n\n<p>I got these small scripts from <strong><a rel=\"noreferrer noopener\" href=\"https:\/\/linuxhint.com\/python_scripts_beginners_guide\/#post-67157-15\" target=\"_blank\">30 python scripts examples<\/a><\/strong>.<br><\/p>\n\n\n\n<p>Something strange is happening. If I switch over to the inbuilt python it runs these scripts too, so I think the are using some inbuilt modules. I need to test further by using pip to load a library and then test it. <\/p>\n\n\n\n<h2 class=\"has-luminous-vivid-amber-background-color has-background wp-block-heading\">End comment.<\/h2>\n\n\n\n<p>Worth trying new programs out with paths to their .exe files in quotes and without to see which works. <\/p>\n\n\n\n<p>So thanks to Tran ky Nam responding to email I can now run AutoHotKey in aText and AutoHotKey test out on Revit program. <\/p>\n\n\n\n<p>I can&#8217;t quite figure out what is going on but it works. <\/p>\n\n\n\n<p>Just had issue with aText not autoexpanding for aText and AutoHotKey. I think its getting it from clipboard and I have win 10 clipboard with Win+V so multiple things on clipboard. One issue was aText had image attached and that was messy. Also type the abbreviation and I get a blank back. Its also weird with the letter I as it auto-corrects it . <\/p>\n\n\n\n<p>The odd behaviour seems to only be in Firefox Blogs, specifically in WordPress, although I should test in Blogger too. Actually they all work fine in Blogger, so its WordPress that is acting up. <\/p>\n\n\n\n<p>A bit of a pain as that is where I&#8217;m using a lot of my abbreviation\/autoExpanding short texts. <\/p>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>While trying to run scripts in AutoHotKey I started to look into getting the Bash scripts to work. I&#8217;d got all the other inbuilt scripting programs to run the example scripts so I thought I&#8217;d look into that too, just in case it had some effect on the AutoHotKey running issue Bash scripts in aText [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7844,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[466,204,452,42,34],"tags":[],"class_list":["post-7843","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-autohotkey","category-automation","category-linux","category-productivity","category-python"],"featured_image_src":"https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-600x400.jpg","featured_image_src_square":"https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/12\/2021-12-11-08_55_25-aText-Preferences-600x600.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\/7843","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=7843"}],"version-history":[{"count":1,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/7843\/revisions"}],"predecessor-version":[{"id":9414,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/7843\/revisions\/9414"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/media\/7844"}],"wp:attachment":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}