Skip to main content

Read data from pasteboard (pasteboard.read)

Declaration​

data = pasteboard.read([ uti ])

Parameters​

  • uti
    String, optional. Uniform Type Identifiers. Default: auto-detect content type.
    When provided, forces reading with the specified UTI. If the pasteboard content cannot be read as that UTI, returns an empty string.

Returns​

  • data
    String. The pasteboard content. May be text or binary data. Returns "" (empty string) if it cannot be read as requested.

Description​

Read content from the system pasteboard.

Example​

sys.alert("Pasteboard content: "..pasteboard.read())
--
sys.alert("Pasteboard content: "..pasteboard.read('public.text')) -- Force read as plain text even if RTF

Note: Uses sys.alert