Barcode Scanner / Open Web Browser with URL Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
rem20000
Posts: 4
Joined: 19 May 2017, 13:14

Barcode Scanner / Open Web Browser with URL

19 May 2017, 13:27

Hi,

I am brand new to AHK, just having found it today. I am trying to setup some labels with a URL that when scanned will open Google Chrome and go to the URL in the barcode. The barcode and URL are serialized so that each label has a different barcode / URL.

I have the following script which of course just opens Chrome.

Code: Select all

`::Run chrome.exe
In my barcode I have the following. The URL is 42 characters long just in case that matters here:

Code: Select all

` http://url:port/page
When I scan the barcode Chrome does open but only part of the URL gets pasted into the address bar. It seems to be cutting off the first 15 or so characters in the URL but it is not always consistent. Any ideas on what I can do to make this work?

Thanks!
User avatar
Masonjar13
Posts: 1555
Joined: 20 Jul 2014, 10:16
Location: Не Россия
Contact:

Re: Barcode Scanner / Open Web Browser with URL  Topic is solved

19 May 2017, 13:38

Try the following:

Code: Select all

`::
input,url,,{enter}
run % "Chrome.exe " . url
return
OS: Windows 10 Pro | Editor: Notepad++
My Personal Function Library | Old Build - New Build
rem20000
Posts: 4
Joined: 19 May 2017, 13:14

Re: Barcode Scanner / Open Web Browser with URL

19 May 2017, 14:34

Hi. Thanks for your reply!

When I run that script and scan in the barcode, my keyboard is frozen until I hit return and then the browser windows opens with the correct URL, so it seems that is close!

Thanks
Ben
User avatar
Masonjar13
Posts: 1555
Joined: 20 Jul 2014, 10:16
Location: Не Россия
Contact:

Re: Barcode Scanner / Open Web Browser with URL

19 May 2017, 16:56

Just replace the {enter} with whatever end-key it sends. Or you could use a time-out. Or, if the link is always the same length, you can set a maximum length.
OS: Windows 10 Pro | Editor: Notepad++
My Personal Function Library | Old Build - New Build
rem20000
Posts: 4
Joined: 19 May 2017, 13:14

Re: Barcode Scanner / Open Web Browser with URL

19 May 2017, 17:05

Hey Masonjar13,

Thanks again. I can set the link to always be the same length. How would I set AHK to stop at that number?

Thanks!
User avatar
Masonjar13
Posts: 1555
Joined: 20 Jul 2014, 10:16
Location: Не Россия
Contact:

Re: Barcode Scanner / Open Web Browser with URL

19 May 2017, 19:28

See Input, under the Options parameter.
OS: Windows 10 Pro | Editor: Notepad++
My Personal Function Library | Old Build - New Build
rem20000
Posts: 4
Joined: 19 May 2017, 13:14

Re: Barcode Scanner / Open Web Browser with URL

22 May 2017, 08:31

Hey Masonjar13,

That did the trick! Thanks so much for your help!!!

Here is my final script just in case anyone else is looking for this in the future:

Code: Select all

`::
input,url,T.5
run % "Chrome.exe " . url
return
Thanks

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Panaku, Rohwedder and 323 guests