• Intro to AutoHotkey Intermediate AutoHotkey Intermediate Objects GUIs are Easy w/AutoHotkey Painlessly switch from V1 to V2

AutoHotkey Webinar: AutoHotkey Version 2 – What to look out for when switching to V2

In this webinar we explore some of the main differences in AutoHotkey version 2, Why you might adapt it, and a tool to help automate the adaption

Special thanks to Dimitri Geerts for leading the discussion, putting together the deck, and working on the converter tool!

Video Hour 1: High-level overview
Video Hour 2: Q&A:

  • Major differences withAHK Version 2
  • You can read up on the official listing of changes
  • v2.0 beta 1was released in July 2021 and future releases are expected to be backward-compatible!  If you want to learn more, check out the v2 forum posts:
  • Take a look at the tool Dimitri demonstrated to adapt V1 code to V2 here

 

Script Highlight:  RunWith: Use this function to control the bitness of your AutoHotkey script

Sign up for future webinars here

See past AutoHotkey webinars 

You can get the Deck Dimitri presented here, or just look through the below images.

1) All parameters are expressions, not text

2) Variables need to be declared

3) “All” commands are now also functions

4) Some functions now return objects

5) There is now a distinction between properties accessed with . and data (items, array or map elements) accessed with []

6) Hotkeys and non-autoreplace HotStrings are no longer labels; instead, they (automatically) define a function

7) All byRef variables need to have a “&” before

8) Function calls require a space or “(“. Use comma only between parameters

9) GUI and GUI controls are now objects

 

TLDR: The 62nd AutoHotkey webinar discussed the benefits and challenges of switching to version 2, which offers improved consistency and cleaner code, but may require code conversion and can be less forgiving for beginners.

1. 00:00 📢 The 62nd AutoHotkey webinar discussed podcast topics, demonstrated Quick Access Pop-up, and provided a code template for running AutoHotkey in a specific business with the Unicode version.
1.1 The 62nd AutoHotkey webinar had 112 registrants and participants were asked to ask questions in the chat instead of speaking due to the potential for confusion.
1.2 The speaker discussed various podcast topics including version two, increasing the likelihood of script running on multiple computers, and the pros and cons of subscription-based vs one-time fee sales.
1.3 The speaker shared their screen and demonstrated how to use Quick Access Pop-up with AutoHotkey in the 32-bit version.
1.4 The speaker provides a code template that can be downloaded to force AutoHotkey to run in a specific business with the Unicode version, which is a useful function that should be built into AutoHotkey.

2. 04:45 🚀 The new version of the cjson parser improves code consistency and speed, while the changes in autohotkey code may be less forgiving for beginners.
2.1 Geek dude’s new version of the cjson parser works in both 64-bit and 32-bit, and thanks to everyone who develops and runs the forum.
2.2 The speaker discussed the changes from version 1.1 to version 2 and provided examples of how to correctly convert code to avoid errors.
2.3 In the updated version, everything is a function and errors occur when a variable is not declared, resulting in better code and fewer commands.
2.4 The upgrade may improve consistency and speed, but benchmarking is needed to determine the extent of the improvements.
2.5 The changes in version two of autohotkey code are simpler and less arbitrary, but may be less forgiving and not as easy for beginners to learn.
2.6 The speaker thinks the new conversion process is great despite concerns, and is currently working on a converter that is improving but may have difficulty handling large changes.

3. 14:01 👨‍💻 Arrays, hotkeys, and objects behave differently in Autohotkey version 2, but it has improved consistency and nested functions.
3.1 Arrays behave differently in version one and version two, with brackets and points having different effects, and it’s important to understand these differences when working with arrays.
3.2 Fix hotkeys by adding brackets and use an ampersand before name to avoid errors.
3.3 Version 2 of the programming language requires a space instead of a comma for the first variable in commands, and the use of objects has been changed.
3.4 Autohotkey version 2 has improved consistency and nested functions, making it easier for editors to do their intellisense type stuff and allowing for special tools without interfering with the rest of the program.
3.5 Learning it was easy with just understanding the birth variables, and there were not many difficulties encountered.

