Enter something into the active textfield & click button

Hi,

I’m a total AppleScript n00b and am wondering what the code would be to enter something into the active textfield, and to press the current default (blue highlighted) button.

Thanks,

edg

Download the AppleScriptGUI app and find out where the fields are and what the button is called. It might also help if you specify more details in your posting (what application, what dialog box, etc…)

Thanks,

I was hoping that I could enter it into any app with a highlighted text field - not possible? And submit the currect default button…

edg

Which version of Mac OS are you running? If you have UI scripting installed and enabled, this might work (when run from a script menu or utility which doesn’t steal focus from the frontmost app).

tell application "System Events"
	keystroke "This might work."
	keystroke return
end tell

– Rob

Thanks, Rob - I’ll try that.

What I am hoping to do is combine it with Salling Clicker to allow text entry via my phone - a little project of mine :slight_smile:

edg

It worked great, Rob, exactly what I wanted :slight_smile: Thanks very much!

edg