Quote:
Originally Posted by Lutin
Is there a way to access the list of attachments?
|
Hmmm... note to myself: always check for an update to OmniFocus before a feature request: it might already be there.
This function will do what I asked for:
Code:
-- Return a list of path of the files linked or enclosed in the note of the task
on getPathOfFilesAttached(aTask)
tell front document of application "OmniFocus"
tell note of aTask
set NumberOfFileAttached to number of file attachment
set i to 1
set ListOfPaths to {}
repeat while i ≤ NumberOfFileAttached
set end of ListOfPaths to file name of file attachment i as string
set i to i + 1
end repeat
end tell
end tell
return ListOfPaths as list
end getPathOfFilesAttached