0

May you please help me with sending a key press into a SAP form. I am using a AutoHotKey app. I would like to send CTRL+Tab to get out of textbox window by pressing a key combination CTRL+T (don't ask me why its just an example of more complex problem).

Here is some code I tested:

1)

^t::  
  Sleep 2000  
  Send, {Control DOWN}{Tab}{Control UP}  
Return 

Or this "Send, ^{Tab}" or "Send, ^+{Tab}"

2)

^t::  
  Sleep 1000  
  Send, {Ctrl Down}  
  Sleep 300   
  Send, {Tab}  
  Sleep, 300  
  Send, {Ctrl Up}  
Return

The second works but just sometimes and just on some PCs.

0

Is the SAP form in a browser?

You can also try SendInput (or specify which mode Send will use by default (SendMode Input or SendMode Play).

You should also be able to check the tray icon and verify that the code is getting executed as expected when you press ^t. If it executes but doesn't have expected results then you have to look at the interaction between AutoHotkey and your program.

Also check for any previous #IfWinActive statements if this is part of a larger script.

The delays you have shown are very useful for troubleshooting but in most cases they shouldn't be needed after ironing out what is or isn't working.

Another troubleshooting technique is to set a ToolTip before/after each delay and verify (in real-time) if the key strokes are having their intended effect on your program or form. This can also help verify that the script executes as expected when you press the hotkey.

  • Hi thanks a lot for your valueable tips. I will try all of them and will see. Of course let you know the reslut. Anyhow its doesnt run in a browser it has its own window (app). – JanSindler Aug 7 '17 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.