Identifying bookmarked PDF files

I am trying to identify PDF files that have bookmarks from the ones without bookmarks.
I find the script cpdf come closest to what I want to do. It has a feature that lists bookmarks.
If I run
(a) empty: if there is no bookmark
(b) list of bookmarks.
Now, I am trying to use grep the logs (results) and then output the result to Hazel.
Can you guys help me what went wrong?
I find the script cpdf come closest to what I want to do. It has a feature that lists bookmarks.
If I run
- Code: Select all
cpdf -list-bookmarks myfile.pdf
(a) empty: if there is no bookmark
(b) list of bookmarks.
Now, I am trying to use grep the logs (results) and then output the result to Hazel.
- Code: Select all
marks=$(cpdf -list-bookmarks "$1")
list=`grep -l "$marks"*.log`
if [ $? -eq 0 ]
then
/bin/rm $list
fi
Can you guys help me what went wrong?