Jump to content
Sign in to follow this  
Pudubat

Script won't open...

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites
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.
  :)

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...