AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AHK sometimes disabled in Microsoft Word

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Wolfer



Joined: 08 Nov 2005
Posts: 14
Location: Chicago, IL

PostPosted: Sun Mar 02, 2008 8:53 am    Post subject: AHK sometimes disabled in Microsoft Word Reply with quote

I have been finding that AHK stops working in Microsoft Word 2003 after it's been open a while. Still works in Excel and everything else, but the scripts just will not function in Word. Close AHK, reopen, no help. Reload script, no help. Have to reboot the computer to reset and make it functional again.

Any idea what's causing this? I'm using VISTA 32 bit.
Back to top
View user's profile Send private message
BoBoĻ
Guest





PostPosted: Mon Mar 03, 2008 8:23 am    Post subject: Reply with quote

To reproduce the error it would make sense to see your code.
Back to top
Wolfer



Joined: 08 Nov 2005
Posts: 14
Location: Chicago, IL

PostPosted: Mon Mar 03, 2008 2:50 pm    Post subject: Word problem Reply with quote

Do you mean, my script?

Here it is. The only one directly related to Word is the line starting
Quote:
#IfWinActive ahk_class OpusApp
which is just a shortcut to move between Word documents.
Most of it is macros to take my very clunky electronic medical record through a zillion little irritating steps needed to get anything done. Right now AHK saves me about 50-60 minutes per week of just clicking on buttons and menus.
Curiously, I have found that if I close Word when AHK stops working, then reopen a NEW document, AHK will work. If I then reopen an existing document, AHK stops working.
It also stops working in another program I use called Keynote.
I appreciate any help you can give.
__________________________________

Code:
; the remap scripts on the next two lines do not work consistently on VISTA
; +CapsLock::CapsLock

ScrollLock::return

SetTitleMatchMode, RegEx

:o:o4::'04
:o:o5::'05
:o:o6::'06
:o:o7::'07
:o:o8::'08

#IfWinActive ahk_class OpusApp
^!Right::Send, ^{F6}
^!Left::Send, ^+{F6}
#IfWinActive

#g::
Run http://www.gmail.com
WinWaitActive, Gmail: Email from Google - Mozilla Firefox
Sleep, 1000
Send, rmwolfe{tab}12345{Enter}
return

^!j::Run, C:\Program Files\JRuler\JRuler.exe

::]dt::
FormatTime, CurrentDateTime,, M/dd/yyyy h:mm tt
SendInput %CurrentDateTime%
return

::]dl::
FormatTime, CurrentDateTime,, MMMM d, yyyy
SendInput %CurrentDateTime%
return

::]ds::
FormatTime, CurrentDateTime,, M/dd/yyyy
SendInput %CurrentDateTime%
return

::]t::
FormatTime, CurrentDateTime,, h:mm tt
SendInput %CurrentDateTime%
return

^MButton::
Send, {Click right}
Send, {Down}{Down}{Down}{Down}{Enter}
return

^!m::
IfWinExist ahk_class metapad
   WinActivate
else
   Run C:\Program Files\metapad\metapad.exe
return

::cac:: ; Call encounter close from List
MouseClick, left,  638,  145
Sleep, 600
MouseClick, left,  505,  147
Sleep, 600
MouseClick, left,  101,  145
Sleep, 600
MouseClick, left,  567,  229
return

::cacl::  ; Close Call Encounter from Call Documentation
Send, {F8}{F8}{F8}
Sleep, 600
Send, !u
return

::cardlab:: ; Cardiac lab flowsheet from Review right after opening from List
Send, {CTRLDOWN}{DOWN}{CTRLUP}
Send, {ESC}
Sleep, 600
Send, 163{ENTER}
return

::caop::
MouseClick, left,  874,  140
Sleep, 200
Send, {CTRLDOWN}{SHIFTDOWN}n{SHIFTUP}{CTRLUP}
return

::ccgo:: ; route to clinical staff w/o exiting encounter
Send, {SHIFTDOWN}{CTRLDOWN}r{SHIFTUP}{CTRLUP}
Send, p lw{Enter}{down}{Enter}
return

