This Applescript proved to be a popular one. It generates an encoded string for pasting in Usenet posts or emails that may end up on archived webpages or forums. The purpose is spam prevention.
CategoryApplescript CategoryShell

Download the script here: Spamfree_Signature.dmg

Here is an example of what the script does:

echo 38698196677083401706731788025369086101258315035012362P|dc

Copy or drag the string into Terminal and press «return». You will see my email address.

The script asks you for a string to encode, you are not limited to an email address.

The Applescript looks like this:

#!Applescript (-)
-- Script by Gnarlodious
tell application "Address Book" to value of email 1 of my card as string
display dialog "Your email address:" default answer ¬
        result buttons {"OK"} default button 1
set textString to the text returned of result & (ASCII character 10)

set allCharacters to characters of textString

set decString to ""
repeat with someCharacter from 1 to count of allCharacters
        ASCII number of item someCharacter of allCharacters
        set thisBinary to ¬
                do shell script "echo \"obase=2;" & the result & "\" | bc -l"
        repeat until length of thisBinary = 8
                set thisBinary to "0" & thisBinary
        end repeat
        set decString to decString & thisBinary
end repeat

do shell script "echo \"ibase=2;" & decString & "\" | bc -l"

set the clipboard to "echo " & the result & "P|dc"
display dialog ¬
        "The result is on the clipboard" buttons {"OK"} default button 1

Smiley:

Computer/AppleMail/SpamfreeSignature (last edited 2008-11-11 13:00:33 by Gnarlodious)