Data

A generic bag of bytes. Mainly useful to be interpreted / converted to some other type.

Instance Properties

Instance Functions

Class Functions

Examples

Here’s an Omni Automation script for creating a new task in OmniFocus with the current OmniOutliner document as an attachment. The script uses the integrated URL support in OmniFocus to create and run a URL link for creating tasks.

In this example, the processed data object is the extracted value of the contents property of the created FileWrapper instance (line 4).

wrapper = document.fileWrapper() taskName = encodeURIComponent(document.name) attachmentName = encodeURIComponent(wrapper.preferredFilename) encodedData = wrapper.contents.toBase64() urlStr = "omnifocus://localhost/add?name=" + taskName + "&attachment=" + encodedData + "&attachment-name=" + attachmentName URL.fromString(urlStr).call(function(result){})
omnioutliner://localhost/omnijs-run?script=wrapper%20%3D%20document%2EfileWrapper%28%29%0AtaskName%20%3D%20encodeURIComponent%28document%2Ename%29%0AattachmentName%20%3D%20encodeURIComponent%28wrapper%2EpreferredFilename%29%0AencodedData%20%3D%20wrapper%2Econtents%2EtoBase64%28%29%0AurlStr%20%3D%20%22omnifocus%3A%2F%2Flocalhost%2Fadd%3Fname%3D%22%20%2B%20taskName%20%2B%20%22%26attachment%3D%22%20%2B%20encodedData%20%2B%20%22%26attachment-name%3D%22%20%2B%20attachmentName%0AURL%2EfromString%28urlStr%29%2Ecall%28function%28result%29%7B%7D%29
UNDER CONSTRUCTION

This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.

DISCLAIMER