Hi. First post.
I am writing an AutoHotKey script to automate Skype for Business for an educational institution.
One portion of the code requires that I open cmd.exe and enter some text which contains characters such as ", ` and others.
However, when I send the text to the command window, characters do not match output. To make things worse it differs from machine to machine.
An example:
I send this:
"copy ""Filename with spaces.doc"" c:\test" {Enter}
This is the expected output:
copy "Filename with spaces.doc" c:\test
This is the output on my hope PC:
copy @Filename with spaces.doc@ c:\test
This is the output on a work PC:
Copy ~Filename with spaces.doc~ c:\test
I can see that with the home PC example, there is some confusion somewhere with keyboard types (US versus UK). As for the work PC example, what the flipping flip is going on there?
There are other more indirect methods of solving this problem though they require fancy batch files and less friendly coding. I would rather keep it simple so other programmers can make sense of the code when I am not present to explain it. I also have limited time in which to complete this little project.
Anyone have any ideas?
Matt
Mapping characters to keys problem
Re: Mapping characters to keys problem
Hi Matt, this works for me, only tested on one layout and computer:
Note that {Text} mode needs Autohotkey version v1.1.27+
HTH
Code: Select all
sendinput {text}copy "Filename with spaces.doc" c:\test
sendinput {Enter}
HTH
Re: Mapping characters to keys problem
Lo and behold! It seems to work with SendInput. Very interesting...
Re: Mapping characters to keys problem
The important part is not SendInput, but {Text}. Without it, the characters are translated to key combinations which are dependent on keyboard layout.
Who is online
Users browsing this forum: Descolada, inseption86, mebelantikjaya and 337 guests