clip_manager


CloudControl Pro 9 Docs / clip_manager

clip_manager

Clipboard module, used to get and set clipboard content. In Android 10 or higher, unless the app has focus, the app cannot access clipboard data.

See

Limited access to clipboard dataopen in new window

Table of contents

Interfaces

Variables

Functions

Variables

clipboardManager

Const clipboardManager: ClipboardManager

Clipboard manager. Used to get, set, and listen to clipboard content.

See

ClipboardManager

Example

const { clipboardManager, getClip } = require('clip_manager');
clipboardManager.on("clip_changed", () => {
  console.log("clipboard changed:", getClip());
});
$autojs.keepRunning();

Functions

clearClip

clearClip(): void

Clear clipboard content.

Example

"nodejs";
const { clearClip } = require('clip_manager');
clearClip();

Returns

void


getClip

getClip(): string | null

Get clipboard content.

Example

"nodejs";
const { getClip } = require('clip_manager');
console.log(getClip());

Returns

string | null

Text content


hasClip

hasClip(): boolean

Determine if clipboard has content.

Example

"nodejs";
const { hasClip } = require('clip_manager');
console.log(hasClip());

Returns

boolean

If there is content, return true, otherwise return false.


setClip

setClip(text): void

Set clipboard content.

Example

"nodejs";
const { setClip } = require('clip_manager');
setClip('Hello World!');

Parameters

Name Type Description
text string Text content

Returns

void