0
votes

So I am using Script Editor to open Chrome to a webpage where I have a Username and Password already saved there, so I need this script to press enter on the webpage, so that it will continue to the user home page. This is my script without my enter key added, every time I give it a shot it just adds the word "enter" in the username field.

Question is: How do I make this script press enter on a webpage? Thanks for any info you can give me.

shell script "open '/Applications/Google Chrome.app' https://random.website"

tell application "Google Chrome" to activate

tell application "System Events" keystroke "f" using {command down, shift down}

end tell

delay 3 (this is where I have been trying to get the "Enter" keypress to go)

tell application "System Events" keystroke "T" using {command down}

end tell

1

1 Answers

0
votes

You have 2 possible methods : click on the relevant button of the web page using java script or just simulate a return (enter) key via system events.

Here is the second method :

tell application "System Events" to tell process "Google Chrome" to keystroke return