Hi there,
as written in this tip I only use Nisus Writer with “Nisus Compressed Rich Text” files to prevent (accidental) loss of Nisus styles.
“Nisus Compressed Rich Text” records are only searchable by name as DEVONthink (and other apps) can’t look inside the archive.
With this Smart Rule script it’s possible to make Nisus Compressed Rich Text records searchable by text content.
In the Smart Rule set Suffix
to ZRTF (Nisus Compressed Rich Text)
-- Set finder comment to plain text of "Nisus Compressed Rich Text" record and thus make it searchable in DEVONthink 3
-- CAUTION: script overwrites existing finder comment!
on performSmartRule(theRecords)
tell application id "DNtp"
try
repeat with theRecord in theRecords
if kind of theRecord = "Nisus Compressed Rich Text" then -- (depends on language I think)
set thePath to path of theRecord
set plainText to do shell script "gzip -c -d " & quoted form of thePath & " | textutil -stdin -convert txt -stdout"
set comment of theRecord to plainText
end if
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
end try
end tell
end performSmartRule