|
#1
| |||
| |||
| Automator Newbie Needs Help Hi all I have had some very good help and advice on other issues on this site and hope someone can help me now. I have a file containing 4000 pdf's, I also have a filemaker database with 4000 records in it. I need to email the 4000 filemaker contacts attaching there individual pdf! Does anyone know if I can set up an automator action to look up the email address in filemaker, then look up and attach the related pdf, and send the email out? I look forward to some ideas on how to attempt this. Thanks Mike |
|
#2
| |||
| |||
| "I have a file containing 4000 pdf's," - if so, how do you separate pdf files from within the single file? if not, how do associate each '.pdf' file with an e-Mail address, or other field of the FileMaker database? What version of 'FileMaker' are you referring to? What e-Mail application(s) are you (do you intend) using? There are 'FileMaker' 'Automator' actions available, such as 'FileMaker Automator Actions' or the FileMaker Inc. 'Automator' actions via 'Database Publishing' [look in the 'FILEMAKER PRO ACTIONS' box, for the respective link]. You will have to mix and match various application actions to perform the overall process you desire. Associating the obtained e-Mail addresses from a FileMaker database, to multiple e-Mail addresses (of 'Mail', 'Eudora', ' But then, there is AppleScript ... Below is a 'quick and dirty' working example of how to obtain e-Mail addresses from a FM database, associate '.pdf' files (by their file names matching e-Mail addresses - obtained from a FM database), and to e-Mail the associated '.pdf' files - as attachments. -- AppleScript Code begins here -- set DB_Path to "HD1:Users:bh:MyFirstFMDB.fp7" -- Full path to FM database file. set PDF_Folder to "HD1:Users:bh:MyFirstFMDB_PDFs:" -- Path to PDF files. set eMail_List to {} -- Create a list, to contain obtained e-Mail addresses. tell application "Finder" to set pdf_LIst to every file of entire contents of folder PDF_Folder whose name extension is "pdf" tell application "FileMaker Pro Advanced" open file DB_Path -- Open desired FM database. set tRecords to every record -- Obtain all records of current database. end tell repeat with i in tRecords -- Cycle throught the list of records, of current database. copy (item 9 of i) to end of eMail_List -- In my 'quick and dirty' FM database, item 9 is the e-Mail Address field. end repeat tell application "Mail" activate -- Optional. repeat with i in eMail_List set nMessage to make new outgoing message with properties {subject:"See attached PDF file", content:"Here is the promised '.pdf' file.", visible:false} tell nMessage make new to recipient at end of to recipients with properties {address:i} tell content repeat with j in pdf_LIst tell application "Finder" to set file_Name to (name of j) set file_Name to get (characters 1 through ((count file_Name) - 4) of file_Name) as string if (i begins with file_Name) then make new attachment with properties {file name: (j as alias)} at after the last paragraph end repeat end tell send end tell end repeat end tell -- AppleScript Code ends here -- Last edited by barhar; April 19th, 2007 at 12:37 AM. |
|
#3
| |||
| |||
| Thanks Barhar I will give this a go. The email app is Entourage, and filemaker version 6 Mike |
|
#4
| |||
| |||
| Below is a 'quick and dirty' working example of how to obtain e-Mail addresses from a FM database; associate '.pdf' files; and, to e-Mail the associated '.pdf' files - as attachments, via 'Microsoft Entourage'. -- AppleScript Code begins here -- set DB_Path to "HD1:Users:bh:MyFirstFMDB.fp7" -- Full path to FM database file. set PDF_Folder to "HD1:Users:bh:MyFirstFMDB_PDFs:" -- Path to PDF files. set eMail_List to {} -- Create a list, to contain obtained e-Mail addresses. tell application "Finder" to set pdf_LIst to every file of entire contents of folder PDF_Folder whose name extension is "pdf" tell application "FileMaker Pro Advanced" open file DB_Path -- Open desired FM database. set tRecords to every record -- Obtain all records of current database. end tell repeat with i in tRecords -- Cycle throught the list of records, of current database. copy (item 9 of i) to end of eMail_List -- In my 'quick and dirty' FM database, item 9 is the e-Mail Address field. end repeat tell application "Microsoft Entourage" --activate -- Optional. repeat with i in eMail_List set tMessage to make new outgoing message with properties {recipient:i, subject:"See attached PDF file", content:"Here is the promised '.pdf' file."} tell tMessage repeat with j in pdf_LIst tell application "Finder" to set file_Name to (name of j) set file_Name to get (characters 1 through ((count file_Name) - 4) of file_Name) as string if (i begins with file_Name) then set tAttachment to make new attachment at end with properties {name:file_Name, file: (j as alias)} end repeat send end tell end repeat end tell -- AppleScript Code ends here -- |
|
#5
| ||||
| ||||
| Automator.us is a good place to start.
__________________ PowerMac G5 Dual 1.8(Rev A.), , 7 Gig RAM, Pioneer DVR-110, ATI X800XT, OS X 10.4.11 & 10.5.5, 23'' HD LCD Mac Book Pro Core 2 Duo 2.16Mhz, SuperDrive, ATI X1600, 2GB RAM, OS X 10.5.5 1TB Time Capsule 5g iPod 30Gig White |
|
#6
| |||
| |||
| After a lot of time i am final able to come back to this project!! I am having trouble with the line - copy (item 9 of i) to end of eMail_List -- In my 'quick and dirty' FM database, item 9 is the e-Mail Address field. I keep getting the error Access is denied, I am sharing the FP File, access to everyone Any idea? Thanks again for all the help I have had so far Mike |