How to click in a field

On a Chrome extension I have, when I click an icon, it pops up a form for me to fill. It has a Choose File button, an Analyse button and a field to paste your data in.

What is the best way to select that field so I can then paste the data?

Thanks,

Jon

Hey Jon,

Is the field not focused when it opens?

If not can you tab into it?

-Chris

The field is not in focus. I have put a Pause Until statement so its waits for a button to appear. Then I put 3 tabs in. It works if I do that manually, 3 tabs while it opens, but not if I use the code. Could it be that I just need a little delay after the Pause Until the button condition? Maybe the button appears a fraction before the form field appears?

In Automate, I used to be able to select the field itself by clicking on it. It had some kind of identity. Wonder if the same thing happens in OSX.

Hey Jon,

It’s good to mention what you’ve tried that didn’t work.  :wink:

So tabbing is inconsistent…

I would try to use AppleScript and System Events to emplace the text directly without pasting, but it’s too complicated to try to guide you through that discovery process.

In this case I think in this case I’d try a Click at Found Image action.

You can use your Analyse button as a unique image and click relative to that.

-Chris

Oh that is a clever idea! Never thought of that. I am not sure what units it uses in how far about but I can experiment. Good suggestion.

Would it help with a small pause between the tabs keystrokes?

lør. 13. feb. 2016 kl. 19.00 skrev Jon12345 <
kmforum@forum.keyboardmaestro.com>:

I found a bug in my code. I had a command that clicked a button earlier in the sequence, as originally I was trying to import the files, but instead will paste them. Fixed now.

To be honest, my code looks very messy. I am using to putting comments in code if programming in VBA but not quite looked into doing it for KM yet!

Hey Jon,

There's a Comment action.

-Chris

Yeah I know. Just haven’t gotten around to looking into it that’s all. I like the layout of Visual Basic, where I can see lots of code at once. With macro type programs, they tend to take up a lot of space vertically. Maybe I should just close each action to give myself a better birds eye view.