I have the following script for sending an email depending on the sender:
set myReply to "Override"
set theSender to "My Team <myteam@gmail.com>"
tell application "Mail"
set theSelection to selection
if theSelection is {} then return
activate
set myList to {}
repeat with thisMessage in theSelection
if (extract address from sender of thisMessage) is "watson@gmail.com" then
set theOutgoingMessage to reply thisMessage with properties {visible:true, sender:theSender}
delay 1
tell application "System Events"
keystroke myReply
delay 1
end tell
send theOutgoingMessage
delay 1
set myList to myList
delay 1
end if
end repeat
end tell
The email that is being received always has this format:
Current Number of Tokens: 100
I detected the following issues with x's account:
- Adding 50 tokens would put the user above 100 tokens
How can I send the email ONLY IF “Current Number of Tokens: number” has a number <=50? And otherwise send another email saying “Sorry. You’ve exceeded the number of tokens”?