Autofill Form field with type=file

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
JonDubya
Newbie
Posts: 18
Joined: Thu Mar 20, 2008 6:32 pm

Autofill Form field with type=file

Post by JonDubya » Fri Mar 21, 2008 8:49 pm

It seems that when the code is supposed to fill a form field of type file:

Code: Select all

INPUT type="file" NAME="code_update"
(opening and closing brackets removed due to phpbb misreading it)

It doesn't fill it with the semi-hacked auto generated script code:

Code: Select all

Let>FrameName={"main content"}
Let>FormName={"codeupdate"}
Let>FieldName={"code_update"}
Let>FieldValue=firmware
IE_FormFill>%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0,r
Where firmware:

Code: Select all

Input>firmware,Enter or Browse for the Firmware File:,C:\x642\X642_LC2.MB.P237.fullnet.ffm
Which, when the input prompts the user, it looks good. I don't think any quotes are needed for the Let>FieldValue=firmware either. I think it has to do with the field type being 'file' instead of 'textarea' or whatever.

Can someone verify and reccomend a workaround? I don't want it to prompt the user...I have all the user prompts at the beginning so they can enter the needed data and walk away.

Thanks

Jon

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 Mar 21, 2008 9:19 pm

File upload boxes cannot be "scripted". Microsoft views that as a security problem so block file boxes from being scripted.

The only solution is to send keystrokes to it - do it via user simulation - or use Image Recognition to find the button and Click it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

JonDubya
Newbie
Posts: 18
Joined: Thu Mar 20, 2008 6:32 pm

Post by JonDubya » Fri Mar 21, 2008 9:24 pm

Ok, I'll do the keystrokes...How do I set focus to that form field? It seems that SetFocus will only target the window.

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 Mar 21, 2008 9:29 pm

Usually you would SetFocus the window and then TAB (Press TAB) the required number of times to get to the field.

I would use image recognition to locate the field immediately and return it's x,y pos.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

JonDubya
Newbie
Posts: 18
Joined: Thu Mar 20, 2008 6:32 pm

Post by JonDubya » Fri Mar 21, 2008 9:34 pm

NVM Got it - using tabs :D

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