pasteboard¶
Item Provider¶
An Item Provider is an object holding data that can be loaded as multiple file types.
It can be returned from item_provider() or from shortcuts_attachments().
When you copy text for example, it may have formatting. So an ItemProvider object can in this case retrieve the clipboard as plain text or as an rtf file containing the text format.
A bridge to Foundation's |
|
Returns the file path if the item is a file. |
|
Returns a list of type identifiers (UTI) that can be loaded. |
|
Returns the name of the file from which the receiver was created or |
|
Returns the data for the given type identifier as bytes. |
|
Opens the receiver as a file in |
|
Returns an |
|
If the script is running from Shortcuts, returns a list of files passed to the |
Strings¶
Functions for working with strings.
Returns the text contained in the pasteboard. |
|
Returns all strings contained in the pasteboard. |
|
Copies the given text to the pasteboard. |
Images¶
Functions for working with images (as PIL images).
Returns the image contained in the pasteboard as PIL images. |
|
Returns all images contained in the pasteboard as PIL images. |
|
Copies the given image to the pasteboard. |
URLs¶
Functions for working with URLs.
Returns the URL contained in the pasteboard as a string. |
|
Returns all URLs contained in the pasteboard as strings. |
|
Copies the given URL to the pasteboard. |