Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Export Mail signatures to a text file' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Export Mail signatures to a text file
Authored by: wannesdaemen on Mar 28, '03 09:37:36AM
that's great!
er, i am a complete applescript newbie -
is there a way to do this proces in reverse?
in other words: is it possible to make changes to all of my signatures at the same time?
i have a lot (40something), they're all different, but each has a similar part that i wish to change from time to time. can i do this in some global manner?

[ Reply to This | # ]
Import Mail signatures from a text file
Authored by: EvanRobinson on Jun 06, '03 10:43:05AM
-- this script will import signatures from "sigdata.txt"
-- on your desktop.
-- each signature is multiple lines, separated by a single
-- line consisting solely of two percent signs '%%'
-- for background on why I wrote it, see
-- http://www.enginesofmischief.com/blogs/ramblings/archives/000096.php
-- where there will also be an expanded version someday

property sigdump : (path to desktop as string) & "sigdata.txt"

set sigdump to sigdump as alias
set theFile to open for access (sigdump)
set theText to read theFile using delimiter return
close access theFile

set sigNumber to 0
set sigText to ""
repeat with i from 1 to count of theText
        set theLine to item i of theText
        if theLine is "%%" then
                tell application "Mail"
                        make new signature with properties {name:sigNumber as text, content:sigText}
                end tell
                set sigNumber to sigNumber + 1
                set sigText to ""
        else if sigText = "" then
                set sigText to theLine
        else
                set sigText to sigText & "
 " & theLine
        end if
end repeat


[ Reply to This | # ]
Import Mail signatures from a text file
Authored by: EvanRobinson on Jun 09, '03 03:34:16PM
The expanded version is now at my web page.

[ Reply to This | # ]