For my emails, the organization I found best is having one central (but more private) mailbox combined with a dozen more specialized mailboxes. Any mail to a secondary mailbox automatically gets copied to the central mailbox, so I only need to check my central mailbox.
However I doneed to enter the secondary mailboxes once in a while lest they be considered as bogus accounts and deleted. So, a script to just enter/exit each of them in turn would be quite useful to me.
Below is a script supposed to enter one mailbox. It does its job but only the second trial (the first time it only goes to the mailbox page without entering it). With this type of behaviour I can’t combine exiting of one mailbox with entering another.
What’s going on here ? Perhaps I should insert delays into the code ?
to goToWebPage(theWebPage)
tell application "Safari"
activate
set URL of document 1 to theWebPage
end tell
end goToWebPage
to clickID(theId)
tell application "Safari"
do JavaScript "document.getElementById('" & theId & "').click();" in document 1
end tell
end clickID
to inputByID(theId, theValue)
tell application "Safari"
do JavaScript " document.getElementById('" & theId & "').value ='" & theValue & "';" in document 1
end tell
end inputByID
to clickClassName(theClassName, elementnum)
tell application "Safari"
do JavaScript "document.getElementsByClassName('" & theClassName & "')[" & elementnum & "].click();" in document 1
end tell
end clickClassName
goToWebPage("https://gmx.com")
clickID("login-button")
inputByID("login-email", "************************")
inputByID("login-password", "************************")
clickClassName("login-submit", 0)