Inspect/manipulate pasteboards (more commonly called clipboards). Both the system default pasteboard and custom named pasteboards can be interacted with.
This module is based partially on code from the previous incarnation of Mjolnir by Steven Degutis.
Signature | hs.pasteboard.allContentTypes([name]) -> table |
---|---|
Type | Function |
Description | An array whose elements are a table containing the content types for each element on the clipboard. |
Parameters |
|
Returns |
|
Source | extensions/pasteboard/libpasteboard.m line 256 |
Signature | hs.pasteboard.callbackWhenChanged([name], [timeout], callback) -> None |
---|---|
Type | Function |
Description | Invokes callback when the specified pasteboard has changed or the timeout is reached. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/pasteboard.lua line 64 |
Signature | hs.pasteboard.changeCount([name]) -> number |
---|---|
Type | Function |
Description | Gets the number of times the pasteboard owner has changed |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 209 |
Signature | hs.pasteboard.clearContents([name]) |
---|---|
Type | Function |
Description | Clear the contents of the pasteboard |
Parameters |
|
Returns |
|
Source | extensions/pasteboard/libpasteboard.m line 149 |
Signature | hs.pasteboard.contentTypes([name]) -> table |
---|---|
Type | Function |
Description | Return the UTI strings of the data types for the first pasteboard item on the specified pasteboard. |
Parameters |
|
Returns |
|
Source | extensions/pasteboard/libpasteboard.m line 185 |
Signature | hs.pasteboard.deletePasteboard(name) |
---|---|
Type | Function |
Description | Deletes a custom pasteboard |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 226 |
Signature | hs.pasteboard.getContents([name]) -> string or nil |
---|---|
Type | Function |
Description | Gets the contents of the pasteboard |
Parameters |
|
Returns |
|
Source | extensions/pasteboard/libpasteboard.m line 56 |
Signature | hs.pasteboard.pasteboardTypes([name]) -> table |
---|---|
Type | Function |
Description | Return the pasteboard type identifier strings for the specified pasteboard. |
Parameters |
|
Returns |
|
Source | extensions/pasteboard/libpasteboard.m line 165 |
Signature | hs.pasteboard.readAllData([name]) -> table |
---|---|
Type | Function |
Description | Returns all values in the first item on the pasteboard in a table that maps a UTI value to the raw data of the item |
Parameters |
|
Returns | a mapping from a UTI value to the raw data |
Source | extensions/pasteboard/pasteboard.lua line 21 |
Signature | hs.pasteboard.readArchiverDataForUTI([name], uti) -> any |
---|---|
Type | Function |
Description | Returns the first item on the pasteboard with the specified UTI. The data on the pasteboard must be encoded as a keyed archive object conforming to NSKeyedArchiver. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 413 |
Signature | hs.pasteboard.readColor([name], [all]) -> hs.drawing.color table or array of hs.drawing.color tables |
---|---|
Type | Function |
Description | Returns one or more |
Parameters |
|
Returns |
|
Source | extensions/pasteboard/libpasteboard.m line 820 |
Signature | hs.pasteboard.readDataForUTI([name], uti) -> string |
---|---|
Type | Function |
Description | Returns the first item on the pasteboard with the specified UTI as raw data |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 331 |
Signature | hs.pasteboard.readImage([name], [all]) -> hs.image object or array of hs.image objects |
---|---|
Type | Function |
Description | Returns one or more |
Parameters |
|
Returns |
|
Source | extensions/pasteboard/libpasteboard.m line 732 |
Signature | hs.pasteboard.readPListForUTI([name], uti) -> any |
---|---|
Type | Function |
Description | Returns the first item on the pasteboard with the specified UTI as a property list item |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 371 |
Signature | hs.pasteboard.readSound([name], [all]) -> hs.sound object or array of hs.sound objects |
---|---|
Type | Function |
Description | Returns one or more |
Parameters |
|
Returns |
|
Source | extensions/pasteboard/libpasteboard.m line 688 |
Signature | hs.pasteboard.readString([name], [all]) -> string or array of strings |
---|---|
Type | Function |
Description | Returns one or more strings from the clipboard, or nil if no compatible objects are present. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 284 |
Signature | hs.pasteboard.readStyledText([name], [all]) -> hs.styledtext object or array of hs.styledtext objects |
---|---|
Type | Function |
Description | Returns one or more |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 641 |
Signature | hs.pasteboard.readURL([name], [all]) -> string or array of strings representing file or resource urls |
---|---|
Type | Function |
Description | Returns one or more strings representing file or resource urls from the clipboard, or nil if no compatible objects are present. |
Parameters |
|
Returns |
|
Source | extensions/pasteboard/libpasteboard.m line 776 |
Signature | hs.pasteboard.setContents(contents[, name]) -> boolean |
---|---|
Type | Function |
Description | Sets the contents of the pasteboard |
Parameters |
|
Returns |
|
Source | extensions/pasteboard/libpasteboard.m line 91 |
Signature | hs.pasteboard.typesAvailable([name]) -> table |
---|---|
Type | Function |
Description | Returns a table indicating what content types are available on the pasteboard. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 974 |
Signature | hs.pasteboard.uniquePasteboard() -> string |
---|---|
Type | Function |
Description | Returns the name of a new pasteboard with a name that is guaranteed to be unique with respect to other pasteboards on the computer. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 955 |
Signature | hs.pasteboard.writeAllData([name], table) -> boolean |
---|---|
Type | Function |
Description | Stores in the pasteboard a given table of UTI to data mapping all at once |
Parameters |
|
Returns |
|
Source | extensions/pasteboard/pasteboard.lua line 38 |
Signature | hs.pasteboard.writeArchiverDataForUTI([name], uti, data, [add]) -> boolean |
---|---|
Type | Function |
Description | Sets the pasteboard to the contents of the data and assigns its type to the specified UTI. The data will be encoded as an archive conforming to NSKeyedArchiver. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 458 |
Signature | hs.pasteboard.writeDataForUTI([name], uti, data, [add]) -> boolean |
---|---|
Type | Function |
Description | Sets the pasteboard to the contents of the data and assigns its type to the specified UTI. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 521 |
Signature | hs.pasteboard.writeObjects(object, [name]) -> boolean |
---|---|
Type | Function |
Description | Sets the pasteboard contents to the object or objects specified. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 895 |
Signature | hs.pasteboard.writePListForUTI([name], uti, data, [add]) -> boolean |
---|---|
Type | Function |
Description | Sets the pasteboard to the contents of the data and assigns its type to the specified UTI. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pasteboard/libpasteboard.m line 580 |