diff --git a/Launcher.ahk b/Launcher.ahk index d49b9e7..68e5d5d 100644 --- a/Launcher.ahk +++ b/Launcher.ahk @@ -21,9 +21,19 @@ SetKeyDelay, 50 #Include includes\TextExpansions.ahk ;; Text expansions for autohotkey ;#Include includes\ChromeController.ahk ;; S1 chrome controls for AMGP #Include includes\QuickSearch.ahk ;; Quicksearch / shortcut tools - +#Include includes\PrintHomeVisitsImageSearch.ahk +#Include includes\EPS.ahk ; Reload Script after changes (Ctrl + F1) ^F1:: Reload +Return + +F15:: +Menu MyMenu, Add, View EPS, LoadEPS +Menu MyMenu, Add, Sign Px, signpx +Menu MyMenu, Add, Print home visits, PrintHomeVisits +Menu MyMenu, Add, Med3, med3 +Menu MyMenu, Add, Enter notes from AMGP, copyemailnotes +Menu MyMenu, Show Return \ No newline at end of file diff --git a/assets/eps/prescription_icon.png b/assets/eps/prescription_icon.png new file mode 100644 index 0000000..8da3201 Binary files /dev/null and b/assets/eps/prescription_icon.png differ diff --git a/assets/eps/prescription_select_all.png b/assets/eps/prescription_select_all.png new file mode 100644 index 0000000..36b1344 Binary files /dev/null and b/assets/eps/prescription_select_all.png differ diff --git a/assets/eps/prescription_selected.png b/assets/eps/prescription_selected.png new file mode 100644 index 0000000..e88711c Binary files /dev/null and b/assets/eps/prescription_selected.png differ diff --git a/assets/homevisits/home_visit_icon.png b/assets/homevisits/home_visit_icon.png new file mode 100644 index 0000000..1dfae85 Binary files /dev/null and b/assets/homevisits/home_visit_icon.png differ diff --git a/assets/homevisits/home_visit_summary.png b/assets/homevisits/home_visit_summary.png new file mode 100644 index 0000000..f1f1ccf Binary files /dev/null and b/assets/homevisits/home_visit_summary.png differ diff --git a/assets/homevisits/home_visit_summary_entry.png b/assets/homevisits/home_visit_summary_entry.png new file mode 100644 index 0000000..bbf1efd Binary files /dev/null and b/assets/homevisits/home_visit_summary_entry.png differ diff --git a/assets/homevisits/home_visit_wrench.png b/assets/homevisits/home_visit_wrench.png new file mode 100644 index 0000000..826e01c Binary files /dev/null and b/assets/homevisits/home_visit_wrench.png differ diff --git a/includes/EPS.ahk b/includes/EPS.ahk new file mode 100644 index 0000000..dc87e99 --- /dev/null +++ b/includes/EPS.ahk @@ -0,0 +1,62 @@ +; This script was created using Pulover's Macro Creator +; www.macrocreator.com + +#NoEnv +SetWorkingDir %A_ScriptDir% +CoordMode, Mouse, Screen +SendMode Input +#SingleInstance Force +SetTitleMatchMode 2 +#WinActivateForce +SetControlDelay 1 +SetWinDelay 0 +SetKeyDelay -1 +SetMouseDelay -1 +SetBatchLines -1 + + +LoadEPS: +CoordMode, Pixel, Screen +ImageSearch, FoundX, FoundY, 0, 0, 2560, 1440, assets\eps\prescription_icon.png +CenterImgSrchCoords("assets\eps\prescription_icon.png", FoundX, FoundY) +If ErrorLevel + Return +FoundX := FoundX+45 +CoordMode, Mouse, Screen +Click, %FoundX%, %FoundY% Left, 2 +Sleep, 10 +Sleep, 200 +CoordMode, Pixel, Screen +ImageSearch, FoundX, FoundY, 0, 0, 2560, 1440, assets\eps\prescription_select_all.png +CenterImgSrchCoords("assets\eps\prescription_select_all.png", FoundX, FoundY) +If ErrorLevel +{ + MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue. + IfMsgBox, Cancel + Return +} +CoordMode, Mouse, Screen +Click, %FoundX%, %FoundY% Left, 1 +Sleep, 10 +Sleep, 200 +CoordMode, Pixel, Screen +ImageSearch, FoundX, FoundY, 0, 0, 2560, 1440, assets\eps\prescription_selected.png +CenterImgSrchCoords("assets\eps\prescription_selected.png", FoundX, FoundY) +If ErrorLevel +{ + MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue. + IfMsgBox, Cancel + Return +} +CoordMode, Mouse, Screen +Click, %FoundX%, %FoundY% Right, 1 +Sleep, 10 +Send, {Enter} +Return + +^G:: ;; Px +signpx: +Send {Space 50} +Send +{Home} +Send {Del} +return \ No newline at end of file diff --git a/includes/PrintHomeVisitsImageSearch.ahk b/includes/PrintHomeVisitsImageSearch.ahk new file mode 100644 index 0000000..18c1ec3 --- /dev/null +++ b/includes/PrintHomeVisitsImageSearch.ahk @@ -0,0 +1,86 @@ +; This script was created using Pulover's Macro Creator +; www.macrocreator.com + +#NoEnv +SetWorkingDir %A_ScriptDir% +CoordMode, Mouse, Screen +SendMode Input +#SingleInstance Force +SetTitleMatchMode 2 +#WinActivateForce +SetControlDelay 1 +SetWinDelay 0 +SetKeyDelay -1 +SetMouseDelay -1 +SetBatchLines -1 + +; UserGlobalVars + +F18:: +PrintHomeVisits: +CoordMode, Pixel, Screen +CoordMode, Mouse, Screen +ImageSearch, FoundX, FoundY, 893, 661, 2455, 1439, assets\homevisits\home_visit_icon.png +CenterImgSrchCoords("assets\homevisits\home_visit_icon.png", FoundX, FoundY) +If (ErrorLevel) +{ + MsgBox, 0, , Couldn't find the home visit icon + Return +} +FoundX := FoundX + 43 +Click, %FoundX%, %FoundY% Left, 2 +Sleep, 10 +Sleep, 300 +CoordMode, Pixel, Screen +CoordMode, Mouse, Screen +ImageSearch, FoundX, FoundY, 0, 0, 2560, 1440, assets\homevisits\home_visit_wrench.png +CenterImgSrchCoords("assets\homevisits\home_visit_wrench.png", FoundX, FoundY) +If (ErrorLevel) +{ + MsgBox, 0, , Couldn't find Spanner Icon + Return +} +VisitsY := FoundY+50 +Click, %FoundX%, %VisitsY% Left, 1 +Sleep, 10 +Loop, 10 +{ + Send, +{Down} +} +Click, %FoundX%, %FoundY% Left, 1 +Sleep, 10 +Sleep, 300 +Loop, 18 +{ + Send, {Down} +} +Send, {Enter} +Sleep, 300 +CoordMode, Pixel, Screen +CoordMode, Mouse, Screen +ImageSearch, FoundX, FoundY, 0, 0, 2560, 1440, assets\homevisits\home_visit_summary.png +If (ErrorLevel = 0) +{ + FoundY := FoundY-100 + Click, %FoundX%, %FoundY% Left, 1 + Sleep, 10 + Loop, 50 + { + Send, {PgDn} + Sleep, 100 + CoordMode, Pixel, Screen + CoordMode, Mouse, Screen + ImageSearch, FoundX, FoundY, 0, 0, 2560, 1440, assets\homevisits\home_visit_summary_entry.png + If (ErrorLevel = 0) + { + Click, %FoundX%, %FoundY% Left, 2 + Sleep, 10 + Break + } + } +} +Else +{ + MsgBox, 0, , Couldn't find Name title in Summary Printout Window +} +Return \ No newline at end of file diff --git a/includes/S1Utils.ahk b/includes/S1Utils.ahk index 44df0f3..1dc7887 100644 --- a/includes/S1Utils.ahk +++ b/includes/S1Utils.ahk @@ -54,18 +54,19 @@ Return ;; Med3, Not fit for work, Free Text, in S1. To do this Assign med3 to F12 menu under letter M ^M:: +med3: Send {F12} Sleep 200 SendRaw {m} Sleep 1000 Send {Space} Send {Tab 4} -Send {Space} -Send {Tab} + return ;; Copy email notes into record ^+E:: +copyemailnotes: ClipBoard := RegExReplace(ClipBoard, "\R+\R", "`r`n") ; Removes blank lines Send ^w Sleep 600 @@ -96,8 +97,3 @@ Send {End} Send {PgDn 2} return -^G:: ;; Px -Send {Space 50} -Send +{Home} -Send {Del} -return diff --git a/libraries/helper_library.ahk b/libraries/helper_library.ahk index 88a69bb..bc44e13 100644 --- a/libraries/helper_library.ahk +++ b/libraries/helper_library.ahk @@ -30,4 +30,18 @@ check_in_win_title(match) { } else { return false } +} + +; From pulovers macro creator +CenterImgSrchCoords(File, ByRef CoordX, ByRef CoordY) +{ + static LoadedPic + LastEL := ErrorLevel + + Gui, Pict:Add, Pic, vLoadedPic, % RegExReplace(File, "^(\*\w+\s)+") + GuiControlGet, LoadedPic, Pict:Pos + Gui, Pict:Destroy + CoordX += LoadedPicW // 2 + CoordY += LoadedPicH // 2 + ErrorLevel := LastEL } \ No newline at end of file