Saturday, 21 May 2011

More macros

Ah but of course it is never so simple...

If the patient has a Vision reminders (yellow box) open then this gets the focus when you do winactivate.

So, this is my solution though I am sure there must be a more elegant one...

;Send focus to Consultation Manager
Set_Focus_ConMan:
Process, Exist,conmgr.exe ; set the variable errorLevel to the PID of con man
if ErrorLevel ; If Errorlevel is not zero then it is the PID of conman so
IfWinActive, ahk_pid %ErrorLevel% ; if it already active do nothing!
{
ExitApp
}
else ;otherwise...
{
WinActivate, ahk_pid %ErrorLevel% ; activate conman
IfWinActive, Patient Reminders ; and if the reminders are there they get the focus! So, close them
{
WinClose, Patient Reminders
sendinput, !vr ; then reopen them and conman will now be properly activated and have the focus
}
}
IF NOT ErrorLevel ; if errorlevel is zero con man is not running.
MsgBox,,Macro Run Error!, Consultation Manager is not running!
ExitApp

Read more...

Thursday, 19 May 2011

Autohotkey Vision

Hello. Been a bit busy :)

Have started playing with Authohotkey, which is super if a somewhat a steep learining curve. Far more powerful than MacroExpress. Pleased today as this script:

Set_Focus_ConMan:
^+C::
Process, Exist,conmgr.exe
WinActivate, ahk_pid %ErrorLevel%
return

activates Consultation Manager as the active window, either as a subroutine when called or via the hotkey CTRL+SHIFT+C. I will call it as a subroutine, the hotkey was just to show it works.

This is good because MacroExpress could never do this reliably for me.

:)

Read more...