Creating a publication item is easy:
Code: Select all
set newPublication to make new publication item with properties {name: "Some name"}
Code: Select all
set newAttachmentItem to make new attachment item with properties {path:recordPath}
Code: Select all
on addRecordToBookends(someRecord)
tell application id "DNtp"
set recordNameWithoutExtension to someRecord's name without extension
set recordName to someRecord's name
set recordPath to someRecord's path
tell application "Bookends"
tell front library window
set newPublicationItem to make new publication item with properties {title:recordNameWithoutExtension as text}
set newAttachmentItem to make new attachment item with properties {name: someName, path:recordPath}
set newPublicationItem's attachments to newAttachmentItem
end tell
end tell
end tell
end addRecordToBookends