Pudubat Posted July 10, 2019 Share Posted July 10, 2019 Hello, I'm new to scripting with autoIT (I mean, scripting at all) And I'm trying to achieve something that (I assume) is extremely simple, but when I try to run the script, the icon just flash in my task bar and does not run. No error message. Basically, I'm trying to have a script that would send CTRL+SHIFT+A when I press a hotkey (2 times) to adjust the PDF to page in edge. And another key would bring me back to the homepage (alt+HOME) What I'm trying to achieve is to add these hotkey to a scanner program, so when I scan a QR code, it will bring me to the homepage (which is my IIS index with a search box for our internal files) and then adjust the PDF to the page. What is wrong with my script? HotKeySet ("{F2}", "Resize") HotKeySet ("^1", "Refresh") Func Resize () Send ( "^+a^+a", "" ) EndFunc Func Refresh Send ( "!{HOME}" , "" ) EndFunc I tried many different combinations, used help files, tried examples (which worked great, no idea why) but my script does not work. Thanks! Link to comment Share on other sites More sharing options...
Developers Jos Posted July 10, 2019 Developers Share Posted July 10, 2019 Your script ends right away because there is nothing there to execute. Look at while...wend in the helpfile. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Pudubat Posted July 10, 2019 Author Share Posted July 10, 2019 Got it! That's what was missing.. Thank you! I love the way that you don't give the answer yet, but point out where to find it. The only thing that seems to be bad is to repeat the CTRL+SHIFT+A. I tried Send ( "{^+a 2}", "" ) and Send ( "+a^+a", "" ) The first one does not work at all, and the 2nd works, but only some times... (It will sometimes send 1 CTRL+SHIFT+A and sometimes 2) Send ( "{" ^+a " 2}", "" ) While writing this, I tried But I got Send ("{" ^+^ ERROR on my line... Link to comment Share on other sites More sharing options...
Pudubat Posted July 10, 2019 Author Share Posted July 10, 2019 Ignore my last message, I had a typo error. Send ( "^+a^+a", "" ) works now. Thank you again! Link to comment Share on other sites More sharing options...
Developers Jos Posted July 10, 2019 Developers Share Posted July 10, 2019 4 minutes ago, Pudubat said: Got it! That's what was missing.. Thank you! I love the way that you don't give the answer yet, but point out where to find it. The only thing that seems to be bad is to repeat the CTRL+SHIFT+A. I tried Send ( "{^+a 2}", "" ) and Send ( "+a^+a", "" ) The first one does not work at all, and the 2nd works, but only some times... (It will sometimes send 1 CTRL+SHIFT+A and sometimes 2) Just read up in the helpfile on the proper syntax! The first one should be: Send ( "^+{a 2}") The second: Send ( "^+a^+a") The third is wrong syntax as "a" is not a variable! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Pudubat Posted July 10, 2019 Author Share Posted July 10, 2019 I see the logic behind that. I assumed I wanted to do CTRL+SHIFT+A+CTRL+SHIFT+A but what I wanted to achieve was CTRL+SHIFT+A+A. I'm still working on it to make it works good. I'm pretty close to what I wanted. Thank you! Now I have to work with the messy zebra123 scanner app to make my keybind works. (which is a pain) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now