Here is my finaly code.. tested and working.. In case anyone in the future ever has a task like this. Maybe this code will help them get started.
Thanks everyone!
Code:
^x::
MsgBox, 4, , Do you want to start import? (Press YES or NO)
IfMsgBox No
return
FileSelectFile, SelectedFile, 3, , Open a file, Text Documents (*.csv; *.txt)
if SelectedFile =
MsgBox, No File Selection Made. Import Process Canceled.
else
SetKeyDelay, 200, 100
sleep 2000
loop {
FileReadLine, line, %SelectedFile%, %A_index%
if ErrorLevel {
if (A_index == 1)
SendInput FILE READ ERROR
break
}
StringSplit, array, line, `,, %A_space%
if (array0 == 0)
continue
loop, %array0% {
tmp := array%a_index%
}
manufacturer=shar
department=7
partnumber=%array1%
partnumber := SubStr( partnumber . " ", 1, 12 )
description=%array2%
description := SubStr( description . " ", 1, 28 )
StringLeft, listprice, array3, 7
StringLeft, cost, array4, 7
StringLeft, qty, array5, 6
Send ay%manufacturer%{Enter}{Enter}{Enter}%partnumber%%department%{enter}{enter}
sleep 1000
Send {enter}{F1}{enter}%description%%qty%{enter}0{enter}-1{enter}{enter}{enter}{enter}{enter}%listprice%{enter}%cost%{enter}d{enter}n
SoundPlay *-1
sleep 2000
}
MsgBox All Done!
return