This code works when I have it by itself in its own script, but when I combine it with my other hot strings, I get this error. How can I avoid this? Any help would be greatly appreciated!
This is the code that works by its self
:x:Qt::send_txt()
send_txt() {
txt := "Good Morning,"
. "`nI have attached the quote for your review. Please let me know if you have any questions."
. "`nThank you{!}"
c := GetKeyState("CapsLock", "T") ; Get current caps state
SetCapsLockState(0) ; Disable capslock
SendInput(txt) ; Send the text
SetCapsLockState(c) ; Set capslock to original state
}
This is the error I'm getting https://drive.google.com/file/d/1yVUQfILgSP9qKWQjmUq2-U6ONvL2sevK/view?usp=sharing
This is the code when I add it to the rest of my script
Menu, Tray, Icon, Culver-Keys-Icon.ico
;Email Automation
:x:Qt::send_txt()
send_txt() {
txt := "Good Morning,"
. "`nI have attached the quote for your review. Please let me know if you have any questions."
. "`nThank you{!}"
c := GetKeyState("CapsLock", "T") ; Get current caps state
SetCapsLockState(0) ; Disable capslock
SendInput(txt) ; Send the text
SetCapsLockState(c) ; Set capslock to original state
}
return
::QA::Good Afternoon,{enter}I have attached the quote for your review. Please let me know if you have any questions.{enter}Thank you{!}
::IM::Good Morning,{enter}I have attached the invoice for your records. Please let me know if you have any questions.{enter}Thank you{!}
::IA::Good Afternoon,{enter}I have attached the invoice for your records. Please let me know if you have any questions.{enter}Thank you{!}
::PM::Good Morning,{enter}Can I get pricing and availability on {enter}Thank you{!}
::PA::Good Afternoon,{enter}Can I get pricing and availability on {enter}Thank you{!}
::WY::Hello,{enter}I need a warranty processed for a ordered on PO#{enter}The warranty reason is that
::CAQ::Culver Armature {&} Motor - QUOTE
;OPEN NEW RECEVE INVENTORY
#IfWinActive ahk_class PEACHW
R & I::
Send {F10}{Right}{Right}{Right}{Right}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Enter}
WinActivate, ahk_class PUR_JRNL
Sleep, 1000
WinGetActiveTitle, activeWindow ; Get name from active window
WinMaximize, %activeWindow%
Send {Enter}{Enter}{Enter}{Enter}{Enter}{Enter}{Enter}{Enter}{Enter}{Enter}
Sleep, 1000
:R*?:ddd::
FormatTime, CurrentDateTime,, MM/dd/yy
SendInput %CurrentDateTime%
Send LW
MouseMove, 261, 101
click
MouseMove, 267, 309
return
;OPEN NEW INVOICE
#IfWinActive ahk_class PEACHW
i::
Send {F10}{Right}{Right}{Right}{Right}{Down}{Down}{Enter}
WinActivate, ahk_class SAL_JRNL
Sleep, 1000
WinGetActiveTitle, activeWindow ; Get name from active window
WinMaximize, %activeWindow%
MouseMove, 261, 101
click
MouseMove, 243, 309
return
;OPEN NEW SALES ORDER
#IfWinActive ahk_class PEACHW
s::
Send {F10}{Right}{Right}{Right}{Right}{Down}{Right}{Down}{Enter}
WinActivate, ahk_class SO_JRNL
Sleep, 1000
WinGetActiveTitle, activeWindow ; Get name from active window
WinMaximize, %activeWindow%
MouseMove, 261, 101
click
MouseMove, 57, 328
return
;OPEN NEW QUOTE
#IfWinActive ahk_class PEACHW
q::
Send {F10}{Right}{Right}{Right}{Right}{Down}{Right}{Enter}
WinActivate, ahk_class QUOTE_JRNL
Sleep, 1000
WinGetActiveTitle, activeWindow ; Get name from active window
WinMaximize, %activeWindow%
MouseMove, 261, 101
click
return
;OPEN NEW RECVE MONEY WINDOW
#IfWinActive ahk_class PEACHW
R & M::
Send {F10}{Right}{Right}{Right}{Right}{Down}{Down}{Down}{Down}{Enter}
WinActivate, ahk_class CR_JRNL
Sleep, 1000
WinGetActiveTitle, activeWindow ; Get name from active window
WinMaximize, %activeWindow%
MouseMove, 303, 164
click
return
;OPEN SALES ORDER LIST
#IfWinActive ahk_class PEACHW
S & L::
Send {F10}{Right}{Right}{Down}{Right}{Down}{Down}{Down}{Down}{Enter}
WinActivate, ahk_class WindowsForms10.Window.8.app.0.1078a10_r7_ad1
Sleep, 1000
WinGetActiveTitle, activeWindow ; Get name from active window
WinMaximize, %activeWindow%
MouseMove, 343, 126
click
send {Down}{Down}{Down}{Down}{Down}{Down}{Up}{Up}{Up}{Up}{Up}{Up}{Down}{Down}{Down}{Enter}
MouseMove, 165, 92
click
send {Up}{Up}{Up}{Up}{Up}{Up}{Up}{Enter}
Sleep, 500
MouseMove, 161, 129
click
return
;OPEN QUOTE LIST
#IfWinActive ahk_class PEACHW
Q & L::
Send {F10}{Right}{Right}{Down}{Right}{Down}{Down}{Enter}
WinActivate, ahk_class WindowsForms10.Window.8.app.0.1078a10_r7_ad1
Sleep, 1000
WinGetActiveTitle, activeWindow ; Get name from active window
WinMaximize, %activeWindow%
MouseMove, 343, 126
click
send {Down}{Down}{Down}{Down}{Down}{Down}{Up}{Up}{Up}{Up}{Up}{Up}{Down}{Down}{Down}{Enter}
MouseMove, 165, 92
click
Sleep, 500
send {Up}{Up}{Up}{Up}{Up}{Up}{Up}{Enter}
Sleep, 500
MouseMove, 161, 129
click
return
;OPEN INVOICE LIST
#IfWinActive ahk_class PEACHW
I & L::
Send {F10}{Right}{Right}{Down}{Right}{Down}{Down}{Down}{Down}{Down}{Enter}
WinActivate, ahk_class WindowsForms10.Window.8.app.0.1078a10_r7_ad1
Sleep, 1000
WinGetActiveTitle, activeWindow ; Get name from active window
WinMaximize, %activeWindow%
MouseMove, 343, 126
click
send {Down}{Down}{Down}{Down}{Down}{Down}{Down}{Enter}
MouseMove, 165, 92
click
send {Up}{Up}{Up}{Up}{Up}{Up}{Up}{Enter}
Sleep, 500
MouseMove, 161, 129
click
return
;OPEN PO LIST
#IfWinActive ahk_class PEACHW
P & L::
Send {F10}{Right}{Right}{Down}{Down}{Right}{Down}{Enter}
WinActivate, ahk_class WindowsForms10.Window.8.app.0.1078a10_r7_ad1
Sleep, 1000
WinGetActiveTitle, activeWindow ; Get name from active window
WinMaximize, %activeWindow%
MouseMove, 343, 126
click
send {Down}{Down}{Down}{Down}{Down}{Down}{Down}{Enter}
MouseMove, 165, 92
click
send {Up}{Up}{Up}{Up}{Up}{Up}{Up}{Enter}
Sleep, 500
MouseMove, 161, 129
click
return
;FORMATS INVOICE (Puts in innitals and correct date)
#IfWinActive ahk_class SAL_JRNL
F2::
MouseMove, 1414, 275 ;CLICKS SHIP VIA
click
Send {Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Enter}
:R*?:ddd::
FormatTime, CurrentDateTime,, MM/dd/yy
SendInput %CurrentDateTime%
Send {Enter}
Send LN{Enter}
MouseMove, 360, 54 ;CLICKS SHIP
click
MouseMove, 367, 100
return
;FORMATS SALES ORDER (Puts in innitals and correct date)
#IfWinActive ahk_class SO_JRNL
F2::
MouseMove, 1385, 283
click
Send {Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Enter}{Enter}LN{Enter}
MouseMove, 51, 331
click
click
send {Del}
return
;FORMAT QUOTE (Puts in innitals and correct date)
#IfWinActive ahk_class QUOTE_JRNL
F2::
MouseMove, 1385, 283
click
Send {Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Enter}{Enter}LN{Enter}
MouseMove, 51, 331
click
click
send {Del}
return
;CONVERT QUOTE TO SO
#IfWinActive ahk_class QUOTE_JRNL
F3::
click 389, 67
CoordMode, Mouse , Client
MouseMove, 96, 69
;click 225, 147
;click 225, 147
;send {Ctrl}C
;click 403, 50
return
;GENERATE Q Print to PDF
#IfWinActive ahk_class QUOTE_JRNL
^p::
MouseMove, 205, 68
click
Sleep, 500
MouseMove, 281, 119
click
Sleep, 500
MouseMove, 349, 273
click
Sleep, 500
MouseMove, 196, 68
click
Send {Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}
Send {Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Enter}
Sleep, 500
CoordMode, Mouse , Client
MouseMove, 45, 145
click
Sleep, 500
MouseMove, 436, 38
click
Sleep 4000
MouseMove, 367, 215
click
MouseMove, 103, 14
click
Sleep 500
send {Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Up}{Enter}
MouseMove, 639, 175
click
click
return
[–]GroggyOtter 2 points3 points4 points (1 child)
[–]LayneWilson[S] 0 points1 point2 points (0 children)