Using %20 in a variable

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Jon12345
Newbie
Posts: 8
Joined: Fri May 26, 2006 2:33 pm
Contact:

Using %20 in a variable

Post by Jon12345 » Fri May 26, 2006 2:37 pm

The code below is not working. I get a "Not Acceptable" message. It works if I remove the %20 and just have DogFood. But it is part of the url so I can't, can I?

How can I get around this problem?

Thanks,

Jon

Code: Select all

Let>KeywordPhrase=Dog%20Food
HTTPRequest>http://mysite.com/cgi-bin/script/script.cgi/?keywords=%KeywordPhrase%,,GET,,Result



[/code]

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri May 26, 2006 4:56 pm

You don't say when you get the error message.

I don't get an error if I display
MessageModal>%KeywordPhrase%

I also tried this, with success:
Let>Pct=%
Let>KeywordPhrase=Dog%Pct%Food
MessageModal>%KeywordPhrase%

So the error message must be coming when trying to call up the web page.
The %20 is an HTML way of using a space character.
Have you tried this:
Let>KeywordPhrase=Dog Food
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri May 26, 2006 5:19 pm

I'm not getting any errors with the following test script:

Code: Select all

Let>query=dog%20food
HTTPRequest>http://www.google.co.uk/search?hl=en&q=%query%,,GET,res
MessageModal>res
Works fine. Which version of Macro Scheduler are you running? Please check under Help/About.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts