AutoHotkey Webinar 08/2018 Hour 1-Helping work through scripts AutoHotkey Webinar 08/2018 Hour 2-GeekDude explaining his work on CloudAHK / CloudAHK in a bottle
In Hour 2 GeekDude also explains how he was able to “pack up” all of the resources in
Script Highlight: This was actually a “website” highlight. Skrommel’s 1-hour Software is a great site with 116 examples of scripts that can manipulate various tasks on Windows. His code is available both as an executable as well as the AutoHotkey source files.
FileCopy copies files only. To copy a single folder (including its subfolders), use FileCopyDir. To instead copy the contents of a folder (all its files and subfolders), see the examples section of FileCopy
UTF-16: Unicode UTF-16 with little endian byte order, equivalent to CP1200
UTF-8-RAW or UTF-16-RAW: As above, but no Byte Order Mark (BOM*) is written when a new file is created
CPnnn: a code page with numeric identifier nnn. See Code Page Identifiers. (UTF-8 is CP65001, UTF-16 is CP1200)
Empty or omitted: the system default ANSI code page, which is also the default setting* The byte order mark (BOM) is a Unicode character, U+FEFF byte order mark (BOM), whose appearance as a magic number at the start of a text stream can signal several things to a program consuming the text
FileRead, Var, *P65001 %file_path% ;-Read in the file using UTF-8 Encoding
When the goal is to load all or a large part of a file into memory, FileRead performs much better than using a file-reading loop.
FileOpen() provides more advanced functionality than FileRead, such as reading or writing data at a specific location in the file without reading the entire file into memory
When Reading / Writing to a file many times, FileObject is much faster as it does not open/close the file each time
A file-reading loop is useful when you want to operate on each line contained in a text file, one at a time. It performs better than using FileReadLine because:
the file can be kept open for the entire operation
the file does not have to be re-scanned each time to find the requested line number.
Lines up to 65,534 characters long can be read. If the length of a line exceeds this, its remaining characters will be read during the next loop iteration
To load an entire file into a variable, use FileRead because it performs much better than a loop (especially for large files).
Reads the specified line from a file and stores the text in a variable
It is strongly recommended to use this command only for small files, or in cases where only a single line of text is needed. To scan and process a large number of lines (one by one), use a file-reading loopfor best performance. To read an entire file into a variable, use FileRead
For the the AutoHotkey Webinars we use Zoom which is a great, robust, inexpensive tool for hosting online meetings/webinars. They have a free version which allows you to connect with people for up to 45 minutes!
Below I walk through the following code where I demonstrate how I extract information about users & their meetings. This is a great example of how many vendors offer APIs to connect to their tools.
IniRead, API_Token ,Auth.ini,API, Token
IniRead, API_Key ,Auth.ini,API, Key
IniRead, API_Secret,Auth.ini,API, Secret
;~ EndPoint:="https://api.zoom.us/v1/user/list" ;get list of users under your account
;~ EndPoint:="https://api.zoom.us/v1/meeting/list" ;get list of meetings for a given user
EndPoint:="https://api.zoom.us/v1/meeting/get" ;get specific meeting info
;~ QueryString:=QueryString_Builder({"api_key":API_Key,"api_secret":API_Secret,"data_type":"XML","host_id":"pPzEua3eSDerCD2WO3JbUg"})
QueryString:=QueryString_Builder({"api_key":API_Key,"api_secret":API_Secret,"data_type":"XML","id":"693773857","host_id":"pPzEua3eSDerCD2WO3JbUg"})
;********API call**********************
HTTP := ComObjCreate("WinHttp.WinHttpRequest.5.1") ;Create COM Object
HTTP.Open("POST", EndPoint . QueryString) ;GET & POST are most frequent, Make sure you UPPERCASE
HTTP.Send() ;If POST request put data in "Payload" variable
Response_data:= HTTP.ResponseText ;Save the text that is returned
SciTE_Output(Response_data) ;Text,Clear=1,LineBreak=1,Exit=0
;***********query string builder*******************
QueryString_Builder(kvp){
for key, value in kvp
queryString.=((A_Index="1")?(url "?"):("&")) key "=" value
return queryString
}
Video walking through developing the Zoom API call