Jump to content
dfay

Paste text from Kindle for Mac without full citation

Recommended Posts

The Kindle for Mac program allows you to copy text from most Kindle books, but it automatically adds the full citation info. to the clipboard.  For example, if you copy this sentence:

 

"I was never part of their awareness in the first place."

 
You'll get
 
"I was never part of their awareness in the first place.
 
Nagle, Robin (2013-03-19). Picking Up: On the Streets and Behind the Trucks with the Sanitation Workers of New York City (p. 16). Farrar, Straus and Giroux. Kindle Edition."
 
on your clipboard.
 
This workflow consists of a hotkey trigger and a short Applescript which cleans the clipboard so that it just consists of the copied passage and the page number, in parentheses.  So for the example above, the output would be:
 
'I was never part of their awareness in the first place.' (16)
 
 
As always, you'll need to set the hotkey.
 
updated 2019-06-02 to work with Kindle 1.26.1
Edited by dfay

Share this post


Link to post

Thanks for this script, but it seems like it no longer works for the latest version of Kindle on Mac (1.26.1)... I imagine something may have changed in the last four years.

 

If someone has an updated script, it would be much appreciated.

Share this post


Link to post

Change the Run NSAppleScript content to

 

on alfred_script(q)
	set quote to first paragraph of q
    set otd to AppleScript's text item delimiters
	set AppleScript's text item delimiters to {"(Kindle Locations ", ")"}
	set bits to every text item of q
	set pageNumber to item 3 of bits
	set quote to first paragraph of q
	return quoted form of quote & " (" & pageNumber & ")"
    set AppleScript's text item delimiters to otd
end alfred_script

That fixed it for me. 

Share this post


Link to post

I am new to custom workflows, but I cannot tell for the life of me what the trigger actually is? I don't actually seem to get how it functions. The script itself is straightforward. 

 

Share this post


Link to post

For this to work for me I had to modify the script as follows;

The only downside is if there are brackets in the book, it won't bring the page number in correctly.

 

on alfred_script(q)
	set quote to first paragraph of q
    set otd to AppleScript's text item delimiters
	set AppleScript's text item delimiters to {"(",")"}
	set bits to every text item of q
	set pageNumber to item 2 of bits
	set quote to first paragraph of q
	return quoted form of quote & " (" & pageNumber & ")"
    set AppleScript's text item delimiters to otd
end alfred_script

 

Edited by bevankay

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...