Task Linked Files

A task Linked File is a file reference in URL format for a file that is linked to a task. Omni Automation in OmniFocus (v3.8+) provides the ability to add and remove file links to/from tasks.

File links are often used in place of task attachments in order to minimize the size of the data added to the OmniFocus database. The inclusion of large files in a synced OmniFocus database can compromise performance across devices.

Task Linked File Properties

There is one property regarding Linked Files for the Task class:

Task Linked Files Functions

The functions of the Task class dealing with the management of attachments.

Adding File Links

Task File Links are instances of the URL class with each instance representing a file.

The following example plug-in demonstrates how create File Link instances from chosen files and add them to a selected task.

Deleting File Links

Should you wish to remove file links from their assigned task, Omni Automation provides two mechanisms for deleting existing file links:

var tasks = document.windows[0].selection.tasks tasks.forEach(task =>{ var urls = task.linkedFileURLs console.log(urls) urls.forEach(url => { task.removeLinkedFileWithURL(url) }) })