Get every publication item from a smart group
Posted: Fri Dec 13, 2019 9:42 am
I am trying to export the formatted references to a text file. I am using a keyword (called "read_it") to filter the entire library and saving the result into a text file. My question is, can I export a smart group (called "group_read_it") that already has the filtered reference using the keyword ("read_it")? searching a keyword in the entire library takes time and slows down the entire process!
I am not sure if one can export the references from a smart filter although few groups like "group recently viewed" does work well, here is my AppleScript that works well to filter the entire library with keyword search
I am not sure if one can export the references from a smart filter although few groups like "group recently viewed" does work well, here is my AppleScript that works well to filter the entire library with keyword search
Code: Select all
tell application "Bookends"
tell front library window
set myPubs to every publication item whose keywords contains "read_it"
if myPubs is not {} then
set theBody to format myPubs using "read_it" as HTML
end if
end tell
end tell
set outputFile to ((path to desktop as text) & "LaunchAgent_Alert.html") -- represents "MacHD:Users:chittu:Desktop:LaunchAgent_Alert.txt"
try
set fileReference to open for access file outputFile with write permission
write theBody to fileReference
close access fileReference
on error
try
close access file outputFile
end try
end try