Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8556 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Is anyone here familiar with Outlook Express scripting? Specifically, I'm interested in creating a message with a recipient, subject and attachment, and Outlook isn't recordable to any great extent, and the dictionary is just about useless.

Thanks,

Chuck

Posted

I hadn't seen that, but I did find a solution to the problem. In case anyone is interested, here is an AppleScript that takes a file called "untitled" (which is what PDFWriter calls the file when FileMaker Pro prints without a dialog) on the desktop (which is where PDFWriter places the file) and renames the file from a field in FileMaker and then sends an email to with the file enclosed. Perhaps it will help someone else to have it here as a reference. I just love what one can do with AppleScript!

Chuck

code:


-- Written by Charles E. Ross, [email protected], [email protected]

-- May 24, 2001

-- Version 1.0b1

-- This script gets the current invoice ID number from the projects database

-- in FileMaker and sets the untitled document on the desktop, which should

-- be a PDF file, to have the name of that invoice ID.

-- Limitations:

--
Posted

Hey Chuck,

Thanks for the cool script. I have one question though. I have taken your script and added to a script I have in FMPro that goes through a found set of records and prints out pdf files of each of them. I have inserted you script inside the loop so that the FM script prints a record, then runs the AppleScript to rename the newly created file then moves onto the next record. The problem I have is that I can't get the script to recognize the project number of the record (your invoice ID). The script keeps naming the pdf file with the project number of the first file in the database even if it isn't in the current found set. I hope this makes sense. Any idea how to get your script to update with the next record?

P.S. I have also inserted a set field step in the FM script to set a global field to the project number of the current record. For some reason, though, the AppleScript is ignoring it. Thanks.

Posted

Hey Chuck,

Thanks for the cool script. I have one question though. I have taken your script and added to a script I have in FMPro that goes through a found set of records and prints out pdf files of each of them. I have inserted you script inside the loop so that the FM script prints a record, then runs the AppleScript to rename the newly created file then moves onto the next record. The problem I have is that I can't get the script to recognize the project number of the record (your invoice ID). The script keeps naming the pdf file with the project number of the first file in the database even if it isn't in the current found set. I hope this makes sense. Any idea how to get your script to update with the next record?

P.S. I have also inserted a set field step in the FM script to set a global field to the project number of the current record. For some reason, though, the AppleScript is ignoring it. Thanks.

Posted

In my script the field gCurrent_Invoice_ID is a global field. Before I run the AppleScript I use FileMaker's Set Field to set this field to the Invoice_ID field of the invoice I want to print. This field is the same for every record in the database, so it doesn't matter which record it gets the data from. Make sure that AppleScript references the global field and not the local record level field. Also try adding a clause "of current record" to the line that references the field, so that it would read:

set invoiceID to cell "gCurrent_Invoice_ID" of current record

Posted

Chuck,

Thanks for the explanation. It doesn't seem to work though. Now I am getting an "object not found" error from FileMaker. Maybe I need to start over.

This topic is 8556 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.