|
|
#1 |
|
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1
Karma: 6666
Join Date: Oct 2012
Device: Kindle3 3Ggb
|
Copy & Paste
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. Installation 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.) Usage 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: paste2doc.sh foo 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: startcopy.sh 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 or, paste2doc.sh -n -m foo Practical Usage Set up launchpad commands for pasting into your favourite documents (todo list, shopping list, whatever). Source Code paste2doc.sh (Unix line endings): Code:
#!/bin/sh if [ "$1" == '-n' ] ; then PASTE_DIR=/mnt/us/developer/KindleNote/work shift else PASTE_DIR=/mnt/us/documents fi 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=$((BEGIN_LINE+5)) shift else BEGIN_LINE=`grep -n <'/mnt/us/documents/My Clippings.txt' '^==========' | tail -n 2 | head -n 1 | cut -d: -f1` BEGIN_LINE=$((BEGIN_LINE+1)) if [ "$1" == '-o' ] ; then CITATION=no shift fi fi if [ "$1" == '-n' ] ; then PASTE_DIR=/mnt/us/developer/KindleNote/work shift fi if [ "$1" == '' ] ; then echo >&2 "Usage $0 [-n] [-m|-o] memoname" exit 1 fi if [ "$PASTE_DIR" == '/mnt/us/documents' -a ! -e "/mnt/us/documents/$1.txt" ] ; then REFRESH=yes fi if [ "$CITATION" == 'no' ] ; then BEGIN_LINE=$((BEGIN_LINE+3)) tail '/mnt/us/documents/My Clippings.txt' -n +$BEGIN_LINE | grep -v '^==========' >>"$PASTE_DIR/$1.txt" else tail '/mnt/us/documents/My Clippings.txt' -n +$BEGIN_LINE >>"$PASTE_DIR/$1.txt" fi if [ "$REFRESH" == 'yes' ] ; then dbus-send --system /default com.lab126.powerd.resuming int32:1 fi Code:
#!/bin/sh cat >>'/mnt/us/documents/My Clippings.txt' `dirname $0`/startcopy.txt Code:
___BEGIN_COPY_AND_PASTE___ - Bookmark Loc. 1 | Added on Monday, November 19, 2007, 07:30 AM ==========
|
|
|
|
|
|
#2 |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,122
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan |
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 124
Karma: 178472
Join Date: Jul 2012
Device: Kindle 4
|
welcome
thanks for sharing!
|
|
|
|
|
|
#4 |
|
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,143
Karma: 5328985
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI|K4|K3-3G|DXG|Ematic E6+E8|Rooted Nook Touch|NO K2!!
|
top banana
would be a good idea with the unix filesystem and all.
a real pain accessing files with spaces in, in the main. other than that. top banana Elizabeth I personally Use Cntrl + C , Cntrl + v via vnc which works surprisingly in the main. Obviously that does not work for all cases : ) Appreciate you sharing your source.
__________________
Audiophile and electron bully. My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him. The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set |
|
|
|
|
|
#5 |
|
Horse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,019
Karma: 7087247
Join Date: Apr 2012
Device: Kindle3G+WiFi
|
Thanks! +3000 Karma for you!
__________________
meh. signatures. |
|
|
|
|
|
#6 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 62
Karma: 532034
Join Date: Sep 2012
Location: 75081
Device: Kindle 3
|
|
|
|
|
|
|
#7 |
|
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,143
Karma: 5328985
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI|K4|K3-3G|DXG|Ematic E6+E8|Rooted Nook Touch|NO K2!!
|
yep. TAB is your friend.
__________________
Audiophile and electron bully. My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him. The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set |
|
|
|
|
|
#8 | |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,122
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
Quote:
Any character, except the one having a byte value representation of 0 (zero) may be used, but (mis-)using the input field separator characters (space, tab, new-line) is consider at the very least "bad form". The (mis-)using of characters that are assigned a special purpose in any language, natural or other, in the place of the general purpose characters should only be done when no alternative is available.
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan Last edited by knc1; 10-08-2012 at 08:02 AM. |
|
|
|
|
|
|
#9 |
|
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,143
Karma: 5328985
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI|K4|K3-3G|DXG|Ematic E6+E8|Rooted Nook Touch|NO K2!!
|
spaces are bad. m'kay???
__________________
Audiophile and electron bully. My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him. The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set |
|
|
|
|
|
#10 |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,122
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan |
|
|
|
|
|
#11 |
|
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,143
Karma: 5328985
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI|K4|K3-3G|DXG|Ematic E6+E8|Rooted Nook Touch|NO K2!!
|
This took far too long to do... (I suck at unix image tools)
but I meant... enc... ![]() (I'm particularly proud of the terrible text overlay, shameful!)
__________________
Audiophile and electron bully. My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him. The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set Last edited by twobob; 10-08-2012 at 08:37 AM. Reason: the shame |
|
|
|
|
|
#12 |
|
Horse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,019
Karma: 7087247
Join Date: Apr 2012
Device: Kindle3G+WiFi
|
Hahaha I love it! (its better than anything I could ever do, i have no artistic talent.)
|
|
|
|
|
|
#13 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 62
Karma: 532034
Join Date: Sep 2012
Location: 75081
Device: Kindle 3
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Copy and Paste | JDavid | Sigil | 4 | 08-23-2012 04:02 PM |
| Copy Paste | giosa | Sony Reader Dev Corner | 0 | 03-24-2012 06:17 PM |
| iBooks: No Support for Selection & Copy/Paste Operations of SVG Texts on EPUB | reuben | ePub | 2 | 09-22-2010 08:06 AM |
| Copy and Paste | Gunnerp245 | enTourage eDGe | 1 | 04-03-2010 02:45 PM |