Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Example-Scripts/Clipboard.bdl/clipboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from zxtouch.client import zxtouch
from zxtouch.toasttypes import *
import time

# from keyboard-test.py
device = zxtouch("127.0.0.1")
device.show_toast(TOAST_MESSAGE, "Opening Notes...", 2)
time.sleep(2)
device.show_toast(TOAST_MESSAGE, "Please select an input field! 3...", 1)
time.sleep(1)

device.show_toast(TOAST_MESSAGE, "Please select an input field! 2...", 1)
time.sleep(1)

device.show_toast(TOAST_MESSAGE, "Please select an input field! 1...", 1)
time.sleep(1)

# clipboard test
clipboard = "Clipboard Test"
device.set_clipboard_text(clipboard)
device.show_toast(TOAST_SUCCESS, "Copied {} to your clipboard!".format(clipboard), 2)
time.sleep(2)

device.show_toast(TOAST_MESSAGE, "Pasting clipboard...", 2)
device.paste_from_clipboard()
time.sleep(2)

clipboard = "Hello"
device.set_clipboard_text(clipboard)
device.show_toast(TOAST_SUCCESS, "Copied {} to your clipboard!".format(clipboard), 2)
time.sleep(2)

current_clipboard = device.get_text_from_clipboard()
device.show_toast(TOAST_MESSAGE, "Your clipboard content is: {}".format(current_clipboard), 2)
time.sleep(2)

device.disconnect()
12 changes: 12 additions & 0 deletions Example-Scripts/Clipboard.bdl/info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Entry</key>
<string>clipboard.py</string>
<key>FrontApp</key>
<string>com.apple.mobilenotes</string>
<key>Orientation</key>
<string>1</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
KEYBOARD_INSERT_TEXT = 1
KEYBOARD_VIRTUAL_KEYBOARD = 2
KEYBOARD_MOVE_CURSOR = 3
KEYBOARD_DELETE_CHARACTERS = 4
KEYBOARD_DELETE_CHARACTERS = 4
KEYBOARD_PASTE_FROM_CLIPBOARD = 5
KEYBOARD_GET_TEXT_FROM_CLIPBOARD = 6
KEYBOARD_SAVE_TEXT_TO_CLIPBOARD = 7