Script used to work, now doesn't although unchanged

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
timg11
Posts: 25
Joined: 10 Dec 2016, 14:09

Script used to work, now doesn't although unchanged

26 Feb 2018, 21:53

I developed a script years ago to fix the problems with Eudora and Gmail certificates. It worked for a long time, but something (changes to windows?) has caused it to no longer work.
Here it is:

Code: Select all

#z::
   WinActivate, ahk_class EudoraMainWindow
   Send {Alt Down}tP{Alt Up}       ; Alt-T, P     Personalities Window
   Sleep 5
   Send {End}                      ; google account is at bottom of list
   Sleep 5
   Send {Alt Down}{Enter}{Alt Up}  ; properties
   WinWait Account
   WinActivate
   Send {Ctrl Down}{Tab}{Ctrl Up}     ; Incoming Tab
   Sleep 10
   Send {Alt Down}n{Alt Up}    ; Alt-N Last SSL
   Sleep 10
   Send {Alt Down}c{Alt UP}	; ALT-C Certificate Mgr
   Sleep 10
   Send {Right}  ; expand certificate tree
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 50
   Send {Alt Down}a{Alt Up}    ; ALT-A Add to trusted
   Sleep 30
   Send {Alt Down}o{Alt Up}    ; ALT-O Done
   Sleep 20
   Send {Enter} ;  OK to SSL dialog
   Sleep 20
   Send {Ctrl Down}{Tab}{Ctrl Up}     ; Generic Properties Tab
   Sleep 10
   Send !l    ; Alt-L Last SSL
   Sleep 10
   Send !c	; ALT-C Certificate Mgr
   Sleep 10
   Send {Right}  ; expand certificate tree
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 10
   Send {Right}
   Sleep 50
   Send {Alt Down}a{Alt Up}    ; ALT-A Add to trusted
   Sleep 30
   Send {Alt Down}o{Alt Up}    ; ALT-O Done
   Sleep 20
   Send {Enter} ;  OK to SSL dialog
   Sleep 20
   Send {Tab}{Enter} ;  OK to Properties dialog
   Sleep 20
   WinActivate Eudora
   Sleep 20
   Send {Alt Down}T{Alt Up}M    ; back to mailboxes
   Sleep 20
   WinActivate Eudora
Return

I can verify that the script runs, by putting SplashTextOn rhroughout. It executes past WinActivate, ahk_class EudoraMainWindow, but Eudora is not activated.
The Send commands don't send anything. Running the script leaves AHK in a non-working state until I reload the script.
I updated to the most recent version of AHK, but it doesn't make any difference in the problem.

Other short scripts like

Code: Select all

#!d:: Send %A_YYYY%-%A_MM%-%A_DD%
still function.
How can I debug the issues with this script?
I'm running Windows 10 64 bit version 1709.
Autohotkey 1.1.28.00 64 bit.
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: Script used to work, now doesn't although unchanged

27 Feb 2018, 08:42

I have a few things to suggest.
SetTitleMatchMode and Loop

SetTitleMatchMode allows to change the way AHK searches for the window to work with, just click the link above to learn more.

Loop allows to do the same action multiple times. Shortening the script a bit and allowing an easier way to change things around.

Here's my edit on your code:

Code: Select all

#z::
  SendMode, Input
  SetTitleMatchMode, 2
  WinActivate, ahk_class EudoraMainWindow
  Send, !P{End}!{Enter}
  WinWaitActive, Account
  Send ^{Tab}!n!c

  Loop, 12, {
    Send {Right}  ; expand certificate tree
    Sleep 10
  }
  Sleep 40
  Send !a!o{Enter}^{Tab}!l!c

  Loop, 12, {
    Send {Right}  ; expand certificate tree
    Sleep 10
  }
  Sleep 40
  Send !a!o
  Send {Enter} ;  OK to SSL dialog
  Send {Tab}{Enter} ;  OK to Properties dialog
  WinActivate, Eudora
  Send !TM   ; back to mailboxes
  Sleep 20
  WinActivate, Eudora
Return
I don't know if this will work at all or even if it has the right syntax to it. I'm doing this from a computer that I rarely use.

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat


Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Araphen, DataLife, ShatterCoder, sofista and 303 guests