Script make new publication with attachment?

Users asking other users for AppleScripts that work with Bookends.
Post Reply
KevinCoates
Posts: 3
Joined: Sun Dec 30, 2018 9:50 am

Script make new publication with attachment?

Post by KevinCoates » Wed Feb 05, 2020 9:44 am

Hi

Is it possible to script "make new publication item with properties" and also specifying an attachment (say, a PDF in the Downloads folder)? If so, what is the syntax?

Thanks

Kevin

Jon
Site Admin
Posts: 8429
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Script make new publication with attachment?

Post by Jon » Wed Feb 05, 2020 3:00 pm

This page has detailed information on scripting Bookends, including creating a reference with properties. Attachments is just another property. It holds the name of the attachment -- it's up to you to make sure Bookends knows to look in the Downloads folder for attachments.

Jon
Sonny Software

KevinCoates
Posts: 3
Joined: Sun Dec 30, 2018 9:50 am

Re: Script make new publication with attachment?

Post by KevinCoates » Wed Feb 05, 2020 3:32 pm

Hi Jon

Many thanks for the reply. I guess you mean this page - https://www.sonnysoftware.com/scriptingbookends/ - ? I don't think there was a link in your response.

Yes, I've read that page, and the manual, but I'm clearly missing something (my fault I'm sure; my applescript knowledge is patchy). I suspect it's the part in the second half of your sentence - making sure Bookends knows to look in the Downloads folder for attachments. Should "attachments:" when specifying the properties be followed by a full path to the attachment? In the form "~/Downloads/file.pdf"? Or do I need to specify the folder elsewhere?

Any and all hints appreciated!

Kevin

Jon
Site Admin
Posts: 8429
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Script make new publication with attachment?

Post by Jon » Wed Feb 05, 2020 3:38 pm

Yes, sorry, forgot the link. The attachments field contains the name of the attachment only, no path information.

Either make Downloads your default attachment folder OR attach one PDF from that folder the usual way. Once you have, Bookends will remember that folder has attachments and look there if it can't find the attachment in your default folder.

Bookends remembers paths of folders, not files.

Jon
Sonny Software

KevinCoates
Posts: 3
Joined: Sun Dec 30, 2018 9:50 am

Re: Script make new publication with attachment?

Post by KevinCoates » Wed Feb 05, 2020 4:19 pm

Great ! Thanks Jon.

Post Reply