Enter Search String and Send Now

Summary: Lets you use Command-E for both the Send Now and Enter Search String commands.
Requires: Mailsmith, Mac OS X 10.2 with UI scripting enabled
Install Location: Mailsmith Support/Menu Scripts/Message•Send Now
Last Modified: 2019-10-02

Description

This menu script replaces Mailsmith’s Send Now command. If you have some text selected, instead of sending the current message, Command-E will enter the selection as the search string (like in BBEdit). One problem is that if the message isn’t sendable (i.e. if no recipients have been entered), then the menu item will be disabled and the menu script can’t be used.

Based on a script by John Gruber.

Installation Instructions · Download in Compiled Format · Download in Text Format

Script

on enterSearchString()
    
tell application "System Events"
        
tell application process "Mailsmith"
            
click menu item "Enter Search String" of menu "Search" of menu bar 1
        
end tell
    
end tell
end enterSearchString

on menuselect()
    
tell application "Mailsmith"
        
tell message window 1
            
if (selection as text) is not "" then
                
my enterSearchString()
                
return true
            
else
                
return false
            
end if
        
end tell
    
end tell
end menuselect