|
Post by sharecow on Apr 5, 2019 10:05:49 GMT
1 | X | X | 500 | Keypress (jobs-\w+) output misses the brackets: jobs-\w+
It works with message prompt though: 1 | RUN ACTION | MESSAGE PROMPT | (jobs-\w+)
Am I missing something? Thanks!
|
|
|
Post by sharecow on Apr 9, 2019 9:56:41 GMT
I thought I'd share my solution so far.
21 | X | X | 500 | Keypress Shift+ | 8 21 | X | X | 500 | Keypress jobs-[A-Z].* 21 | X | X | 500 | Keypress Shift+ | 8 21 | X | X | 500 | Keypress ?=\" 21 | X | X | 500 | Keypress Shift+ | 9 21 | X | X | 500 | Keypress Shift+ | 9
While Shift>8 is ( and Shift>9 is ) on the German keyboard. Took me ages to get it done this way, although I cannot believe, that this is the only way.
|
|
|
Post by Steve on Apr 13, 2019 6:13:57 GMT
Wow - good pickup. I've had keyboard translation issues before with keys so immediately i was quick to blame this on your German keyboard. After trying it myself on my (non-German) classic English keyboard I had the same issue. The fix is bit simpler though for my keyboard: 1 | X | X | 500 | Keypress ( 2 | X | X | 500 | Keypress jobs-\w+ 3 | X | X | 500 | Keypress + 4 | X | X | 500 | Keypress ) Yeah - short answer not sure why. Most likely (i haven't looked at the code in a little while) where it should be outputting all the text as a simple string it's not. Rather it's trying to do some funky math with the ( - and + ) and getting confused. I'll check it out. Thanks. This is a good one
|
|
|
Post by zeak on May 5, 2020 23:59:05 GMT
Wow - good pickup. I've had keyboard translation issues before with keys so immediately i was quick to blame this on your German keyboard. After trying it myself on my (non-German) classic English keyboard I had the same issue. Yeah - short answer not sure why. Most likely (i haven't looked at the code in a little while) where it should be outputting all the text as a simple string it's not. Rather it's trying to do some funky math with the ( - and + ) and getting confused. I'll check it out. Thanks. This is a good one Hi Steve, I'm having a lot of issues with this, I'm trying to run a command prompt to open a file that have brackets in it. Here is the file path that I'm trying to open 1 | X | X | 1000 | Keypress lwin+ | r 2 | X | X | 1000 | Keypress "C:\Users\User\Documents\QAD\Requirements (CSV).url" 3 | X | X | 1000 | Keypress enter
I'm getting two almost three different problems. - It sometimes spits an Error at me for this "Line 2 - Enumeration error: The macro may have edited during playback. This macro can not proceed."
- It sometimes removes the "C before the :
- When I try to split this out into different keypresses to allow it to press the bracket keys, it seems to drop the space inbetween the end of "requirements" and the first bracket.
I tried to first define this as a string but that still didn't work. Out of the ten times I ran this, it only worked once.
|
|
|
Post by Steve on May 7, 2020 21:56:21 GMT
Arrg oh man I thought this was a thing of the past. Yep i can confirm that I get the same issue. This keypress line will remove the ( and the ): 1 | X | X | 1000 | Keypress lwin+ | r 2 | X | X | 1000 | Keypress "D:\Macro\test\test 1\test (1).txt" 3 | X | X | 1000 | Keypress enter To get around the issue I need to do add the ( and the ) to a single keypress: 1 | X | X | 1000 | Keypress lwin+ | r 2 | X | X | 1000 | Keypress "D:\Macro\test\test 1\test 3 | X | X | 200 | Keypress SPACE 4 | X | X | 200 | Keypress ( 5 | X | X | 200 | Keypress 1 6 | X | X | 200 | Keypress ) 7 | X | X | 200 | Keypress .txt" 8 | X | X | 1000 | Keypress enter I'll have to have a look at the code but I think it's got something to do with the way I am handling Keypress's.
Keypresses with multiple words are treated differently to a keypress with a single character. I'll add it to the ever growing list of things to get done for the next update. Thanks zeak
|
|
|
Post by Steve on May 7, 2020 23:23:25 GMT
I had a look at the code... The problem is that MMM is not sanitizing the output for special characters that sendkeys uses. This is pretty much the solution thanks to stackoverflow.com/questions/18540025/call-for-certain-sendkey-when-called-not-send-all-the-time: Dim SendText as String = "This ^string^ might+need (to be) wrapped." Dim sb as new Text.StringBuilder(SendText) Dim i as Integer = 0 While i < sb.Length If "+^%~(){}[]".Contains(sb.Chars(i)) Then sb.Insert(i, "{"c) sb.Insert(i + 2, "}"c) i += 3 Else i += 1 End If End While SendKeys.Send(sb.ToString()) I'll do some testing and it will make it's way to the next update if all goes well.
|
|
|
Post by Steve on May 7, 2020 23:34:26 GMT
|
|