• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Web Beacons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Web Beacons


  • Subject: Re: Web Beacons
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 03 Mar 2012 16:37:09 -0600

On Mar 03, 2012, at 10:51, Mel Charters wrote:
Does anyone know whether it is possible to detect Mail messages that contain HTML with web beacons embedded using AppleScript?
______________________________________________________________________

Hey Mel,

It's certainly possible.

This is just a basic proof-of-concept that gets the source of incoming messages.

on perform_mail_action(info)
try


tell application "Mail"
set selectedMessages to |SelectedMessages| of info
set theRule to |Rule| of info
repeat with theMessage in selectedMessages
set theSource to source of theMessage
set theRuleName to name of theRule
set theText to "The rule named '" & theRuleName & "' matched this message:" & return & return & "Source: " & return & return & theSource


tell application "BBEdit"
activate
tell text of front text window
set after it to theSource & return
select insertion point after last character
end tell
end tell


end repeat
end tell


on error eMsg number eNum
set {c, s} to {return, "------------------------------------------"}
set e to s & c & "Error: " & eMsg & c & s & c & "Error Number: " & eNum & c & s
beep
tell me to display dialog e
end try
end perform_mail_action

TextWrangler should work if you don't have BBEdit.

You then need to be able to parse the source for web-bugs.

I would use the Satimage.osax's 'find text' with regular expressions to do the parsing, but you could easily shell-out to Perl, Python, Ruby, etc.

--
Best Regards,
Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Web Beacons
      • From: Mel Charters <email@hidden>
References: 
 >Web Beacons (From: Mel Charters <email@hidden>)

  • Prev by Date: Re: Web Beacons
  • Next by Date: Re: Overhead in Using Run Script in a Loop ???
  • Previous by thread: Re: Web Beacons
  • Next by thread: Re: Web Beacons
  • Index(es):
    • Date
    • Thread