4. 22:25 📝 The speaker discussed code conversion challenges and loop confusion, while also sharing their struggles with using Hit Up and making changes to improve their skills.
4.1 The speaker discussed adding an ampersand sign to the function declaration and clarified that loops are not functions.
4.2 The speaker created a converter to convert version one code to a new version, but loops as a function can be confusing and the converter is currently only for testing purposes.
4.3 The speaker discussed the challenges of converting code and the need to sometimes invent methods to achieve the same results, while acknowledging that there may be better ways to code and asking for a link to the converter.
4.4 The speaker struggled with using Hit Up, a coding script adopted from another person, and made changes to it before the original coder stopped helping, leading to the speaker working offline to improve their skills.

5. 28:24 👨‍💻 Switching to version two of AutoHotkey can avoid issues and the speaker is working on converting functions from version one to version two.
5.1 V2 began around 10-12 years ago and the error level variable in V2 produces the same result as the V1 goat.
5.2 Consider switching to version two to avoid the same issues Python faced when switching between versions two and three.
5.3 Many people still have thousands of Python 2 scripts written in legacy libraries and converting them to Python 3 can be a daunting task.
5.4 The speaker demonstrated how to run different versions of AutoHotkey using a small script that detects the version number in the first 20 lines of the file.
5.5 The speaker is working on converting functions from version one to version two, focusing on the most used ones, and believes that com objects should work the same regardless of the language used to connect to them.

6. 36:49 💻 Using AutoHotkey version 2 leads to cleaner and more consistent code, with a 64-bit installer for easier management of hotkeys and scripts.
6.1 Functions are preferred over commands in programming as they have a cleaner syntax and are easier to understand, and while the old way of dealing with double quotes in version one is no longer available in version two, single quotes can be used instead.
6.2 Using version two of the converter leads to more consistent and cleaner code in the long run.
6.3 When installing AutoHotkey version 2, it does not install version 1 and comes with a 64-bit installer, which allows for easier management of hotkeys and scripts.
6.4 Learning the syntax of a new coding language is important to be able to use the same rules in your code and make the transition easier.
6.5 Version one library for functions has two functions inside, and it is easy to transition without converting the whole code, but it is hard to differentiate between exchanges.
6.6 The speaker stumbled upon forum posts about hotkeys using vanilla and l versions while learning dot notation with auto hotkey.

7. 47:00 💻 AutoHotkey users should consider using separate sub-forums or tags to indicate the version being used, and a converter can help avoid problems when transitioning to version 2.
7.1 Use separate sub-forums or tags to indicate the version of AutoHotkey being used to avoid confusion, and consider using custom extensions for more interactive output.
7.2 Autohotkey version 2 has new functionality and changes that shouldn’t break version 1, but it may take a while for it to gain widespread popularity.
7.3 Language should be concise and consistent, although every language has its quirks.
7.4 A gradual move to version two would damage adoption and cause problems in the community, so a converter can be a great help for people to avoid that kind of mess.
7.5 Automating 80% of the work is helpful and efficient, as it saves time and effort.

8. 54:59 👨‍💻 It’s suggested to make a community-wide effort to switch to a new version of AutoHotkey to avoid supporting multiple languages, but it may be difficult due to the large amount of content that still works with the old version.
8.1 There are some improvements in AutoHotkey version 2, but there is no compelling reason for existing users to switch to it.
8.2 Users may not switch to AutoHotkey version 2 quickly as long as they can find examples of version 1 scripts in the community.
8.3 To avoid the challenge of supporting multiple languages, it is suggested that a community-wide effort should be made to switch to a new version as fast and hard as possible, although it may be difficult due to the large amount of content that still works with the old version.
8.4 The majority of code in the programming language Otaha is found in a select few places, such as Reddit and hockey forums, and efforts could be made to create a foolproof converter to update outdated code.
8.5 The speaker suggests using a tool to nudge developers to use version two and setting up rules to check for version one code in posts to reduce confusion and fragmentation in programming languages.
8.6 The speaker discusses the implementation of Lactico’s version of AutoHotkey and how it drove some people away, while also mentioning the debate between Lactico’s version and the previous version.

