Jump to content

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
Link to comment
  • 4 years later...

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.

Link to comment

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. 

Link to comment
  • 4 weeks later...
  • 3 months later...

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
Link to comment
  • 1 year later...
  • 6 months later...
  • 2 years later...

I've downloaded the scripts and added a custom hotkey to them. However, after I triggered my hotkey, copied text from kindle and pasted it to another place, the citation still exist. Does anyone know if the scripts still work for the current version of Kindle? Thank you very much.

Link to comment
5 minutes ago, tamaino said:

I've downloaded the scripts and added a custom hotkey to them. However, after I triggered my hotkey, copied text from kindle and pasted it to another place, the citation still exist. Does anyone know if the scripts still work for the current version of Kindle? Thank you very much.

Quote
[02:09:50.472] Paste text from Kindle for Mac without full citation[Hotkey] Processing complete
[02:09:50.480] Paste text from Kindle for Mac without full citation[Hotkey] Passing output 'Some forces are coming from outside individual countries and the region. We call this level of analysis systemic or external.

Nau, Henry R.. Perspectives on International Relations: Power, Institutions, and Ideas (pp. 3-4). SAGE Publications. Kindle 版本. ' to Run NSAppleScript
[02:09:50.482] ERROR: Paste text from Kindle for Mac without full citation[Run NSAppleScript] {
    NSAppleScriptErrorBriefMessage = "item 3 of {\"Some forces are coming from outside individual countries and the region. We call this level of analysis systemic or external.\n\nNau, Henry R.. Perspectives on International Relations: Power, Institutions, and Ideas (pp. 3-4\", \". SAGE Publications. Kindle \U7248\U672c. \"}\U3092\U53d6\U308a\U51fa\U3059\U3053\U3068\U306f\U3067\U304d\U307e\U305b\U3093\U3002";
    NSAppleScriptErrorMessage = "item 3 of {\"Some forces are coming from outside individual countries and the region. We call this level of analysis systemic or external.\n\nNau, Henry R.. Perspectives on International Relations: Power, Institutions, and Ideas (pp. 3-4\", \". SAGE Publications. Kindle \U7248\U672c. \"}\U3092\U53d6\U308a\U51fa\U3059\U3053\U3068\U306f\U3067\U304d\U307e\U305b\U3093\U3002";
    NSAppleScriptErrorNumber = "-1728";
    NSAppleScriptErrorRange = "NSRange: {228, 6}";
}
[02:09:50.484] Paste text from Kindle for Mac without full citation[Run NSAppleScript] Processing complete
[02:09:50.484] Paste text from Kindle for Mac without full citation[Run NSAppleScript] Passing output '' to Copy to Clipboard

This is what the error says.

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...