I need some help finding out what is wrong with my code or if any of the problems I get are my code's fault.
Basically, I have PDF file with number in it which I copy and paste to Outlook email, filling all the information to Outlook first.
The number looks like this: 012345-6789 and I wanted it pasted to Outlook as NR:0123456789.
So problems that I have now are:
1. Whenever I post the same outcome to Outlook, magical space gap appear making my string look like NR: 0123456789. I do not want that gap. Does not do that in any other programs.
2. Sometimes - is not removed. For some instances it gets removed, for others not. I can't tell the difference between - (gets copied) and - (doesn't get copied) just by looking at it. There is a possibility that my PDF is messed up, but is there any way to change it.
3. Sometimes the number is not pasted completely. But when the code is ran second time, all is good. At first it was a matter of sleep time, so I set it as 500 before and after the pasting moment.
The full code I use is
Code: Select all
^+O::
Send,^c
Clipboard := RegExReplace(clipboard,"\D")
StringReplace, clipboard, clipboard, -,, All
Send {F10}
Send F
Send {Down}{Down}{Down}{Down}{Down}
Send {enter}
Sleep 2000
Send, email
Send {enter}
Send {tab}
Send {tab}
Send subject
Send {tab}
Send {tab}
Send NR=
Sleep 500
Send ^v
Sleep 500
return
Any ideas are welcome because I am out of ideas already. I can not see any differences between instances that get messed up by the code and instances that don't.
BR,
Aiste