Created
October 15, 2013 14:37
-
-
Save RazorAnt/6992563 to your computer and use it in GitHub Desktop.
Airmail script for ProfitTrain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- The following is an AppleScript function ProfitTrain will call when you choose "Email Client..." | |
-- under an invoice. Before using the built in AppleScript ProfitTrain will look for | |
-- this user AppleScript file at: | |
-- /Users/[you]/Library/Application Support/ProfitTrain/email_invoice_using_user_script.scpt | |
-- By edting this file you can further customize the email with different subject lines, etc. | |
-- and/or use an alternative email client that is not supported by Billable by default. | |
-- Script using Airmail | |
on mail_invoice(subject_line, to_name, to_address, attachment_path) | |
-- Alert to show us which script is being called. | |
-- Feel free to comment out when you are done editing. | |
--display alert ("This is the user script and is editable in the Application Support folder of ProfitTrain.") | |
tell application "AirMail" | |
activate | |
set attachmentfilename to (POSIX file attachment_path) as string | |
set theMessage to make new outgoing message with properties {subject:subject_line, content:"Your invoice is attached."} | |
tell theMessage | |
--set sender to "[email protected]" | |
--set signature to "Default" | |
make new to recipient at end of to recipients with properties {name:to_name, address:to_address} | |
--make new cc recipient at end of cc recipients with properties {name:"Lara", address:"[email protected]"} | |
--make new bcc recipient at end of bcc recipients with properties {name:"Mark", address:"[email protected]"} | |
make new mail attachment with properties {filename:attachmentfilename as alias} | |
compose | |
end tell | |
end tell | |
end mail_invoice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this. :-)