There is a table listing attached files in the cache.
You should be able to read it like this:
Code:
on run
tell application "OmniFocus"
tell front document window of default document
set lstID to id of selected trees of content where class of value = task or class of value = inbox task
if length of lstID < 1 then return
set strTaskID to first item of lstID
end tell
end tell
AttachmentList(strTaskID)
end run
on AttachmentList(strTaskID)
set strCMD to "sqlite3 ~/Library/Caches/com.omnigroup.OmniFocus/OmniFocusDatabase2 'select name from Attachment where task=\"" & strTaskID & "\"'"
paragraphs of (do shell script strCMD)
end AttachmentList