::ccgocl:: ; route to clinical staff and exit encounter
Send, {SHIFTDOWN}{CTRLDOWN}r{SHIFTUP}{CTRLUP}
Sleep, 600
Send, p lw{Enter}{down}{Enter}
Sleep, 600
Send, ^w
return

::diablab:: ; Diabetic lab flowsheet from Review
Send, {CTRLDOWN}{DOWN}{CTRLUP}
Send, {ESC}
Sleep, 600
Send, 74{ENTER}
return
; Send Message (from Review)
;::seme::
MouseClick, left,  76,  37
Sleep, 400
Send, v{LEFT}{DOWN}{RIGHT}{DOWN}{ENTER}
return

::enfi::
Send, ^{Down}^{Down}^{Down}
Sleep, 1400
Send, {Altdown}f{Altup}
Sleep, 300
MouseClick, left,  180,  300
return

::enme:: ; go to Enter Message
Send, {Altdown}d{Altup}
Send, {Down}{Down}{Down}{Down}{Enter}
Sleep, 1000
Send, {Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}
return

::enhc::
MouseClick, left,  75,  30
Sleep, 250
Send, v{LEFT}{DOWN}{RIGHT}{DOWN}{ENTER}
return

::labgo::  ; Go to Lab review (from open chart)
MouseClick, left,  38,  174
Sleep, 400
MouseClick, left,  221,  208
return

::medfi::  ;Medication Filter
MouseClick, left,  36,  401
Sleep, 400
Send, !h
Sleep, 400
MouseClick, left,  378,  428
return

::orgo::  ;go to Orders section from open record
MouseClick, left,  715,  146
Sleep, 500
Send, {CTRLDOWN}o{CTRLUP}
return

::nofi::
MouseClick, left,  48,  171
Sleep, 250
MouseClick, left,  760,  214
Sleep, 250
MouseClick, left,  151,  177
Sleep, 250
return

::pnec:: ; type Patient notified via ENH Connect
MouseClick, left,  614,  144
Sleep, 500
Send, Patient notified via ENH Connect
MouseClick, left,  66,  198
Sleep,500
Send, {ALTDOWN}a{ALTUP}
Sleep, 500
Send, !n{Down}{Enter}
Sleep, 400
Send, !e{Down}{Enter}
Sleep, 600
MouseClick, left, 336, 225
return

::pnlab:: ; type Patient notified in lab, close
MouseClick, left,  614,  144
Sleep, 500
Send, patient***{SPACE}notified of results
Sleep, 2000
MsgBox, 4, , Would you like to continue?, 4  ; 2-second timeout.
IfMsgBox, No
    Return  ; User pressed the "No" button.
IfMsgBox, Timeout
    Return ; i.e. Assume "No" if it timed out.
; Otherwise, continue:
MouseClick, left,  66,  198
Sleep,500
Send, {ALTDOWN}a{ALTUP}
Sleep, 500
Send, !n{Down}{Enter}
Sleep, 400
Send, !e{Down}{Enter}
Sleep, 600
MouseClick, left, 336, 225
return

::pnltr:: ; type Letter sent to patient
MouseClick, left,  614,  144
Sleep, 500
Send, Letter sent to patient
Sleep, 600
MsgBox, 4,, Would you like to continue?
IfMsgBox, No
    return
; Otherwise, the user picked yes.
else
MouseClick, left,  66,  198
Sleep,500
Send, {ALTDOWN}a{ALTUP}
Sleep, 500
Send, !n{Down}{Enter}
Sleep, 400
Send, !e{Down}{Enter}
Sleep, 600
MouseClick, left, 336, 225
return

::pnrad:: ; type Radiology will notify patient
MouseClick, left,  614,  144
Sleep, 500
Send, Radiology will notify patient
Sleep,500
Send, {ALTDOWN}a{ALTUP}
Sleep, 500
Send, !n{Down}{Enter}
Sleep, 400
Send, !e{Down}{Enter}
Sleep, 600
MouseClick, left, 336, 225
return

::snsp:: ; put specialist name in SnapShot section from Review
MouseClick, left,  40,  158
Sleep, 600
MouseClick, left,  981,  634
return

::pntel:: ; type See telephone encounter
MouseClick, left,  614,  144
Sleep, 500
Send, Patient*** notified; see telephone encounter
Sleep, 3000
MsgBox, 4, , Would you like to continue?, 4  ; 3-second timeout.
IfMsgBox, No
    Return  ; User pressed the "No" button.
IfMsgBox, Timeout
    Return ; i.e. Assume "No" if it timed out.
; Otherwise, continue:
MouseClick, left,  66,  198
Sleep,500
Send, {ALTDOWN}a{ALTUP}
Sleep, 500
Send, !n{Down}{Enter}
Sleep, 400
Send, !e{Down}{Enter}
Sleep, 600
MouseClick, left, 336, 225
return

::pnec:: ; Patient notified via ENH Connect
MouseClick, left,  604,  148
Sleep, 100
Send, {SHIFTDOWN}Patient informed via ENH Connect
Send, {ALTDOWN}l{ALTUP}{ALTDOWN}a{ALTUP}
return

::procgo:: ; go to Procedures from open encounter
Send, ^o
Sleep, 600
Send, !l
Sleep, 600
Send, p
Send, p
Send, p
Send, p
return

::restel:: ; create Tel Encounter for results phone call from Results section
MouseClick, left,  772,  157
Sleep, 100
MouseClick, left,  190,  346
Sleep, 100
Send, 95{ENTER}{ENTER}
Sleep, 400
Send, {ALTDOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{ALTUP}
return

::rrr::
MouseClick, left, 1400, 150
Send, {Down}{Enter}
Sleep, 1000
MouseClick, left, 540, 185
Sleep, 800
MouseClick, left, 150, 184
Sleep, 800
MouseClick, left, 450, 180
Sleep, 800
Send, Results{tab}.mronline{Enter}{Up}
return

::rrv:: ; Results release from Review (not from List)
Send, !t
Sleep, 800
Send, p{ENTER}
return

::rxgo:: ; from Rx list, go to order section to modify Rx
MouseClick, left,  716,  158
Sleep, 600
Send, {CTRLDOWN}o{CTRLUP}
return

::rxph:: ; from Rx list, go to order section to modify pharmacy
MouseClick, left,  716,  158
Sleep, 600
Send, {CTRLDOWN}o{CTRLUP}
Sleep, 2400
Send, !h
Sleep, 600
Send, {TAB}{TAB}{TAB}
return

::vdd:: ;Done + refresh list
Send, {ALTDOWN}n{ALTUP}
Sleep, 200
Send, {DOWN}{ENTER}
Sleep, 200
Send, {ALTDOWN}e{ALTUP}
Sleep, 200
Send, {DOWN}{ENTER}
Sleep, 200
MouseClick, left,  546,  226
return

:o:vrr:: ;refresh list
Send, {ALTDOWN}e{ALTUP}
Sleep, 100
Send, {DOWN}{ENTER}
Sleep, 100
MouseClick, left,  546,  226
return

:*:/line::__________________________________

:O:l9925::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99999{tab}{tab}{tab}25{tab}{tab}{tab}{Enter}
Sleep, 400
MouseClick, left, 544, 509
return

:O:l202::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99202{tab}{tab}{tab}{tab}{tab}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:l303::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99203{tab}{tab}{tab}{tab}{tab}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:l404::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99204{tab}{tab}{tab}{tab}{tab}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:/2o2::
Send, 99212{tab}{tab}{tab}{tab}{tab}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:/3o3::
Send, 99213{tab}{tab}{tab}{tab}{tab}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:/3t3::
Send, 99213{tab}{tab}{tab}{tab}{tab}{Enter}99213t{Enter}{Enter}{tab}{tab}{tab}{tab}{tab}{Enter}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:/3t2::
Send, 99213{tab}{tab}{tab}{tab}{tab}{Enter}99212t{Enter}{Enter}{tab}{tab}{tab}{tab}{tab}{Enter}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:/4o4::
Send, 99214{tab}{tab}{tab}{tab}{tab}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:/4t3::
Send, 99214{tab}{tab}{tab}{tab}{tab}{Enter}99213t{Enter}{Enter}{tab}{tab}{tab}{tab}{tab}{Enter}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:/5o5::
Send, 99215{tab}{tab}{tab}{tab}{tab}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:/5t3::
Send, 99215{tab}{tab}{tab}{tab}{tab}{Enter}99213t{Enter}{Enter}{tab}{tab}{tab}{tab}{tab}{Enter}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:/5t4::
Send, 99215{tab}{tab}{tab}{tab}{tab}{Enter}99214t{Enter}{Enter}{tab}{tab}{tab}{tab}{tab}{Enter}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:l2o2::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99212{tab}{tab}{tab}{tab}{tab}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:l3o3::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99213{tab}{tab}{tab}{tab}{tab}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:l3t3::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99213{tab}{tab}{tab}{tab}{tab}{Enter}99213t{Enter}{Enter}{tab}{tab}{tab}{tab}{tab}{Enter}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:l3t2::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99213{tab}{tab}{tab}{tab}{tab}{Enter}99212t{Enter}{Enter}{tab}{tab}{tab}{tab}{tab}{Enter}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:l4o4::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99214{tab}{tab}{tab}{tab}{tab}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:l4t3::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99214{tab}{tab}{tab}{tab}{tab}{Enter}99213t{Enter}{Enter}{tab}{tab}{tab}{tab}{tab}{Enter}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:l4t4::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99214{tab}{tab}{tab}{tab}{tab}{Enter}99214t{Enter}{Enter}{tab}{tab}{tab}{tab}{tab}{Enter}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:l5o5::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99215{tab}{tab}{tab}{tab}{tab}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:l5t3::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99215{tab}{tab}{tab}{tab}{tab}{Enter}99213t{Enter}{Enter}{tab}{tab}{tab}{tab}{tab}{Enter}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:l5t4::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, 99215{tab}{tab}{tab}{tab}{tab}{Enter}99214t{Enter}{Enter}{tab}{tab}{tab}{tab}{tab}{Enter}{tab}{Enter}
MouseClick, left, 544, 509
return

:O:lprev::
Send, {SHIFTDOWN}{CTRLDOWN}l{SHIFTUP}{CTRLUP}
Send, preventi
Send, {Enter}
return

:*:/cc::p lw{Enter}{Down}{Enter}

:*:/ee::
Send, 2163{tab}zappie
Sleep, 600
Send, {Enter}fm linc
Sleep, 600
Send, {Enter}
Sleep, 600
Send, ^3
return

:*:/st::{tab}{Down}{tab}m+6{tab}{tab}1

:*:/V7::V70.0{Enter}{Enter}{tab}{tab}ROUTINE HEALTH CARE{tab}1{tab}{tab}{tab}{tab}{tab}{space}{tab}{tab}

:*:/va::V20.2{Enter}{Enter}{tab}{tab}ROUTINE ADOLESCENT HEALTH CARE{tab}1{tab}{tab}{tab}{tab}{tab}{tab}{tab}

:*:/vp::V20.2{Enter}{Enter}{tab}{tab}ROUTINE PEDIATRIC HEALTH CARE{tab}1{tab}{tab}{tab}{tab}{tab}{tab}{tab}

:*:/koh::KOH{tab}NEGATIVE{tab}{tab}{tab}{tab}{tab}{tab}no hyphae or spores seen{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}

:*:/lipids1::Here is your Lipid Profile:{Enter}.chol      .i *** {Enter}.trig1        .i ***{Enter}.hdl         .i ***{Enter}.ldl1         .i ***{Enter}.cholhdl {BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS} .i *** {Up}{Up}{Up}{Up}

:*:/lipids2::Here is your Lipid Profile with the last numbers for comparison:{Enter}.chol2        {Up} .i ***     {Down}     {Enter}.trig2      {Up} .i ***     {Down}     {Enter}.hdl2      {Up} .i ***     {Down}     {Enter}.ldl2      {Up} .i ***     {Down}      {Enter}.cholhdl2 {Enter} ; [the rest is the original macro] {Up}{Up}{Up} .i *** {Down}{Down}{Home}{ShiftDown}{Down}{Down}{ShiftUp}{Del}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{F2}{Del}

:*:/ref::p 10165{Enter}

:*:/res::Results{tab}.mronline{Enter}{Up}

:*:/send::
MouseClick, left, 1200, 222
Send, !s
return
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group