| View previous topic :: View next topic |
| Author |
Message |
ko Guest
|
Posted: Thu Sep 17, 2009 1:18 am Post subject: Variables with special characters |
|
|
I'm sure this is a simple answer.
I have a variable which is being stored through an input box that contains an "#" symbol. I'm then using this variable to send this and it freaks out.
| Code: |
InputBox, user, Enter User, Please enter your username
if ErrorLevel
ExitApp
SendInput, http://www.samplewebsite.com/%user%/directory.asp
return
|
It's almost like it interprets the "#" as a windows-key keystroke instead of the correct symbol. |
|
| Back to top |
|
 |
purloinedheart
Joined: 04 Apr 2008 Posts: 537 Location: Canada
|
Posted: Thu Sep 17, 2009 1:42 am Post subject: |
|
|
| Try SendRaw |
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 3035 Location: Rio de Janeiro - RJ - Brasil
|
Posted: Thu Sep 17, 2009 1:43 am Post subject: |
|
|
That's exactly what # represents.
Read more about the Send command.
| MANUAL wrote: | | #: Sends a WIN keystroke, therefore Send #e would hold down the Windows key and then press the letter "e". |
_________________ "Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried."
Antonio França
My stuff: Google Profile |
|
| Back to top |
|
 |
ko Guest
|
Posted: Thu Sep 17, 2009 1:49 am Post subject: |
|
|
I figured out that {Raw} would work in the situation i posted. But in my context I would like to create a new variable and use it in conjunction with UrlDownloadToFile.
| Code: |
InputBox, user, Enter User, Please enter your username
if ErrorLevel
ExitApp
CheckHere = http://www.samplewebsite.com/%user%/directory.asp
SaveHere = C:\Source.txt
UrlDownloadToFile, %CheckHere%, %SaveHere%
|
|
|
| Back to top |
|
 |
anyoneelse Guest
|
Posted: Thu Sep 17, 2009 7:52 am Post subject: |
|
|
| ko wrote: | I figured out that {Raw} would work in the situation i posted. But in my context I would like to create a new variable and use it in conjunction with UrlDownloadToFile.
| Code: |
InputBox, user, Enter User, Please enter your username
if ErrorLevel
ExitApp
CheckHere = http://www.samplewebsite.com/%user%/directory.asp
SaveHere = C:\Source.txt
UrlDownloadToFile, %CheckHere%, %SaveHere%
|
|
There is no problem embedding the # character in a variable. There is a problem using it in a url. Short fix: replace the "#" char with "%23".
Reference: Percent-encoding and UrlEscape Function
Additionally, there are several functions posted in the forums that will automatically check/encode an url. Search for URL ENCODE. |
|
| Back to top |
|
 |
|