image
image

Go Back   macosx.com > Mac Help Forums > Mac OS X System & Mac Software

Reply
 
Thread Tools
  #1  
Old April 18th, 2007, 06:14 AM
Registered User
 
Join Date: Mar 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
mikewren is on a distinguished road
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
Reply With Quote
  #2  
Old April 19th, 2007, 12:24 AM
Registered User
 
Join Date: May 2005
Posts: 1,339
Thanks: 0
Thanked 1 Time in 1 Post
barhar is on a distinguished road
"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.
Reply With Quote
  #3  
Old April 19th, 2007, 03:45 AM
Registered User
 
Join Date: Mar 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
mikewren is on a distinguished road
Thanks Barhar I will give this a go.

The email app is Entourage, and filemaker version 6

Mike
Reply With Quote
  #4  
Old April 19th, 2007, 11:36 AM
Registered User
 
Join Date: May 2005
Posts: 1,339
Thanks: 0
Thanked 1 Time in 1 Post
barhar is on a distinguished road
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 --
Reply With Quote
  #5  
Old April 21st, 2007, 02:52 AM
Satcomer's Avatar
In Geostationary Orbit
 
Join Date: Jul 2002
Location: Northern Virginia
Posts: 5,410
Thanks: 4
Thanked 42 Times in 41 Posts
Satcomer is a jewel in the roughSatcomer is a jewel in the roughSatcomer is a jewel in the rough
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
Reply With Quote
  #6  
Old February 26th, 2008, 10:21 AM
Registered User
 
Join Date: Mar 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
mikewren is on a distinguished road
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
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 05:18 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.