Jump to content


x64 Windows 7, Scripts Not Working


  • Please log in to reply
7 replies to this topic

#1 MikeO

MikeO
  • Guests

Posted 30 May 2012 - 01:33 PM

I have been using AHK with Windows 7 x86 for some time. I just got an x64 system and it will not run the scripts that I have already recorded, they just hand in the system try with the H icon. So I wasn't sure if AHK was x64 compatible. I tried to record a new script to do something simple like open calculator and enter some numbers, but then it told me that winwait was missing parameters. Not sure why such a simple recorded macro wouldn't run.

Is AHK x64 compatible? Any suggestions?


Mike

#2 tomoe_uehara

tomoe_uehara
  • Members
  • 2077 posts

Posted 30 May 2012 - 04:40 PM

I use the Win 7 x64 with AHK Basic, and it works fine.
Sometimes the recorder won't work, it's better to write manually. Post your code, there maybe some syntax error in your code.


#3 MikeO

MikeO
  • Guests

Posted 30 May 2012 - 05:39 PM

That's great news!

It is a very simple script that:
1) Saves the open incident
2) Clicks the print pull down
3) Selects a report
4) Prints two copies of the report to a printer named "greeter"
5) Exits adobe.

It seems to not like the items the recorder added like WinWait and WinActive. If you have any recommendations, I would love to hear them!
We do have issues with if the window is not fully maximized the pointer "misses" as the position changes. Also if people touch the mouse while it is trying to work or waiting for the PDF report to generate.


Thanks!

WinWait, Incident
IfWinNotActive, Incident, , WinActivate, Incident, 
WinWaitActive, Incident, 
MouseClick, left,  80,  97
Sleep, 800
MouseClick, left,  311,  104
Sleep, 800
MouseClick, left,  238,  231
Sleep, 800
WinWait, Incident-, 
IfWinNotActive, Incident-, , WinActivate, Incident-, 
WinWaitActive, Incident-, 
Send, {CTRLDOWN}p{CTRLUP}Greeter
Sleep, 100
Send, {ALTDOWN}c{ALTUP}2{ENTER}
Sleep, 5000
MouseClick, left,  310,  179
Sleep, 100
Send, {CTRLDOWN}q{CTRLUP}


#4 tomoe_uehara

tomoe_uehara
  • Members
  • 2077 posts

Posted 31 May 2012 - 02:03 AM

You can adjust the script to suit your need, I'm only guessing here because I don't really know which one do you click.
You can use CoordMode to set if the Mouse is relative to the application or to the screen.
If you want to maximize the window, you can use WinMaximize.

#SetTitleMatchMode, 2
CoordMode, Mouse, Screen
WinActivate, Incident
Sleep, 500
Click, 80,  97
Sleep, 800
Click, 311,  104
Sleep, 800
Click, 238,  231
Sleep, 800
WinWait, Incident-
IfWinNotActive, Incident-
WinActivate, Incident-
Send, ^pGreeter
Sleep, 100
Send, !c
Send 2{ENTER}
Sleep, 5000
Click, 310,  179
Sleep, 100
Send, ^q
return

ESC::ExitApp


#5 MikeO

MikeO
  • Guests

Posted 31 May 2012 - 11:49 AM

Setting the coordinates relative to the application window and not the entire screen would be great! I will do some further research on that and see what I can come up with. I didn't realize there were commands available outside of the recorder until I started digging into this web site more. I will try the revised script today.


Thanks

#6 tomoe_uehara

tomoe_uehara
  • Members
  • 2077 posts

Posted 01 June 2012 - 05:03 AM

FYI, there is offline Helpfile available for us to read, you can find it in the AutoHotkey's installation folder, called 'AutoHotkey.chm'

#7 MikeO

MikeO
  • Guests

Posted 01 June 2012 - 12:01 PM

SUCCESS. Thank you very much for your assistance.

#8 tomoe_uehara

tomoe_uehara
  • Members
  • 2077 posts

Posted 01 June 2012 - 06:07 PM

You're welcome.. :)
Posted Image