How to export a merged pages document to a pdf with different attributes for each pdf?

Hello,


I have played around with the script that I found here: https://discussions.apple.com/thread/252067443


It's working fine but I want to export every single pages document to a pdf with every pdf

using another name ( I want to use the placeholders info for the pdf)


So for example: output of the pdf's:


Invoice (placeholder name).pdf


so I will end up with a folder with unique pdf names.


Is this possible and how, I'm a complete noob with java script.


Thanks


grt Erik


Posted on Nov 24, 2021 12:56 PM

Reply

Similar questions

3 replies

Nov 26, 2021 12:27 AM in response to VikingOSX

Hello,


I just played around and I have got it working, using a code from another source


doc.export({to: Path("Users/my name/Desktop/invoice "+invoicenr+" - "+name+".pdf"), as: "PDF"});


The invoicenr and name are both optional to your own page holder.


Maybe it's not completely the correct way but I'm happy that it is working for my needs.


Regards Erik

Nov 25, 2021 8:37 AM in response to rik778

I have written AppleScripts that export each Pages document (foo.pages) to PDF with the latter bearing the Pages document name (foo.pdf). It is also possible to choose the destination folder for the exported PDF rather than the original Pages document location. Does not use placeholder text as it takes the name of the Pages document. Do understand that once a placeholder text field is used, it cannot be reused for a different name.


Who will support your JavaScript for Automation code when you get in a bind and need help?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to export a merged pages document to a pdf with different attributes for each pdf?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.