I want to attach/append a file ($AttachmentFile) from a remote folder when saving a file but the 'append' option doesn't allow for this. Is there a way to do this?
Are you trying to append an existing PDF to a different PDF--perhaps one newly created by FileMaker?
No, that can't be done with just the standard FileMaker scripts steps.
There are plug-ins that can do this, however.
Its a previously created non-FM file I want to add to a FM file. The 2 files have to be edited frequently and combined for presentation. Currently it has to be done manually. Looking for a timesaving convenient process.
Then you either save the second PDF as a new PDF each time so that you can use the append option or you use a plug in to do this. (Or maybe a web or micro-service).
How would I select the non-FM file? It's always saved to the same folder and $AttachmentFile is collecting the filename. I have another similar solution but both files are created in FM.
This is my solution for the 2 FM file append.
If you want to append a new PDF to an existing PDF
If it's in a container field, use export field contents to export a copy.
If it's in a shared directory (and you don't want to modify the copy in the shared directory), get a copy of the file. One way is to insert the file into a container and export it.
Either way, you now have a copy of the file at a known location. you have the filename and the file path.
You then can use save as PDF, with the append option and specifying that same name and path to create a new PDF appended to the end of the existing PDF.
This is essentially the same process that you have in your script except that you go and get a copy of the PDF instead of using save as PDF for the first of the two PDF documents.
Thanks, that works but places the pdf's in reverse order for my needs as it appends the current record to the end of my exported pdf.
As I said from the beginning, use a plug-in or possibly a web service.
I've been emailing with Gavin privately but thought I would post my answer and script here in case it might help others. Since he asked me specifically about an AppleScript solution I used I modified one I developed for a client using a Mac to. It uses a Python function that is part of Automator to combine PDFs putting the exported PDF from a container field as the second page.
Retrieving data ...