I'd be grateful in anyone can translate the referenced approach to one that can be used in an AppleScript call in this way ...
Code: Select all
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
(*
applies a tag to PDFs of selected publications
2021-07-30
jjw
*)
-- name the Finder tag
property tagName : "annotated"
on run {}
tell application "Bookends"
activate
set theSelectedList to the selected publication items of the front library window
repeat with thePub in theSelectedList
set theAttachments to the attachment items of thePub
repeat with theAttachment in theAttachments
set theFilePath to the path of theAttachment as text
my setFinderTag(theFilePath)
end repeat
end repeat
end tell
end run
on setFinderTag(theFilePath)
-- need this function
end setFinderTag