I've been lurking around on this forum for about a month now, trying out various hacks and having a good deal of fun pimping my Kindle 3. So I thought it was about time I developed some ideas of my own and posted them. Copy and Paste functionality is something that I often wish the Kindle had so I decided to have an initial stab at putting something together this afternoon. It can no doubt be improved but I think it's usable enough to be worthwhile sharing what I have so far.
Copy and paste the texts below into a text editor and save them somewhere on the Kindle. In my examples I'll assume that you put them somewhere on the system path and chmoded the two shell scripts to make them executable (if necessary). (I have /mnt/us/system on my path and put my shell scripts in there.)
Copying and Pasting One Piece of Text at a Time
To copy a single piece of text:
Use the Kindle's highlighting feature to highlight the text that you wish to copy. The last highlight or bookmark created is the text in the "clipboard".
To append the contents of the "clipboard" onto a file (pre-existing or not) called foo.txt in the Kindle's documents directory type the following in a terminal window:
To paste just the highlighted text without the citation information:
paste2doc.sh -o foo
To paste the contents of the "clipboard" into a KindleNote document called foo:
paste2doc.sh -n foo
Batch Copying and Pasting
To begin copying a batch of items at once, run:
and then highlight all the pieces of text that you want to copy.
To paste all of the items in the batch at once:
paste2doc.sh -m foo
paste2doc.sh -n -m foo
Set up launchpad commands for pasting into your favourite documents (todo list, shopping list, whatever).
paste2doc.sh (Unix line endings):
startcopy.sh (Unix line endings):
if [ "$1" == '-n' ] ; then
if [ "$1" == '-m' ] ; then
BEGIN_LINE=`grep -n <'/mnt/us/documents/My Clippings.txt' '^___BEGIN_COPY_AND_PASTE___' | tail -n 1 | cut -d: -f1`
BEGIN_LINE=`grep -n <'/mnt/us/documents/My Clippings.txt' '^==========' | tail -n 2 | head -n 1 | cut -d: -f1`
if [ "$1" == '-o' ] ; then
if [ "$1" == '-n' ] ; then
if [ "$1" == '' ] ; then
echo >&2 "Usage $0 [-n] [-m|-o] memoname"
if [ "$PASTE_DIR" == '/mnt/us/documents' -a ! -e "/mnt/us/documents/$1.txt" ] ; then
if [ "$CITATION" == 'no' ] ; then
tail '/mnt/us/documents/My Clippings.txt' -n +$BEGIN_LINE | grep -v '^==========' >>"$PASTE_DIR/$1.txt"
tail '/mnt/us/documents/My Clippings.txt' -n +$BEGIN_LINE >>"$PASTE_DIR/$1.txt"
if [ "$REFRESH" == 'yes' ] ; then
dbus-send --system /default com.lab126.powerd.resuming int32:1
startcopy.txt (Windows line endings):
cat >>'/mnt/us/documents/My Clippings.txt' `dirname $0`/startcopy.txt
Possible Future Extensions - Ideas
- Bookmark Loc. 1 | Added on Monday, November 19, 2007, 07:30 AM
- Add an option to handle pasting into HTML files (including formatting URLS as links).
- Implement an alternative method of pasting by simulating keypresses? (I want to be able to paste into the Kindle's browser.)
- Write a Java program to enable "copying" from the browser's bookmarks file?