dfay Posted February 27, 2015 Share Posted February 27, 2015 (edited) 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) Download it here: https://www.dropbox.com/s/s63yvkzzxw3or5b/Paste%20text%20from%20Kindle%20for%20Mac%20without%20full%20citation.alfredworkflow?dl=0 As always, you'll need to set the hotkey. updated 2019-06-02 to work with Kindle 1.26.1 Edited June 3, 2019 by dfay Link to comment
ptmkenny Posted June 2, 2019 Share Posted June 2, 2019 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
dfay Posted June 3, 2019 Author Share Posted June 3, 2019 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
mikes Posted June 30, 2019 Share Posted June 30, 2019 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. Link to comment
dfay Posted June 30, 2019 Author Share Posted June 30, 2019 You need to set the hotkey to trigger it yourself - Alfred strips custom hotkeys on import to avoid creating conflicts. Link to comment
bevankay Posted October 8, 2019 Share Posted October 8, 2019 (edited) 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 October 8, 2019 by bevankay Link to comment
joshuawilliam Posted November 28, 2020 Share Posted November 28, 2020 @dfay I'm no programmer. what do I do to get this script into kindle usage? Where do I paste it? Into what location? How do I update the script so it works with the latest update? Thank you kindly. Link to comment
dfay Posted November 29, 2020 Author Share Posted November 29, 2020 lf you have the Alfred power pack, you can download the workflow above - then you’ll need to set the keystroke to trigger it. See https://www.alfredapp.com/help/workflows/triggers/hotkey/ Link to comment
sharfaroz Posted June 9, 2021 Share Posted June 9, 2021 These scripts dont work for me. Using big sur on m1 Mac. Does anyone know of a maestro or automator script that works? Link to comment
dfay Posted June 9, 2021 Author Share Posted June 9, 2021 Amazon seems to keep changing the output format, and it's inconsistent depending on the book, unfortunately. What errors do you get? Link to comment
tamaino Posted January 16 Share Posted January 16 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
tamaino Posted January 16 Share Posted January 16 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now