Hi tom,
I currently have a working script that does exactly this.
I’ve also, at a previous job created the same script.
Here is the current script I am using…
display dialog "Would you like to email Final edits, FTP/Email final PDF, or send a Proof?" buttons {"Final edits", "FTP/Email final PDF", "Proof"} default button "Proof"
set ans to the button returned of the result
if the ans is "Proof" then
set pdf to choose file with prompt "Please select the PDF to be emailed to the IHT..."
set AppleScript's text item delimiters to ":"
set mailsubj to (get last text item of (pdf as string)) as string
tell application "Mail"
set newmsg to make new outgoing message with properties {subject:"PDF " & (mailsubj) & " attached.", content:"Waiting for edits." & return & return & "Thank You." & return}
tell newmsg
make new to recipient at beginning of to recipients with properties {name:"IHT", address:"xxx@xxx.com"}
set AppleScript's text item delimiters to ","
set dayastext to get first text item of ((current date) as string)
if dayastext is "Friday" then
make new to recipient at beginning of to recipients with properties {address:"xxx@xxx.com"}
end if
set AppleScript's text item delimiters to ":"
make new cc recipient at beginning of cc recipients with properties {name:"Bea", address:"xxx@xxx.net"}
make new cc recipient at beginning of cc recipients with properties {name:"Anne", address:"xxx@xxx.net"}
make new cc recipient at beginning of cc recipients with properties {name:"Anne", address:"xxx@xxx.net"}
make new cc recipient at beginning of cc recipients with properties {name:"Phil", address:"xxx@xxx.net"}
make new cc recipient at beginning of cc recipients with properties {name:"Dylan", address:"xxx@xxx.net"}
set visible to true
set sender to "xxx@xxx.net"
make new attachment with properties {file name:pdf}
end tell
activate
end tell
else if the ans is "FTP/Email final PDF" then
set pdf to choose file with prompt "Please select the PDF to be emailed and uploaded to the IHT..."
set AppleScript's text item delimiters to ":"
set mailsubj to (get last text item of (pdf as string)) as string
tell application "Mail"
set newmsg to make new outgoing message with properties {subject:"FTP sent and " & (mailsubj) & " attached.", content:"Thank You." & return}
tell newmsg
make new to recipient at beginning of to recipients with properties {name:"IHT", address:"xxx@xxx.com"}
set AppleScript's text item delimiters to ","
set dayastext to get first text item of ((current date) as string)
if dayastext is "Friday" then
make new to recipient at beginning of to recipients with properties {address:"xxx@xxx.com"}
end if
set AppleScript's text item delimiters to ":"
make new cc recipient at beginning of cc recipients with properties {name:"Bea", address:"xxx@xxx.net"}
make new cc recipient at beginning of cc recipients with properties {name:"Anne", address:"xxx@xxx.net"}
make new cc recipient at beginning of cc recipients with properties {name:"Anne", address:"xxx@xxx.net"}
make new cc recipient at beginning of cc recipients with properties {name:"Phil", address:"xxx@xxx.net"}
make new cc recipient at beginning of cc recipients with properties {name:"Dylan", address:"xxx@xxx.net"}
set visible to true
set sender to "xxx@xxx.net"
make new attachment with properties {file name:pdf}
tell application "Fetch"
activate
try
close window "Fetch Transcript"
end try
try
make new transfer window at beginning with properties {hostname:"xxx.xxx.com", username:"xxx", password:"xxx"}
on error
send to transfer window "xxx.xxx.com" ftp command {"user xxx@000.000.000.000", "PASS xxx"}
end try
duplicate pdf to remote item ":"
end tell
tell application "Mail"
activate
end tell
end tell
end tell
else if the ans is "Final edits" then
set pdf to choose file with prompt "Please select the PDF to be emailed to the IHT..."
set AppleScript's text item delimiters to ":"
set mailsubj to (get last text item of (pdf as string)) as string
tell application "Mail"
set newmsg to make new outgoing message with properties {subject:"Edits to " & (mailsubj), content:"Waiting for final OK." & return & return & "Thank You." & return}
tell newmsg
make new to recipient at beginning of to recipients with properties {name:"xxx", address:"xxx.com"}
set AppleScript's text item delimiters to ","
set dayastext to get first text item of ((current date) as string)
if dayastext is "Friday" then
make new to recipient at beginning of to recipients with properties {address:"xxx@xxx.com"}
end if
set AppleScript's text item delimiters to ":"
make new cc recipient at beginning of cc recipients with properties {name:"Bea", address:"xxx@xxx.net"}
make new cc recipient at beginning of cc recipients with properties {name:"Anne", address:"xxx@xxx.net"}
make new cc recipient at beginning of cc recipients with properties {name:"Anne", address:"xxx@xxx.net"}
make new cc recipient at beginning of cc recipients with properties {name:"Phil", address:"xxx@xxx.net"}
make new cc recipient at beginning of cc recipients with properties {name:"Dylan", address:"xxx@xxx.net"}
set visible to true
set sender to "xxx@xxx.net"
make new attachment with properties {file name:pdf}
end tell
activate
end tell
end if
This script gives a few options.
The purpose of it is to email proofs out of the work we do here. It can also email “final edits” and lastly, it can email a final proof to many different people, even on different days of the week it sends it to others, and then it uploads it to an FTP to be published.
I’ll gladly give you a hand writing this. No cash transaction is necessary. I enjoy doing it.
p.s. I’ve replaced any sensitive information in the script with “xxx”
In case you’re not subscribed to this topic, I’ll also email you.