WebRecorder - error parsing text variable to FormFill

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Danish_Ken
Junior Coder
Posts: 22
Joined: Mon Sep 12, 2005 1:34 am
Location: Melbourne - Australia

WebRecorder - error parsing text variable to FormFill

Post by Danish_Ken » Mon Oct 22, 2007 7:03 am

I've got a problem parsing text to a variable for the FormFill function. Numeric values or static text work OK

The error macroscheduler returns is:
"first letter of variable" is not appropriate

Could anyone try running these and let me know what you get?

Code: Select all

// Generated by MacroScript WebRecorder 1.73
// Recorded on Monday, October 22, 2007, at 04:46 PM
LibLoad>IEAuto.dll,hIE
If>hIE=0
  MessageModal>Could not load IEAuto.dll, make sure it is in the path or edit the LibLoad line.
  Goto>end_script
EndIf

//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1

LibFunc>hIE,CreateIE,IE[0],0

LibFunc>hIE,Navigate,r,%IE[0]%,http://www.google.com.au/
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

Let>[u]SearchText[/u]=MJT Net Webrecorder

Let>FrameName={""}
Let>FormName={"f"}
Let>FieldName={"q"}
Let>FieldValue={"[u]%SearchText%[/u]"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0

Let>FrameName={""}
Let>FormName={"f"}
Let>TagValue={"btnG"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

LibFree>hIE
Label>end_script
If I change it to either of thes two, it works OK

Code: Select all

Let>SearchText=90210

Let>FrameName={""}
Let>FormName={"f"}
Let>FieldName={"q"}
Let>FieldValue={"%SearchText%"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0
or

Code: Select all

Let>FrameName={""}
Let>FormName={"f"}
Let>FieldName={"q"}
Let>FieldValue={"MJT Net Webrecorder"}
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0

WinXP Sp2
MacroScheduler Pro 9.1.05
WebRecorder 1.73
Macro Scheduler since Version 5.0 - 21/10/1998

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

Post by Marcus Tettmar » Mon Oct 22, 2007 7:41 am

Should be like this:

Let>FieldValue={%SearchText%}

However, since SearchText is already defined, you don't need the above. You could just change the FormFill call to:

LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:SearchText,0
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Danish_Ken
Junior Coder
Posts: 22
Joined: Mon Sep 12, 2005 1:34 am
Location: Melbourne - Australia

Post by Danish_Ken » Mon Oct 22, 2007 10:48 pm

Thanks Marcus

What a difference a couple of " " can make.
Interesting that numeric values pass through.

Thanks again for the quick response.
/Ken
Macro Scheduler since Version 5.0 - 21/10/1998

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