ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Skrommel's Software

Key Macros for MS WORD

(1/1)

TWmailrec:
In order to standardise numerous functions like 'Edit new file' or various cut/paste functions for many different applications, I tried to add key macros to  Skrommels "ShiftOff" program which is automatically run at startup

This works fine for all programs EXCEPT MSWORD! In MSWORD 2000, no programed key macros work when following code is added to CAPXShft.ahk

_______________________________________________________

CODE:

Progchk:

WinGetActiveTitle, ActiveTitle
;      MsgBox , 0, Warning, ActiveTitle is "%ActiveTitle%" /I_Editor=%I_Editor%, 5

IfInString, ActiveTitle, soft%A_Space%Word
   Goto msWord
IfInString, ActiveTitle, PowerDesk
   Goto PwDeskAct

IfNotInString, ActiveTitle, %I_Editor%
   Return

_______________________________________________________
 
It works fine with powerdesk & EditPad Pro, but the macro section, when coded as a stand-alone exe also doesnt work in MSWord.
Is there some error in programming?
I have included a trimmed down version of CapXShft as a downloaded ZIP file

TWmailrec
[email protected]

skrommel:
 :) Hi, TWmailrec!

Try adding SetTitleMatchMode,2 to the start of the script. Without it you can't match other than the start of a window's title.

Skrommel

TWmailrec:
 :)Hi Skrommel

I noticed that MSWord 2000 which came with Win98, will not handle
   #IfWinActive Microsoft Word
   F1::
All "#IfWinActive" stats are ignored so I have just corrected problem by swapping macro program with one containing only WORD macros and ShiftOff:

; -------------------------------------------------------
; Configuration:
DetectHiddenWindows, On
SetTitleMatchMode, 2  ; In case it's 3. This setting is in effect only for this thread.
SetKeyDelay, 0
#SingleInstance force
#Persistent
Thread, interrupt, 0 ; Make all threads always-interruptible
SetTimer, Progchk, 1000
...
ShiftOff S/routine
...
; -------------------------------------------------------
Progchk:

; Active window check:  ;;

SetTitleMatchMode, 2  ; In case it's 3. This setting is in effect only
                                ;for this thread.
WinGetActiveTitle, ActiveTitle

IfInString, ActiveTitle, soft%A_Space%Word
   Goto, msWord

Return

IfInString, ActiveTitle, PowerDesk
   Goto, PwDeskAct
IfNotInString, ActiveTitle, %I_Editor%
   Return

; -------------------------------------------------------
msWord:

run, %I_Macrerun%\CapXShft.exe    ;Macro program for WORD only &
;                                                  ShiftOff s/r
ExitApp

; ... remaining hotkeys
; -------------------------------------------------------

It now works great for WINXP, but ShiftOff wont work under WIN98 which seems to ignores all "Hotkey, Key, Label"  statements. in MSWORD, so parsing ini file to create Hotkey assignments fails.
Hotkey assignmnets work under 98 for all other programs??

Since almost nobody else uses WIN98, this shouldnt matter!

Is there a better way to clear all previous "Hotkey, Key, Label" assignmnets when swithing programs aside from my method of rerunning macro .exe (ahk) program? It seems clumsy.

Regards,
TWmailrec

skrommel:
 :) Check out AutoHotkey's Suspend command.

Skrommel

TWmailrec:
So far, have only used suspend on TRAYMENU:.
I will try using it to kill previous Hotkey assignments.

Many thanks
TWmailrec

Navigation

[0] Message Index

Go to full version