Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Use applescript to automatically click link in mail

On my Mac OS X El Capitan, I am trying to write a Applescript to go to certain folder in my mail app and opens a email containing "Get" and it will click the link in that mail. I got it up to opening the message but cannot get it to search the email and click on it.


on run


activateapplication "Mail"

tell application "Mail"

set myInbox to mailbox "Mypoints" of account 3

set myMessages to every message of myInbox


repeat with theMessage in myMessages


opentheMessage


set messageContent to content of theMessage

set searchText to "Get"

if messageContent contains searchText then


tell application "TextEdit"

set theDocument to make new document

set text of theDocument to messageContent


end tell


delay 50


--display dialog "Take a break!" buttons {"Ok"} default button 1

end if

delay 2


-- delete theMessage


closewindow 1

end repeat


end tell

end run

MacBook Pro with Retina display, OS X El Capitan (10.11), null

Posted on Oct 11, 2015 12:25 PM

Reply

There are no replies.

Use applescript to automatically click link in mail

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.