Select HTML form with file input type

I have a form in an a webpage and I’m trying to get safari to fill in the form. One of the forms has an input type of “file”. I have been able to clear the field, but not able to set the field. The HTML code looks basically like this:

<form action=“image_form.asp”>
Select a file: <input type=“file” name=“img”>
<input type=“submit”>
</form>

I’m using the set form to text action but at best, it only clears it. If I try and set it to a file path KM just gives me an error.

Hey There,

So, you’re talking to the correct form element.

Have you tried pasting your file path in that field?

Is the webpage public? If so please post it.

Otherwise please post your macro.

-Chris

I believe I have found the answer. I think keyboard maestro sets these values through javascript. javascript has a security feature that prevents this exact kind of automation:

Yes, it does.

Not the setting of form fields, but it would seem the setting of file-paths in form fields is prohibited.

(I don’t know enough JavaScript to say this is an immutable fact.)

You may be able to use the Focus Safari Field action and then paste into the field.

-Chris