Illegal characters in a link?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
PepeLapiu
Posts: 324
Joined: 19 Jun 2020, 14:06

Illegal characters in a link?

Post by PepeLapiu » 17 Jan 2022, 01:23

So I have no problems sending a link into a chat box on a specific site. If I go like Send, DuckDuckGo.com/.
But if the link itself is stored in an INI file and extracted into VarLink, AHK won't let me use this: Send, % VarLink
It spews out some illegal character error.
How do I solve this? How do I extract a link with illegal characters in it stored in a variable into a Send command?

User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: Illegal characters in a link?

Post by boiler » 17 Jan 2022, 05:32

You'll need to provide some specifics because what you described wouldn't normally be the case. Show the specific error that was displayed, the contents of the .ini file section, and the lines of your script that read that in and send it. It's obviously a lot more helpful to share the error and the actual text that caused it rather than describe it as "some illegal character error."

Actually it sounds more like the error was probably about an illegal character for a variable name. There aren't illegal characters for text that gets sent. I'm thinking your Send command isn't actually as you showed it but rather that you told it to send the contents of the variable name that is contained in your variable, such as this:

Code: Select all

Send, % %VarLink%
...and your link does contain characters that are not allowed for variable names. Showing your actual code should reveal the problem.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Illegal characters in a link?

Post by swagfag » 17 Jan 2022, 06:37

link probably contains %-encoded unicode chars
change the code to

Code: Select all

Send % "{Text}" theVar

User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: Illegal characters in a link?

Post by boiler » 17 Jan 2022, 07:47

That would make sense. I was taking his link example DuckDuckGo.com/ at face value, and not his Send command.

PepeLapiu
Posts: 324
Joined: 19 Jun 2020, 14:06

Re: Illegal characters in a link?

Post by PepeLapiu » 17 Jan 2022, 09:18

I can't show you the code because it was an error that previously occurred so I had to do things differently. And no, it was not DDG.com. It was something else. I'll see if I can dig up a actual link when I get home to my lappy.

User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: Illegal characters in a link?

Post by boiler » 17 Jan 2022, 09:28

PepeLapiu wrote: I can't show you the code because it was an error that previously occurred so I had to do things differently.
If you can’t reproduce the problem then there is no reason to post about it.

PepeLapiu
Posts: 324
Joined: 19 Jun 2020, 14:06

Re: Illegal characters in a link?

Post by PepeLapiu » 17 Jan 2022, 09:31

boiler wrote:
17 Jan 2022, 07:47
That would make sense. I was taking his link example DuckDuckGo.com/ at face value, and not his Send command.
That's what I am saying. I'll see if I can reproduce the error later tonight.

PepeLapiu
Posts: 324
Joined: 19 Jun 2020, 14:06

Re: Illegal characters in a link?

Post by PepeLapiu » 18 Jan 2022, 17:16

Okay. So I tried to make my error happen again to post it here. But I can't seem to make that error happen again. That be totally like me to only make errors and mistakes when not trying to make them. :?

But anyways, if I want Firefox to open a link stored in a variable, how do I do that? I was copying the content of the var into Firefox link field. But there's got to be a better way to do this.

PepeLapiu
Posts: 324
Joined: 19 Jun 2020, 14:06

Re: Illegal characters in a link?

Post by PepeLapiu » 18 Jan 2022, 17:18

Never mind. I figured it out.

Code: Select all

Var := "DucDuckGo.com"
Run, % Var

Post Reply

Return to “Ask for Help (v1)”