Welcome Guest.   Make a donation to an author on the site September 20, 2014, 07:05:40 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Learn about the DonationCoder.com microdonation system (DonationCredits).
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Key Macros for MS WORD  (Read 3988 times)
TWmailrec
Charter Member
***
Posts: 122



see users location on a map View Profile Give some DonationCredits to this forum member
« on: June 02, 2006, 08:44:42 PM »

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
TWmailrec@aol.com

* CapXShft.zip (182.19 KB - downloaded 226 times.)
Logged
skrommel
Fastest code in the west
Moderator
*****
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: June 14, 2006, 02:24:56 AM »

 smiley 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
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
TWmailrec
Charter Member
***
Posts: 122



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #2 on: June 17, 2006, 07:43:32 PM »

 :)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
Logged
skrommel
Fastest code in the west
Moderator
*****
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: July 02, 2006, 07:34:16 AM »

 smiley Check out AutoHotkey's Suspend command.

Skrommel
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
TWmailrec
Charter Member
***
Posts: 122



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #4 on: July 04, 2006, 09:46:04 AM »

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

Many thanks
TWmailrec
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.025s | Server load: 0.05 ]