Skip to content

Commit 67d3cba

Browse files
add multiclipboard
1 parent d906b41 commit 67d3cba

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

automation/multiclipboard.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#! usr/bin/python3
2+
# mcb.pyw - Saves and loads pieces of text to the clipboard.
3+
# Usage: py.exe mcb.pyw save <keyword> - Saves clipboard to keyword.
4+
# py.exe mcb.pyw <keyword> - Loads keyword to clipboard.
5+
# py.exe mcb.pyw list - Loads all keywords to clipboard.
6+
7+
import shelve, pyperclip, sys
8+
9+
mcbShelf = shelve.open('mcb')
10+
11+
#TODO: Save clipboard content
12+
if len(sys.argv) == 3 and sys.argv[1].lower() == 'save':
13+
mcbShelf[sys.argv[2]] = pyperclip.paste()
14+
15+
elif len(sys.argv) == 2:
16+
#TODO: List keywords and load content
17+
if mcbShelf[sys.argv[1]] == 'list':
18+
pyperclip.copy(str(list(mcbShelf.keys())))
19+
elif sys.argv[1] in mcbShelf:
20+
pyperclip.copy(mcbShelf[sys.argv[1]])
21+
22+
mcbShelf.close()

0 commit comments

Comments
 (0)