set the_path to (do shell script "/usr/bin/textutil -inputencoding utf-8 -stdout -format rtf -convert html ~/Library/Caches/TemporaryItems/OpenFileLinksFromRichText.rtf | grep -o 'file:///[^\"]*' | /opt/local/bin/python3 -c \"import sys; from urllib.parse import unquote; print(unquote(sys.stdin.read()));\" | perl -pe 's/&amp;/&/g;' -pe 's/^file:\\/\\///g;' -pe 'chomp'")