 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
padarrju
Joined: 23 Jan 2006 Posts: 37 Location: Vadodara - Gujarat (INDIA)
|
Posted: Thu Oct 05, 2006 5:19 am Post subject: How to ensure if some hotket key is pressed or not ... |
|
|
Hello All AutoHotKey Users & Developers,
I have developed a small program to auto logon SAP application using some hot key. I need to check if the hot key is not pressed within 30 seconds, autohotkey program should automatically closed & exit.
My code is given below :
| Code: | #SingleInstance ignore
#Persistent
#NoTrayIcon
SetKeyDelay,100
winminimizeall
IniRead, sap_user_id,c:\\sap_pswd.ini,SAP_LOGON,SAP_USERID
IniRead, pswd, c:\\sap_pswd.ini,SAP_LOGON,SAP_PASSWORD
#S::
RUN,C:\\Program Files\\SAP\\FrontEnd\\SAPgui\\SAPgui.exe fagind01.xx.yyy.com 00
sleep,2000
Wait_SAPR3:
;---------------
IfWinNotExist,SAP R/3,,Goto,Wait_SAPR3
WinWait, SAP R/3
WinActivate, SAP R/3
WinMaximize, SAP R/3
send,%sap_user_id%
send,{TAB}
sleep,3000
send,%pswd%
send,{enter}
sleep,2000
ifwinexist,Info on incoming documents,,winactivate,Info on incoming documents
ifwinactive,Info on incoming documents,,send,{Enter}
finish:
exitapp
Return
esc::ExitApp
; End Of Script ..... |
Best Regards,
Raju C Padaria |
|
| Back to top |
|
 |
AiKscroll
Joined: 06 Jun 2005 Posts: 179 Location: Northern Virginia
|
Posted: Thu Oct 05, 2006 7:40 am Post subject: |
|
|
| Code: |
#SingleInstance ignore
#Persistent
#NoTrayIcon
SetKeyDelay,100
winminimizeall
IniRead, sap_user_id,c:\\sap_pswd.ini,SAP_LOGON,SAP_USERID
IniRead, pswd, c:\\sap_pswd.ini,SAP_LOGON,SAP_PASSWORD
SetTimer, Pressed, 30
Return
Pressed:
If !used
ExitApp
Return
#S::
used := true
RUN,C:\\Program Files\\SAP\\FrontEnd\\SAPgui\\SAPgui.exe fagind01.xx.yyy.com 00
sleep,2000
Wait_SAPR3:
;---------------
IfWinNotExist,SAP R/3,,Goto,Wait_SAPR3
WinWait, SAP R/3
WinActivate, SAP R/3
WinMaximize, SAP R/3
send,%sap_user_id%
send,{TAB}
sleep,3000
send,%pswd%
send,{enter}
sleep,2000
ifwinexist,Info on incoming documents,,winactivate,Info on incoming documents
ifwinactive,Info on incoming documents,,send,{Enter}
finish:
exitapp
Return
esc::ExitApp
|
_________________ _AiK |
|
| Back to top |
|
 |
padarrju
Joined: 23 Jan 2006 Posts: 37 Location: Vadodara - Gujarat (INDIA)
|
Posted: Thu Oct 05, 2006 9:04 am Post subject: |
|
|
Thank U very very much !!!
Your code is working fine !!!
Best Regards & Hope the same support for newbies like us.
Raju C Padaria |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|