This script works well for the most part, but often it is sluggish and slow entering text, and sometimes the part where it enters text will just stop.
Firstly, let me point out that this was written several years ago with MUCH help from people on the forum here -- Thank you all!
The script, briefly,
1 - Reads from a couple of text files (that are formatted as INI files).
2 - Launches a GUI using parameters from the text file, and prompts for input.
3 - Based on that input, it reads some of the text from the text file.
4 - StringReplaces several text strings, then
5 - Types the modified, chosen boilerplate text into a webform for me, tabbing between fields.
The SendInput command is on line 94, about 80% of the way to the bottom.
Code: Select all
#NoEnv ; For security
#SingleInstance force
#Persistent
SetWorkingDir %A_ScriptDir%
;################################
;Menu, Tray, Icon, C:\Users\SWKunkel\AutoHotkey\AutoCorrect\Icons\IconPencilThick.ico Commented out for forum.
Gui, t2:Destroy
Gui, t2:-MinimizeBox +alwaysOnTop
Gui, t2:Font, s12
Gui, t2:Add, Edit, x21 y16 w200 h25 vStudentName, Name ;Box to type in name.
Gui, t2:Font, s10
Gui, t2:Add, Radio, x11 y42 w50 h20 vGender checked, &Male ;Radio group for gender.
Gui, t2:Add, Radio, x80 y42 w70 h20 , &Female
Gui, t2:Add, Radio, x160 y42 w80 h20 , &Neutral
Gui, t2:Font, s7
gui, t2:add, Text, x160 y1, Version 1-15-2019 ; This separates the radio groups.
Gui, t2:Font, s10
IniRead, AllSchools, SchoolList.txt ;Gets `n-delimited list from ini file.
Loop, Parse, AllSchools, `n,`r ; Parses list.
Gui, t2:Add, Radio, x12 gMySchChoice, %A_LoopField% ;Dynamically make one radio button per item.
MySchChoice: ;Activates when someone chooses a school (?)
MySchChoice := A_GuiControl
IniRead, AllNotices, NoticeDefinitions.txt ;Gets `n-delimited list from ini file.
Loop, Parse, AllNotices, `n,`r ;Parses list.
Gui, t2:Add, Button, gMyChoice, %A_LoopField% ;Dynamically make one cmd button per item.
Gui, t2:Font, s8
Gui, t2:Add, Button, t2x x12 section w45 h30 , About ;Auto-positioned button on the bottom.
Gui, t2:Add, Button, ys x61 section w45 h30 , Edit`nSchools
Gui, t2:Add, Button, ys x110 section w45 h30 , Edit`nNotices
Gui, t2:Add, Button, ys x159 section w45 h30 , Close
Gui, t2:Show, ,NOA Tool (Alt+Shift+W)
if (AllSchools = ERROR) || (AllNotices = ERROR) ; Will catch if either INI is missing.
{
MsgBox, 262192, Error Reading File, There was a problem reading from the "SchoolList.txt" file or from the "NoticeDefinitions.txt" file.`n`nPlease exit, then ensure that they are in the same folder as the NOAtool.ahk and the NOAtool.exe files. The two text (.txt) files should be formatted as Windows .ini files.
return
}
; Menu, Tray, Icon, C:\Users\SWKunkel\AutoHotkey\AutoCorrect\Icons\IconPencilThick.ico commented out for forum post.
return
MyChoice: ; Goes here when a button (notice type) is clicked.
IniRead, MyNoticeChoice, NoticeDefinitions.txt, %A_GuiControl% ; From notice type, goes back to INI, gets notice content.
gui submit
IfEqual, StudentName, Name ;Catches if student name hasn't been changed from default.
{
MsgBox Student name?
gui, t2:show
return
}
if (MySchChoice = ERROR) ;If no school has been selected, assigns first one in INI.
{
StringSplit, FirstSch, AllSchools, `n,`r
;MsgBox First school is %FirstSch1%
MySchChoice = %FirstSch1%
}
IfEqual, Gender, 1 ;Checks the results of the gender radio buttons group and assigns variables.
{
varHeShe = he
varHimHer = him
varHisHer = his
}
IfEqual, Gender, 2
{
varHeShe = she
varHimHer = her
varHisHer = her
}
IfEqual, Gender, 3
{
varHeShe = they
varHimHer = them
varHisHer = their
}
IniRead, MyContactInfo, SchoolList.txt, %MySchChoice%, Contact-info ; From school choice, gets contact info.
IniRead, MySchPhone, SchoolList.txt, %MySchChoice%, Sch-Phone
StringReplace MyNoticeChoice, MyNoticeChoice, [n], %StudentName%, All ; Makes the replacements.
StringReplace MyNoticeChoice, MyNoticeChoice, [e], %varHeShe%, All
StringReplace MyNoticeChoice, MyNoticeChoice, [m], %varHimHer%, All
StringReplace MyNoticeChoice, MyNoticeChoice, [s], %varHisHer%, All
StringReplace MyNoticeChoice, MyNoticeChoice, [c], %MyContactInfo%, All
StringReplace MyNoticeChoice, MyNoticeChoice, [p], %MySchPhone%, All
StringReplace MyNoticeChoice, MyNoticeChoice, !, ., All ; Because ! and # are special keys.
StringReplace MyNoticeChoice, MyNoticeChoice, #, No., All
MyNoticeChoice =`n%MyNoticeChoice% ; Adds an new-line at beginning so regex will work.
;CulledNotice := RegExReplace(MyNoticeChoice,"(\n)+[ a-zA-Z0-9]+=") ; Removes all Key names.
CulledNotice := RegExReplace(MyNoticeChoice,"(\n)+[ a-zA-Z0-9,/&+.\-#]+=") ; Removes all Key names. Added special chars 9-2-18.
;MsgBox %StudentName%'s school is %MySchChoice%, Gender is %varHeShe%/%varHimHer%/%varHisHer%, `n`nNotice:`n%CulledNotice%`n`n%MyContactInfo%
StringReplace, CulledNotice, CulledNotice,`n, , All ; Gets rid of any leftover <Enter>s.
SendInput, %CulledNotice% ; Types notice into text field(s)
ExitApp ; replaced Return with Exitapp on 1-24-2019 and got rid of the extra Gue, t2:Destroy.
AboutHandler:
t2ButtonAbout: ; The 4 buttons at bottom of form go to these.
;Run, AboutGVTool2.docx
MsgBox, 262192, , 'Last update was 1-15-2019.'
return
SchoolListHandler:
t2ButtonEditSchools:
Run, C:\Program Files\Just Great Software\EditPad Pro 7\EditPadPro7.exe "C:\Users\swkunkel\AutoHotkey\AutoCorrect\NOAtool\SchoolList.txt"
;run, SchoolList.txt
Gui, t2:Show
return
NoticeDefHandler:
t2ButtonEditNotices:
Run, C:\Program Files\Just Great Software\EditPad Pro 7\EditPadPro7.exe "C:\Users\swkunkel\AutoHotkey\AutoCorrect\NOAtool\NoticeDefinitions.txt"
gui, t2:show
return
t2ButtonClose:
t2GuiClose: ; Red button in corner of form.
Gui, t2:Destroy ; Destroy and start at top to forget the variables.
ExitApp
I doubt if anyone will be able to recreate this effect, but if anyone wants to try... The following text files must be in the same folder as the .AHK file.
this one must be named NoticeDefinitions.txt
Code: Select all
;==================================================================
;=== THIS FILE MUST BE IN SAME FOLDER AS TOOL EXE File. ===
;=== THIS FILE MUST BE FORMATTED AS A WINDOWS INI FILE. ===
;==================================================================
; Replacement keys to use below:
; [n] is changed to: student name as entered in the popup form
; [e] is changed to: he/she/they as chosen on the form
; [m] is changed to: him/her/them
; [s] is changed to: his/her/their (note singular/plural grammar)
; [c] is changed to: Contact-info (see SchoolList.txt)
; [p] is changed to: School-phone (see SchoolList.txt)
;####################################################################
[Referral for TESTING]
Educational Concerns=^{a}{Delete}This notice documents that [n] has been identified as a candidate for an evaluation of eligibility for special education services.
Jump={Tab}
Summary of Existing=^{a}{Delete}Information in [n]'s file, as well as input from [s] teachers and guardians indicates a history of interventions that have not successfully remediated [s] educational needs.
Jump={Tab}
Previous Ed Interventions=^{a}{Delete}Previous interventions was included such things as small group instruction and one-on-one help
;Review school interventions and put above.
Jump={Tab}{Tab}
Enrollment in Other Progs=^{a}{Delete}Other progs here. Also my contact info: [c]. And just my phone number is [p].
Jump={Tab}{Tab}
Health Screening=^{a}{Delete}[n]'s most resent vision and hearing screenings indicates functioning that is within normal limits.
;======================================================================
[Referral Notice when Candidate]
Any other factors=^{a}{Delete}Please find the attached consent-for-evaluation form. Upon receipt of [n]'s consent-for-eval form we will begin the evalation process. Remember that this consent form is only for the evaluation. If [n] does qualify for an Individualized Education Program (IEP), then you'll need to sign an additional permission form for us to start [s] services. Please call if you have any questions. [c]
Jump={Tab}{Tab}
Other options rejected=^{a}{Delete}No other options were really applicable. A file reivew and input from parents and staff suggest that an evaluation is appropriate at this time.
Jump={Tab}{Tab}
Reason rejected=^{a}{Delete}N.A.
Jump={Tab}{Tab}
Based on these procedures=^{a}{Delete}This is based on the recent referral for special education testing.
Jump={Tab}
;======================================================================
[Referral Notice when NOT A Candidate]
Any other factors=^{a}{Delete}Other factors...
Jump={Tab}{Tab}
Other options rejected=^{a}{Delete}Opt rejected..
Jump={Tab}{Tab}
Reason rejected=^{a}{Delete}WWHy?
Jump={Tab}{Tab}
Based on these procedures=^{a}{Delete}Based on this...
Jump={Tab}
;======================================================================
[PWN--Transfer ACCEPT]
Description of Action=^{a}{Delete}This notice communicates to you that we have confirmed [n]'s eligibility for IEP supports and we will begin providing those services.
Jump={Tab}{Tab}
Reason for Action=^{a}{Delete}This is based on information from [s] previous distrcit, which indicates [e] has an IEP.
Jump={Tab}{Tab}
Other Factors=^{a}{Delete}Please call if you have any questions: [c]
Jump={Tab}{Tab}
Options Rejected=^{a}{Delete}Redoing the eligibility evaluation and the IEP.
Jump={Tab}{Tab}
Reasons Rejected=^{a}{Delete}The paperwork from the previous distriction seems appropriate, so it doesn't need to be redone.
Jump={Tab}{Tab}
Based on or Proposed procudures=^{a}{Delete}This is based on [n]'s transfer paperwork.
;======================================================================
[PWN--Transfer NOT ACCEPT]
Description of Action=^{a}{Delete}This notice communicates to you that we have reviewed [n]'s IEP documents from [s] previous district. They will need to be updated. We will initiate a reevaluation.
Jump={Tab}{Tab}
Reason for Action=^{a}{Delete}This is based on information from [s] previous distrcit, which indicates [e] has an IEP.
Jump={Tab}{Tab}
Other Factors=^{a}{Delete}Please call if you have any questions: [c]
Jump={Tab}{Tab}
Options Rejected=^{a}{Delete}Not applicable. We will have to redo the eligibility evaluation to conform to Wa State regulations.
Jump={Tab}{Tab}
Reasons Rejected=^{a}{Delete}N/A
Jump={Tab}{Tab}
Based on or Proposed procudures=^{a}{Delete}This is based on [n]'s transfer paperwork.
;======================================================================
[PWN Need to do TRIennial REEVAL]
Description of Action=^{a}{Delete}This form notifies you that we need to do [n]'s three-year reevaluation for [s] IEP services.
Jump={Tab}{Tab}
Reason for Action=^{a}{Delete}The reevaluation allows us to see what progress [e] has made and document that [e] does (or does not) still require IEP services.
Jump={Tab}{Tab}
Other Factors=^{a}{Delete}(1)Please note that we are required to do the reevaluation, even if you don't return the attached permission form. (2)If you have any questions or information for the reeval, please contact me: [c]
Jump={Tab}{Tab}
Options Rejected=^{a}{Delete}None applicable. Reevaluations are required by law.
Jump={Tab}{Tab}
Reasons Rejected=^{a}{Delete}None applicable/Noting rejected.
Jump={Tab}{Tab}
Based on or Proposed procudures=^{a}{Delete}Reevaluations are usually based on a file review, observations, input from teachers and parents, and testing. See also attached permission form.
;======================================================================
[Reeval Caveat Statement]
Tests=^{a}{Delete}This will likely involve updated reading, writing, and math testing with the Woodcock-Johnson Test of Achievement-4th (WJ-IV). [n]'s social/emotional/behavioral levels will likely be assessed with the Behavior Assessment System for Children-Third Ed. (BASC-3) rating scales. This includes questionnaires for teachers and parents and has an optional student self-rating component.{Enter}
NOTE: The form says below that we cannot proceed with [n]'s evaluation unless you sign and return this form. For RE-evaluations, such as this one, we are actually required to do the reevaluation (unless a waiver has been signed) even if this form is never returned. Also, with initial evaluations, there is a strict 35-school-day @@@@@
[PWN Consent for Initial EVAL]
Description of Action=^{a}{Delete}This form notifies you that we are seeking consent to do an evaluation-of-eligibility for [n].
Jump={Tab}{Tab}
Reason for Action=^{a}{Delete}An evaluation determines whether [e] qualifies for, and is in need of, an Individualized Education Program (IEP).
Jump={Tab}{Tab}
Other Factors=^{a}{Delete}(1) Please note that this consent form is only for the evaluation. If [n] does qualify, you'll need to sign an additional consent form before [e] can start IEP services. (2) If you have any questions or information for the eval, please contact me: [c]
Jump={Tab}{Tab}
Options Rejected=^{a}{Delete}Not doing the evaluation.
Jump={Tab}{Tab}
Reasons Rejected=^{a}{Delete}An evaluation does seem to be appropriate at this time.
Jump={Tab}{Tab}
Based on or Proposed procudures=^{a}{Delete}This is based on referral conserns as well as information from parents and a file-review.
;======================================================================
Code: Select all
;==================================================================
;=== THIS FILE MUST BE IN SAME FOLDER AS TOOL. ===
;=== THIS FILE MUST BE FORMATTED AS A WINDOWS INI FILE. ===
;=== [Section] Names get used in the Form's Radio Buttons. ===
;=== Key Names should be "Contact-info" or "Sch-Phone". ===
;==================================================================
[&KMS]
Contact-info=Stephen Kunkel, xxxxxxxxxxxxxxxxxxxxxxx
Sch-Phone=12345
[&NKHS]
Contact-info=Stephen Kunkel,xxxxxxxxxxxxxxxxxxxxxxx
Sch-Phone=12345667
[Wolfle]
Contact-info=Stephen Kunkel, xxxxxxxxxxxxxxxxx
https://autohotkey.com/docs/commands/Send.htm
Looking for things to try, to remedy this, but didn't see anything useful.... What would you guys try?