Post

Replies

Boosts

Views

Activity

Add eMail from domain to Spam
Trying to create a script meant to add selected message(s) to my eMail spam delete rule. Here's what I have written but I cannot seem to make it work. I believe the idea is good, but I cannot get the script to compile so I am not sure it will work as intended. Any ideas or assistance will be greatly appreciated... AppleScript version "2.8 or later" set theProperties to {} tell application id "com.apple.mail" -- Mail.app set theMessages to the selection repeat with i in theMessages set theSender to sender of currentMessage as string set oldDelimiters to AppleScript's text item delimiters set AppleScript's text item delimiters to {"@"} try set theDomain to the second text item of theSender set AppleScript's text item delimiters to "" if theDomain contains ">" then set theDomain to leftStringFromRight(theDomain, ">") of theScript end if repeat if theDomain contains "." then set theDomain to leftStringFromRight(theDomain, ".") of theScript else exit repeat end if end repeat tell rule "Delete" repeat with i in theDomain rule condition at end of rule conditions with properties {rule type:from header, qualifier:does contain value, expression:i} end repeat end tell end repeat end Thanx, Ken
0
0
442
Jul ’22
Analyzing Text
Is it possible to use Applescript to analyze a directory full of text files and report the three most used common nouns in each file?
Replies
1
Boosts
0
Views
397
Activity
Nov ’23
How to Highlight a Hyperlink
I can use the keyboard keys (shift; control; option; command) in various combinations to highlight letters, words, lines and multiple lines. How can I use the keyboard to locate (find) and highlight a hyperlink?
Replies
0
Boosts
0
Views
337
Activity
Jul ’22
Add eMail from domain to Spam
Trying to create a script meant to add selected message(s) to my eMail spam delete rule. Here's what I have written but I cannot seem to make it work. I believe the idea is good, but I cannot get the script to compile so I am not sure it will work as intended. Any ideas or assistance will be greatly appreciated... AppleScript version "2.8 or later" set theProperties to {} tell application id "com.apple.mail" -- Mail.app set theMessages to the selection repeat with i in theMessages set theSender to sender of currentMessage as string set oldDelimiters to AppleScript's text item delimiters set AppleScript's text item delimiters to {"@"} try set theDomain to the second text item of theSender set AppleScript's text item delimiters to "" if theDomain contains ">" then set theDomain to leftStringFromRight(theDomain, ">") of theScript end if repeat if theDomain contains "." then set theDomain to leftStringFromRight(theDomain, ".") of theScript else exit repeat end if end repeat tell rule "Delete" repeat with i in theDomain rule condition at end of rule conditions with properties {rule type:from header, qualifier:does contain value, expression:i} end repeat end tell end repeat end Thanx, Ken
Replies
0
Boosts
0
Views
442
Activity
Jul ’22