Summary for https://youtu.be/R-AJgevfZ3k by www.eightify.app

AutoHotkey Webinar- 6/2021 Helping Users- API calls, ACC library & more!

AutoHotkey webinarThis AutoHotkey webinar was pretty amazing!
Video Hour 1: Helping others: Snagit, ACC library, Controls
Video Hour 2: GUIs, PID verse hwn ID, & more

Script Highlight:  Fiddler Everywhere Ripper / API Syntax writer

We also discussed Webservice APIs.  Our AHK Webinar on APIs is a great place to start

You also might want to download our API Syntax writer

We discussed the ACC library in this ahk webinar and demonstrated its usage in this AHK Webinar

When we were working through how to best solve Snaggit issue, I mentioned the 17 ways to automate windows  as well as AutomateMyTask

AutoHotkey Webinar- Finding presence of text in a large file

AutoHotkey webinarIn this working-session webinar we helped Dimitri with a project he was working on.  In short, he is looking for specific text in a “large” text file.  We discussed various approaches to the solution and created a few example solutions

Script Highlight:  Control panel objects by jNizM

Several things to consider before writing a solution

1.Just how large is/will the text file get?

A.Is the file going to be appended to over time?

2.Do you just need to answer “is the text value in the file” or do you need more information

A.how many occurrences

B.which lines it is on

C.other values related to it (key-value pairs, other fields, etc.)

3.Do you care if the text is found multiple times?

4.How important is speed

5.Would a “fuzzy search” help?

6.Will you be running single or multiple searches?

Possible Approaches for finding text in a large text file

  • Use InString on file read (see below example)
  • Shove it into an Object  (see below example)
  • Use built-in ADO database query by VXE
  • Use SQLite3

Simple InStr solution

Loop,Read, B:\the-automator\Webinar\Scripts\2020-01-Working Session\Dimitri\glbintf3.dat ;loop over data file (line by line)
  if InStr(A_LoopReadLine,"ENP-001213") ;If there is a : in the row, then proceed
    m(A_LoopReadLine,A_Index)

Shoving into an Object

  obj:={} ;Create object for storing data
  Loop,Read, B:\the-automator\Webinar\Scripts\2020-01-Working Session\Dimitri\glbintf3.dat ;loop over data file (line by line)
  {
    if InStr(A_LoopReadLine,":"){ ;If there is a : in the row, then proceed
      RegExMatch(A_LoopReadLine,"(\d+:)(\s+)?(?<Str>\S+.*)",arr_) ;Grab everything to the right of the : and push into Arr_Str
      obj[arr_Str]:=1
    }
  }
;********************Show all in object***********************************
  for k,v in obj
    output.=k "`n"
  MsgBox  %output% 
  
;********************Loop and find your value***********************************
  for k,v in obj{
    if(InStr(k,"ENP-003066"))
      m(k)
  }

 

 

AutoHotkey Webinar- Learn AutoHotkey quickly

In the first hour of the webinar we walked through the process for how to learn anything (including AutoHotkey) quickly

Hour 1: High-level overview
Hour 2: Q&A

Script Highlight:  Merging / Appending files of similar structure

  • A-Z Database allows for extracting contacts up to 1,000 at a time. Check your local library for access
  • For simplification I extracted 25 at a time, then merge together.
  • Each csv file has a header row
  • Every file has the same headers
  • Get the source code here

Learn AutoHotkey quickly

Continue reading