Mailsmith
Other Programs
Scripts
Mailsmith.scpt
Archive to sub-mailbox
Check Spelling
Find reply
Change font size
Submit Script to JEM
Fix common spelling errors
Setting SMTP server
URL from Safari
Address from AB
linkMunge
Export to Address Book
Saving attachments
Digest Script
File with same
POP window position
Position of new windows
iCal and Mailsmith
Edit From Line
Modified Thread Script
Reply to Selection
Temporary Text Window
Compact gain
Tracking backups
Edit subject
Googler
Auto-rewrap
MMA
SMTP server
Open, fetch, and close
URL Manager
BrainForest
Thread by Author
Thread by subject
Export Email
Get Selection
Read Addresses
Export Email
Organize Email
Account setup
Mailsmith 2 BBEdit
BBEdit 2 Mailsmith
Search II
Check One
Delete Enclosure
Open, fetch, close
Set Answered
Set Redirected
Empty Trash
List found
Print Several
Del. old. msg.
Delete Enclosures
Accounts
Address Book
Editing
Filters
General
Import/Export
Links
Mailboxes
Memory
Scripting
Speed
send/receive
Tips/Tricks


From BBEdit to Mailsmith

Author Christian Smith
Last modified 1999-04-26
What is this?

This is for use with BBEdit

The script displays a dialog and asks you if you want to attach the current file to a new message in Mailsmith or to the current message.

If you select "new" it does the logical thing.

If you select "current" it looks for the first message window in Mailsmith, attachs the file as an enclosure and brings that window to the front.

If you select "cancel" it does nothing.


set ret_text to button returned of (display dialog "Attach to new or current message?" buttons {"New", "Current", "Cancel"} default button "New")

if ret_text is "New" then
    tell application "BBEdit 5.0"
        set the_file to file of window 1
    end tell
    tell application "Mailsmith 1.1"
        make new message window
        make new enclosure at end of window 1 with properties {file:the_file}
        activate
    end tell
end if

if ret_text is "Current" then
    tell application "BBEdit 5.0"
        set the_file to file of window 1
    end tell
    tell application "Mailsmith 1.1"
        set current_message to first message window
        
        make new enclosure at end of current_message with properties {file:the_file}

        set index of current_message to 1
        activate
    end tell
end if