View Single Post
Quote:
Originally Posted by mlevin777 View Post
I can - an OF Ninja actually sent me a 1-line zsh code that scans the database and generates a list of all links. I guess I could just use zsh to test for the presence of each one.
Here's a zsh one-liner which tests to see which of your linked OmniFocus attachments still exist at the same path:

Code:
for file in "$HOME/Library/Application Support/OmniFocus/OmniFocus.ofocus"/*.zip; do; unzip -p $file contents.xml | xmllint -format - | grep 'cell href='; done | sed 's/.*<cell href="//' | sed 's/".*//' | while read url; do; if curl -s -I $url > /dev/null; then; echo Found $url; else; echo Lost $url; fi; done
If you want to just see the lost URLs, you could do this:

Code:
for file in "$HOME/Library/Application Support/OmniFocus/OmniFocus.ofocus"/*.zip; do; unzip -p $file contents.xml | xmllint -format - | grep 'cell href='; done | sed 's/.*<cell href="//' | sed 's/".*//' | while read url; do; if ! curl -s -I $url > /dev/null; then; echo $url; fi; done
Hope this helps!