iconoglasses Posted May 31, 2020 Report Share Posted May 31, 2020 Short and sweet: I cannot friggin TAB down- grr! I cannot for the life of me figure out why I can successfully automate the grabbing of a window, and entering a username, but when I try to simply tab down to the next field below it will not work. When I use the recorder, it records nothing but <TAB>. When I select a notepad box as a debugger window, in one case, it actually tabbed inside the debugger. In another attempt I got it to simulate text type of my password into the debugger but not the actual window. Pretty savy, huge into VBA macros.. but new to ME. What I find on Youtube (that isn't 12 years old) is lacking. :( Quote Link to comment Share on other sites More sharing options...
Cory Posted June 1, 2020 Report Share Posted June 1, 2020 What's the application? Post screenshot please. Or post a link to a video capture. A picture is worth a thousand words and a video is worth a million. My first advice is not to use the recorder. It's OK to get a general idea when you're beginning, but it will make unecessarly huge macros. Bicycle training wheels are an apt analogy. Get rid of them ASAP. Start using the direct editor now. When you run the macro in Notepad, are you seeing the tab? Make sure you're not using the clipboard option in the Text Type command. FYI Macros in UWP apps will usually fail. If it's a game, you will often run into macro countermeasures to prevent gaming bots. If you manually tab after typing text in the first field, will it move to the next field? That's all I can think of now. More information will help me help you. Quote Link to comment Share on other sites More sharing options...
terrypin Posted June 1, 2020 Report Share Posted June 1, 2020 Following on from Cory’s suggestions, if the problem you describe does occur after editing your macro to apply in Notepad, post it here in a Code box so that we can try it. Include the command text and the code. Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 1, 2020 Author Report Share Posted June 1, 2020 13 hours ago, Cory said: What's the application? Post screenshot please. Or post a link to a video capture. A picture is worth a thousand words and a video is worth a million. My first advice is not to use the recorder. It's OK to get a general idea when you're beginning, but it will make unecessarly huge macros. Bicycle training wheels are an apt analogy. Get rid of them ASAP. Start using the direct editor now. When you run the macro in Notepad, are you seeing the tab? Make sure you're not using the clipboard option in the Text Type command. FYI Macros in UWP apps will usually fail. If it's a game, you will often run into macro countermeasures to prevent gaming bots. If you manually tab after typing text in the first field, will it move to the next field? That's all I can think of now. More information will help me help you. All great info- thanks. I used the recorder just to see if it would pick up some extra key strokes or something I didn't realize I was doing. And yes, I forgot to take out mouse moves the first time-LOL! It was a mile long! To the pic- I hesitated because of security concerns. Let me see what I can do.. I'll have to see what's proprietary, etc. I'll reply again in a few minutes. Also, UWP- Universal Windows Apps? Why would those fail? It works up until the TAB. And thinking about it, I can probably use the down arrow but it's important to me to know the "why". BRB.... Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 1, 2020 Author Report Share Posted June 1, 2020 Okay, it's inside Mocha 3270 (remote emulation software). It's at the point of a remote login session. I can also tell you I checked the key mapping, and "TAB" is tied to "NEXT", and I can tell you when the TAB key is pressed it does always move down to the second line (the one I'm trying to get to). Attached is a pic example. I'll try to recreate the debugger issue shortly. Quote Link to comment Share on other sites More sharing options...
acantor Posted June 1, 2020 Report Share Posted June 1, 2020 Let's recap. You can manually tab from the "User Name" field to the "Password" field. But when you use a Macro Express instruction like this, the cursor remains in the User Name field? When viewed in the Script Editor: Text Type (Simulate Keystrokes): <TAB> When viewed in the Direct Editor: <TEXT TYPE Action="0" Text="<TAB>"/> Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 1, 2020 Author Report Share Posted June 1, 2020 Right now, when I view in Direct Editor it says: <TEXT TYPE Action="0" Text="<TAB>" _PROMPT="0x0004" _="0x0005"/> Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 1, 2020 Author Report Share Posted June 1, 2020 Sorry, swore I typed it right... <TEXT TYPE Action="0" Text="<TAB>" _PROMPT="0x0004" _PROMPT="0x0005"/> Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 1, 2020 Author Report Share Posted June 1, 2020 So haven't had a chance to recreate but I did also try simply the "Down" key and "Page Down" with my keyboard, this accomplished the same thing. But also fails to work through the macro. I did notice TAB is not listed in this keyboard layout on the right? But doesn't explain the Page Down or basic Down Arrow not functioning. Quote Link to comment Share on other sites More sharing options...
terrypin Posted June 1, 2020 Report Share Posted June 1, 2020 Try entering the Tab in plain form straight into the Direct Editor, i.e. as <TAB>, no Text Type command. Quote Link to comment Share on other sites More sharing options...
acantor Posted June 1, 2020 Report Share Posted June 1, 2020 I don't think the difference between your version of the command and mine is significant. Your version prompts you if a control does not exist, or if the clipboard cannot be accessed. These conditions are likely irrelevant. Your script won't even output a single Tab? Did you confirm that your script is getting triggered by adding a beep and/or popping up a message box? Quote Link to comment Share on other sites More sharing options...
acantor Posted June 1, 2020 Report Share Posted June 1, 2020 I don't think the keyboard layout is relevant. What is the activation for your macro? Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 1, 2020 Author Report Share Posted June 1, 2020 25 minutes ago, terrypin said: Try entering the Tab in plain form straight into the Direct Editor, i.e. as <TAB>, no Text Type command. So to be clear, after the one reply I tried editing it to just <TEXT TYPE Action="0" Text="<TAB>"/> Should I try literally just <TAB>? Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 1, 2020 Author Report Share Posted June 1, 2020 1 hour ago, acantor said: I don't think the keyboard layout is relevant. What is the activation for your macro? If I understand correctly, I'm just initiating it within ME. It first GETS control of the window (successfully), then types a menu option (successfully), bringing it to the login screen. It then successfully uses Text Type to enter in the Login ID. The TAB comes next, which fails. Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 1, 2020 Author Report Share Posted June 1, 2020 1 hour ago, acantor said: I don't think the difference between your version of the command and mine is significant. Your version prompts you if a control does not exist, or if the clipboard cannot be accessed. These conditions are likely irrelevant. Your script won't even output a single Tab? Did you confirm that your script is getting triggered by adding a beep and/or popping up a message box? I haven't tried the TAB anywhere else but I can try maybe before the ID is entered. The script is in the act of running prior- it enters my user name just fine so I can see the script running. Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 1, 2020 Author Report Share Posted June 1, 2020 In Direct Editor, this <TEXT TYPE Action="2"...what's this action 2? Should every text have it's own number and just change sequentially (action 2, action 3, etc)? Or does the "2" signify a specific type of action? Quote Link to comment Share on other sites More sharing options...
Samrae Posted June 1, 2020 Report Share Posted June 1, 2020 In the Text Type command dialog there is a dropdown with options that determine how the Text Type work. The Action= corresponds to this choice: Simulate Keystrokes: Action="0" Use Clipboard and Paste Text: Action="1" Send Text Directly to Control: Action="2" Paste Rich Text: Action="3" Quote Link to comment Share on other sites More sharing options...
terrypin Posted June 1, 2020 Report Share Posted June 1, 2020 2 hours ago, iconoglasses said: So to be clear, after the one reply I tried editing it to just <TEXT TYPE Action="0" Text="<TAB>"/> Should I try literally just <TAB>? Yes, as I said. Quicker to try it than to ask! You can’t break anything. Quote Link to comment Share on other sites More sharing options...
Samrae Posted June 1, 2020 Report Share Posted June 1, 2020 It has been a while since I used 3270 emulator software. I remember some things being a little tricky to automate because the emulator software handled keystrokes directly instead of via the usual Windows messages and hooks. What happens if you send keystrokes via "Simulate Keystrokes" instead of via a Window Control? Something like this: // Do whatever commands are necessary to launch the Mocha 3270 // emulator and wait for it to be completely loaded and stable Text Type (Simulate Keystrokes): your User Name Delay: 1 seconds Text Type (Simulate Keystrokes): your Password Delay: 5 seconds Text Type (Simulate Keystrokes): <TAB> Delay: 5 seconds Text Type (Simulate Keystrokes): <TAB> The Delays are extra long just to see if the commands work. If they do you can reduce the delay time. If that does not work you could try something like this: // Do whatever commands are necessary to launch the Mocha 3270 // emulator and wait for it to be completely loaded and stable Text Type (Simulate Keystrokes): your User Name Delay: 1 seconds Text Type (Simulate Keystrokes): your Password Delay: 4 seconds Text Type (Simulate Keystrokes): <KEYD:VK_TAB> Delay: .5 seconds Text Type (Simulate Keystrokes): <KEYU:VK_TAB> Copy this and paste it into your macro: <COMMENT Value="Do whatever commands are necessary to launch the Mocha 3270"/> <COMMENT Value="emulator and wait for it to be completely loaded and stable"/> <COMMENT/> <TEXT TYPE Action="0" Text="your User Name"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="your Password"/> <DELAY Flags="\x01" Time="4"/> <COMMENT/> <TEXT TYPE Action="0" Text=" <KEYD:VK_TAB>"/> <DELAY Flags="\x01" Time=".5"/> <TEXT TYPE Action="0" Text=" <KEYU:VK_TAB>"/> Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 2, 2020 Author Report Share Posted June 2, 2020 4 hours ago, Samrae said: It has been a while since I used 3270 emulator software. I remember some things being a little tricky to automate because the emulator software handled keystrokes directly instead of via the usual Windows messages and hooks. What happens if you send keystrokes via "Simulate Keystrokes" instead of via a Window Control? Something like this: // Do whatever commands are necessary to launch the Mocha 3270 // emulator and wait for it to be completely loaded and stable Text Type (Simulate Keystrokes): your User Name Delay: 1 seconds Text Type (Simulate Keystrokes): your Password Delay: 5 seconds Text Type (Simulate Keystrokes): <TAB> Delay: 5 seconds Text Type (Simulate Keystrokes): <TAB> The Delays are extra long just to see if the commands work. If they do you can reduce the delay time. If that does not work you could try something like this: // Do whatever commands are necessary to launch the Mocha 3270 // emulator and wait for it to be completely loaded and stable Text Type (Simulate Keystrokes): your User Name Delay: 1 seconds Text Type (Simulate Keystrokes): your Password Delay: 4 seconds Text Type (Simulate Keystrokes): <KEYD:VK_TAB> Delay: .5 seconds Text Type (Simulate Keystrokes): <KEYU:VK_TAB> Copy this and paste it into your macro: <COMMENT Value="Do whatever commands are necessary to launch the Mocha 3270"/> <COMMENT Value="emulator and wait for it to be completely loaded and stable"/> <COMMENT/> <TEXT TYPE Action="0" Text="your User Name"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="your Password"/> <DELAY Flags="\x01" Time="4"/> <COMMENT/> <TEXT TYPE Action="0" Text=" <KEYD:VK_TAB>"/> <DELAY Flags="\x01" Time=".5"/> <TEXT TYPE Action="0" Text=" <KEYU:VK_TAB>"/> Hi! Thanks, but to the first- there needs to be a TAB between the User Name and Password, that one doesn't have it. A few tests have resulted in part of my password being entered on the User Name line. Spaces are also read as an incorrect password. There must be a TAB use or equivalent. To the second suggestion, I did the simulate keystrokes and used the key down and up and it did not work. It then proceeded to enter the first 2 characters of my password on the User Name field, before the rest spilled over into the Password area. Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 2, 2020 Author Report Share Posted June 2, 2020 5 hours ago, terrypin said: Yes, as I said. Quicker to try it than to ask! You can’t break anything. Yeaaaa. Unfortunately, it didn't take. I do not get this- my keyboard can type it- the keyboard clearly is sending commands.. agh! Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 2, 2020 Author Report Share Posted June 2, 2020 (edited) 15 hours ago, Samrae said: In the Text Type command dialog there is a dropdown with options that determine how the Text Type work. The Action= corresponds to this choice: Simulate Keystrokes: Action="0" Use Clipboard and Paste Text: Action="1" Send Text Directly to Control: Action="2" Paste Rich Text: Action="3" Thank you so much for this! Good info! I have you guys.. and the one and only book on this Earth (J. Weinpert), written on this software.. and it's clearly outdated. **EDIT: To clarify, this wasn't a fix but great info!** Edited June 2, 2020 by iconoglasses Clarification Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 2, 2020 Author Report Share Posted June 2, 2020 Maybe this has to do with the sending text through control initially and it not letting go of that point? Any other ideas? Forgive me if I didn't reply back to a suggestion. I'll re-check everything shortly. Quote Link to comment Share on other sites More sharing options...
iconoglasses Posted June 2, 2020 Author Report Share Posted June 2, 2020 Okay, how about this- rather than using a simple TAB key which for some apparent reason has so far proved impossible... I simply get control of each line separately? Currently I use: Get Control: (TN3270.EXE) Using z-order -> %C[2]% I then Text type some credentials using Send Text Directly to Control %C[2]% and <ENTER> (without issue, it goes to next menu) It then has a 2 second Delay before entering my user name (no issues) I again use Send Text with %C[2]%: ThisIsUserName (no issue, it gets in but all stops here) **Forgive me the other system is tightly controlled, and I would have to hand-type it all here to paste** I'm still new to things so trying to read up more on this Control function and use of variables. Understanding my original intent, and this possible workaround to get control of this emulator at different points inside, is that- a) possible? b) could anyone point to similar tutorials/explanations or provide? *I'm running the latest Portable version of ME Pro* Example of my frustration with say Youtube tutorials is 3 or 4 Calculator tutorials that are a) outdated (wont press the keys) and b) not the same situation. I don't see any videos out there with people filling out forms created as such. Quote Link to comment Share on other sites More sharing options...
Samrae Posted June 2, 2020 Report Share Posted June 2, 2020 11 hours ago, iconoglasses said: Hi! Thanks, but to the first- there needs to be a TAB between the User Name and Password, that one doesn't have it. A few tests have resulted in part of my password being entered on the User Name line. Spaces are also read as an incorrect password. There must be a TAB use or equivalent. So, add a tab: Text Type (Simulate Keystrokes): your User Name Delay: 4 seconds Text Type (Simulate Keystrokes): <KEYD:VK_TAB> Delay: 1 seconds Text Type (Simulate Keystrokes): <KEYU:VK_TAB> Delay: 4 seconds Text Type (Simulate Keystrokes): your Password Delay: 4 seconds Text Type (Simulate Keystrokes): <KEYD:VK_TAB> Delay: .5 seconds Text Type (Simulate Keystrokes): <KEYU:VK_TAB> Quote To the second suggestion, I did the simulate keystrokes and used the key down and up and it did not work. It then proceeded to enter the first 2 characters of my password on the User Name field, before the rest spilled over into the Password area. Maybe a clue. It is interesting that your password was entered partially into two different fields. Here is another thing to try. Macro Express can "type" much faster than you can. 😃 What I have been trying to suggest is to slow things down. Maybe you also need to slow down the keystrokes between the characters of your name and password. If I recall correctly, when using a 3270 emulator, each keystroke is accepted by the emulator, sent to the host (IBM mainframe computer) and then sent back to the emulator to be displayed (or something like that). Try something like this. This will be very slow! It is only a test to see if slowing things down helps the emulator and host recognize the keystrokes. Try it and tell us exactly what you see. Keystroke Speed: 500 milliseconds Text Type (Simulate Keystrokes): UserName Delay: 2 seconds Text Type (Simulate Keystrokes): <KEYD:VK_TAB> Delay: 1 seconds Text Type (Simulate Keystrokes): <KEYU:VK_TAB> Delay: 2 seconds Text Type (Simulate Keystrokes): Password Delay: 2 seconds Text Type (Simulate Keystrokes): <KEYD:VK_TAB> Delay: 1 seconds Text Type (Simulate Keystrokes): <KEYU:VK_TAB> Delay: 2 seconds Text Type (Simulate Keystrokes): <KEYD:VK_TAB> Delay: 1 seconds Text Type (Simulate Keystrokes): <KEYU:VK_TAB> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.