Here is the overall goal. Lets say I have 10 tabs open in a Safari window. I want to tab to the correct open field in the first Safari tab.
- Type a string of text.
- Hit the "send" button below this field.
- Move to the next Safari tab
- repeat this process until the same text has been submitted in all open tabs.
The code below does everything but clicking the send button. When I "inspect element" on the "send" button here is what I see:
<input type=“submit” class=“submit” value=“Send”> = $0
Can someone tell me how to modify my code to use that and get the send button clicked on each page? Here is the code I have so far (I am brand new to AppleScript, btw)
tell application "Safari"
activate
end tell
tell application "Safari"
set tabList to every tab of window 1
repeat with currentTab in tabList
tell application "System Events"
delay 1
keystroke tab
keystroke tab
keystroke tab
keystroke tab
delay 2
keystroke "text i want on each page"
delay 1
delay 1
tell application "System Events" to key code 30 using {shift down, command down}
end tell
end repeat
end tell