I'm attempting to use a variable file name ( uploadname ) as part of the "FieldValue" command, but it doesn't work of course. Here's the code:
Year>runyear
Month>runmonth
Day>runday
Let>uploadname=dailyext%runyear%%runmonth%%runday%.txt
then in the FieldValue I've tried:
Let>FieldValue={"c:\data\daily\uploadname"} didn't work
tried
Let>FieldValue={"c:\data\daily\%uploadname%"} didn't work
Suggestions most welcome. Criticisms humbly accepted.
Web Recorder question
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Use:
Let>FieldValue={"c:\data\daily\" + %uploadname%}
Or:
Let>FieldValue=c:\data\daily\%uploadname%
Let>FieldValue={"c:\data\daily\" + %uploadname%}
Or:
Let>FieldValue=c:\data\daily\%uploadname%
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Newbie
- Posts: 6
- Joined: Wed Oct 25, 2006 1:58 pm
Well, I tried both options, neither worked.
when using the second option the Field Value contained:
FieldValue=c:\data\daily\dailyext20061025.txt
this is the correct name
however, the upload did not send any file.
When I hard code the name it works fine but that sort of negates the whole purpose of the variable.
Any other suggestions for me to try? Thanks
when using the second option the Field Value contained:
FieldValue=c:\data\daily\dailyext20061025.txt
this is the correct name
however, the upload did not send any file.
When I hard code the name it works fine but that sort of negates the whole purpose of the variable.
Any other suggestions for me to try? Thanks
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
I don't see what the difference between hard-coding the name and using a variable is. Could you send your entire script? Or at least the part that fails?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Newbie
- Posts: 6
- Joined: Wed Oct 25, 2006 1:58 pm
Here you go,
Year>runyear
Month>runmonth
Day>runday
Let>uploadname=dailyext%runyear%%runmonth%%runday%.txt
Let>FrameName={""}
Let>FormName={"SoilSiteIm"}
Let>FieldName={"FileUpload1_File"}
Let>FieldValue=c:\data\daily\%uploadname%
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay
Wait>30
I ran the script in Debug with Show Watch List option and the variables were set as expected. So I'm confused.
Thanks for your help
Year>runyear
Month>runmonth
Day>runday
Let>uploadname=dailyext%runyear%%runmonth%%runday%.txt
Let>FrameName={""}
Let>FormName={"SoilSiteIm"}
Let>FieldName={"FileUpload1_File"}
Let>FieldValue=c:\data\daily\%uploadname%
LibFunc>hIE,FormFill,r,%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay
Wait>30
I ran the script in Debug with Show Watch List option and the variables were set as expected. So I'm confused.
Thanks for your help
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Is this a file upload box? If so it cannot be scripted. Microsoft have imposed a security limitation on file upload boxes to prevent them from being scripted.
But you say it works when you hard code the value? That is what is confusing me. If it's a file upload (file browse) box then NEITHER should work.
The only thing that WILL work is user simulation:
SetFocus>Microsoft Internet Explorer*
Press Tab * n
Send>c:\some\filename.txt
Press Enter
Where n is the number of times needed to tab to the field. This works because it happens at the user level above the scripting interface.
But you say it works when you hard code the value? That is what is confusing me. If it's a file upload (file browse) box then NEITHER should work.
The only thing that WILL work is user simulation:
SetFocus>Microsoft Internet Explorer*
Press Tab * n
Send>c:\some\filename.txt
Press Enter
Where n is the number of times needed to tab to the field. This works because it happens at the user level above the scripting interface.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Newbie
- Posts: 6
- Joined: Wed Oct 25, 2006 1:58 pm
-
- Newbie
- Posts: 6
- Joined: Wed Oct 25, 2006 1:58 pm