Selecting an option from a dropdown menu in Safari

Howdy all. It's slow at work so I've been attempting to tweak a couple of macros.

I would like to select a drop down menu item within Safari to change my work status from "available" to "away" and vice versa. Right now I use click at found image and it works pretty reliably. But not 100%.

I read quite a few pages on using form fields and basically if I understand right this is doable if you can get the form field name from the HTML source. So I looked at the source with the Safari developing tools but it's been so many years since I worked with HTML that it's beyond my comprehension.

I would post a link to the webpage itself but it's a private page linked to my work credentials so obviously I can't give that out. But I will copy the HTML code below so hopefully somebody can chime in and enlighten me as to what the form name might be.

Thanks all!

This is the source code when my work status is set to "available":>

This is the source code when my work status is set to "unavailable"

EDIT: Uploaded screenshots instead of code

Hey Chris,

It doesn't hurt to have the screenshots, but the actual code is more useful.

This is a JavaScript question rather than an HTML question.

Run from an Execute a JavaScript in Safari action, something like the following might work.

document.getElementsByClassName('ng-binding ng-scope')[0].value = 'Available'
document.getElementsByClassName('ng-binding ng-scope')[0].value = 'Away'

But -- without being able to test directly this kind of advice is very hit or miss...

-Chris

Yes I realize it would be shooting in the dark without yall having access to the actual page. I'll try the script you posted, but if it doesn't work I just won't worry about it.

Thanks for your help!