Skip to content

Send Text

Due to iOS privacy restrictions, you need to work with Shortcuts to send arbitrary text to the device.

  1. Install and bind the official Shortcut on the target device. See Shortcut APIs.
  2. Call execShortcut to write the desired text into the device clipboard.
  3. Trigger sendKey with COMMAND + V to insert the clipboard content into the focused input field.

Example

javascript
// 1. Write text into the clipboard via Shortcut
await apiInvoke('execShortcut', {
    deviceId: 'P72578581E07',
    name: 'writeClipboard',
    args: {
        text: 'Hello iClick! 😄'
    }
});

// 2. Paste the text with COMMAND + V
await apiInvoke('sendKey', {
    deviceId: 'P72578581E07',
    key: 'V',
    fnkey: 'COMMAND'
});

Cooperation: try.catch@foxmail.com