Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Created February 3, 2023 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoeGlines/bbede65dcf5319016ac5d616df65ff7a to your computer and use it in GitHub Desktop.
Save JoeGlines/bbede65dcf5319016ac5d616df65ff7a to your computer and use it in GitHub Desktop.
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey courses.
;They're structured in a way to make learning AHK EASY: https://the-Automator.com/Learn
;*******************************************************
#Include <default_Settings>
;**************************************
var=
(
Email First_Name Last_Name
joejunkemail@yahoo.com Joe King
Joe@the-Automator.com Joseph GLines
)
;*********Use For loop over Var going line by line*********************
for i, row in Loopobj:=StrSplit(var,"`n","`r`n") { ;Parse Var on each new line
SetTaskbarProgress((i/(Loopobj.Count()-1))*100,"P",WinExist("ahk_class AutoHotkeyGUI")) ;pwb is to IE, N=green, P=Yellow E=Red ;Taskbar notifier for loop
IfEqual, i,1,continue ;Skip header row
IfLessOrEqual,i,4382,continue
IfEqual, row,,continue ;Skip loop if blank
IfEqual, row,Stop,break ;Break if stop (not case sensitive)
IfEqual, row,%var%,continue ;Note- need to use percents if variable
IfEqual, row,1,SetEnv,Data,Region SBE MonthCalYear ;set header row in loop
Menu , tray, tip, % round((i-1)/(Loopobj.Count()-1)*100) "% done. " i-1 " of " Loopobj.Count()-1 " : email is " StrSplit(row,"`t").1 ;Show progress on icon in system tray
MsgBox % StrSplit(row,"`t").1 a_tab StrSplit(row,"`t").2 a_tab StrSplit(row,"`t").3 ;demonstrate values
if(mod(i,10)=0) ;Use this if want to step every 10th item
msgbox % i a_tab "10th step"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment