10-27-2023, 09:33 AM | #46 |
Junior Member
Posts: 4
Karma: 10
Join Date: Jan 2020
Device: oboox notepro 10.3
|
is it possible some how to use this plugin to send all my library data to obsidian?
(even if no highlights) |
10-31-2023, 05:51 PM | #47 | |
Enthusiast
Posts: 25
Karma: 10
Join Date: Jan 2023
Device: calibre
|
Quote:
It could be modified to send data from books instead of from highlights by giving highlight_sender.HighlightSender a list of books or the entire library instead of a list of annotations. But you would have to make a lot of other changes to make that work. And you would lose the highlight-specific formatting options. If you want to try modifying the plugin, these two functions might be good places to start: The function that manages the highlight sending process: highlight_sender.HighlightSender.send() https://github.com/jm289765/highligh...r.py#L703-L727 A helper function that all the "Send Highlights" buttons use for setting up a HighlightSender and sending highlights: https://github.com/jm289765/highligh...actions.py#L27 |
|
Advert | |
|
12-04-2023, 09:09 AM | #48 |
Member
Posts: 10
Karma: 10
Join Date: Sep 2023
Device: Kobo Clara HD
|
Whenever I send highlights, instead of opening Obsidian, it opens Firefox which then asks me if I want to open Obsidian.
I have the mime-types correctly setup since I can use the obsidian:// scheme from other programs and the command line and then it does correctly open obsidian directly. |
12-05-2023, 12:16 PM | #49 | |
Enthusiast
Posts: 25
Karma: 10
Join Date: Jan 2023
Device: calibre
|
Quote:
You might be able to change Firefox's settings to open obsidian links automatically instead of asking. You could also try manually modifying H2O to use os.system() instead of webbrowser.open(). |
|
12-06-2023, 06:04 AM | #50 | |
Member
Posts: 10
Karma: 10
Join Date: Sep 2023
Device: Kobo Clara HD
|
Quote:
I will try to change H2O next weekend and let you know if that solves it for me. |
|
Advert | |
|
12-06-2023, 06:49 AM | #51 |
Member
Posts: 10
Karma: 10
Join Date: Sep 2023
Device: Kobo Clara HD
|
I decided to try it now as I had a bit of time. I made the following change:
Code:
#webbrowser.open(uri) os.system("xdg-open \"" + uri + "\"") This works like a charm now. Perhaps add an option that enables people to set the used method? I could see if I can do it and send you a pull request? (when i have the time, which might be next year, ) |
12-07-2023, 11:51 AM | #52 | |
Enthusiast
Posts: 25
Karma: 10
Join Date: Jan 2023
Device: calibre
|
Quote:
I replaced os.system() with subprocess.run() because it has better error handling, so I need you to test this to make sure it still works for you. Then I'll update H2O to 1.4.1. |
|
12-11-2023, 04:49 AM | #53 |
Member
Posts: 10
Karma: 10
Join Date: Sep 2023
Device: Kobo Clara HD
|
I am sorry for the late reply, I wasn't at home this weekend.
I am getting the following error with this one: Code:
calibre, version 7.1.0 ERROR: Unhandled exception: <b>CalledProcessError</b>:Command '['xdg-open', 'obsidian://new?vault=My%20Vault&file=Books%2FBehold%20the%20Man%20by%20Michael%20Moorcock&content=%0A%5BHighlighted%5D%28calibre%3A%2F%2Fview-book%2FCalibre-Library%2F111%2FEPUB%3Fopen_at%3Depubcfi%28%2F10%2F2%2F4%2F8%2F1%3A0%29%29%20on%202023-12-11%20at%2009%3A44%3A38%20UTC%3A%0A%3E%20Michael%20Moorcock%20is%20a%20wondrous%20man%2C%20twice%20the%20size%20of%20any%20of%20us%2C%20with%20a%20beard%20like%20Father%20Time%20and%20the%20ability%20to%20practically%20kill%20himself%20for%20that%20which%20he%20loves%20and%0A%0A---%0A&append=true']' returned non-zero exit status 1. calibre 7.1 embedded-python: True Linux-6.6.5-arch1-1-x86_64-with-glibc2.38 Linux ('64bit', 'ELF') ('Linux', '6.6.5-arch1-1', '#1 SMP PREEMPT_DYNAMIC Fri, 08 Dec 2023 17:06:25 +0000') Python 3.11.5 Interface language: None Successfully initialized third party plugins: Highlights to Obsidian (1, 4, 1) && Kobo Utilities (2, 16, 11) Traceback (most recent call last): File "calibre_plugins.highlights_to_obsidian.menu_button", line 87, in resend b_acts.resend_highlights(self.gui, self.gui.current_db.new_api) File "calibre_plugins.highlights_to_obsidian.button_actions", line 224, in resend_highlights send_highlights(parent, db, condition=highlight_send_condition, update_send_time=False) File "calibre_plugins.highlights_to_obsidian.button_actions", line 66, in send_highlights amt = sender.send(condition=condition) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "calibre_plugins.highlights_to_obsidian.highlight_sender", line 730, in send send_item_to_obsidian(self.make_obsidian_data(note[0], note[1])) File "calibre_plugins.highlights_to_obsidian.highlight_sender", line 30, in send_item_to_obsidian subprocess.run(['xdg-open', uri], check=True, shell=True) File "subprocess.py", line 571, in run subprocess.CalledProcessError: Command '['xdg-open', 'obsidian://new?vault=My%20Vault&file=Books%2FBehold%20the%20Man%20by%20Michael%20Moorcock&content=%0A%5BHighlighted%5D%28calibre%3A%2F%2Fview-book%2FCalibre-Library%2F111%2FEPUB%3Fopen_at%3Depubcfi%28%2F10%2F2%2F4%2F8%2F1%3A0%29%29%20on%202023-12-11%20at%2009%3A44%3A38%20UTC%3A%0A%3E%20Michael%20Moorcock%20is%20a%20wondrous%20man%2C%20twice%20the%20size%20of%20any%20of%20us%2C%20with%20a%20beard%20like%20Father%20Time%20and%20the%20ability%20to%20practically%20kill%20himself%20for%20that%20which%20he%20loves%20and%0A%0A---%0A&append=true']' returned non-zero exit status 1. |
12-11-2023, 04:53 AM | #54 |
Member
Posts: 10
Karma: 10
Join Date: Sep 2023
Device: Kobo Clara HD
|
I replied before but it somehow failed I think.
This version gives me the following error: Code:
calibre, version 7.1.0 ERROR: Unhandled exception: <b>CalledProcessError</b>:Command '['xdg-open', 'obsidian://new?vault=My%20Vault&file=Books%2FBehold%20the%20Man%20by%20Michael%20Moorcock&content=%0A%5BHighlighted%5D%28calibre%3A%2F%2Fview-book%2FCalibre-Library%2F111%2FEPUB%3Fopen_at%3Depubcfi%28%2F10%2F2%2F4%2F8%2F1%3A0%29%29%20on%202023-12-11%20at%2009%3A44%3A38%20UTC%3A%0A%3E%20Michael%20Moorcock%20is%20a%20wondrous%20man%2C%20twice%20the%20size%20of%20any%20of%20us%2C%20with%20a%20beard%20like%20Father%20Time%20and%20the%20ability%20to%20practically%20kill%20himself%20for%20that%20which%20he%20loves%20and%0A%0A---%0A&append=true']' returned non-zero exit status 1. calibre 7.1 embedded-python: True Linux-6.6.5-arch1-1-x86_64-with-glibc2.38 Linux ('64bit', 'ELF') ('Linux', '6.6.5-arch1-1', '#1 SMP PREEMPT_DYNAMIC Fri, 08 Dec 2023 17:06:25 +0000') Python 3.11.5 Interface language: None Successfully initialized third party plugins: Highlights to Obsidian (1, 4, 1) && Kobo Utilities (2, 16, 11) Traceback (most recent call last): File "calibre_plugins.highlights_to_obsidian.menu_button", line 87, in resend b_acts.resend_highlights(self.gui, self.gui.current_db.new_api) File "calibre_plugins.highlights_to_obsidian.button_actions", line 224, in resend_highlights send_highlights(parent, db, condition=highlight_send_condition, update_send_time=False) File "calibre_plugins.highlights_to_obsidian.button_actions", line 66, in send_highlights amt = sender.send(condition=condition) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "calibre_plugins.highlights_to_obsidian.highlight_sender", line 730, in send send_item_to_obsidian(self.make_obsidian_data(note[0], note[1])) File "calibre_plugins.highlights_to_obsidian.highlight_sender", line 30, in send_item_to_obsidian subprocess.run(['xdg-open', uri], check=True, shell=True) File "subprocess.py", line 571, in run subprocess.CalledProcessError: Command '['xdg-open', 'obsidian://new?vault=My%20Vault&file=Books%2FBehold%20the%20Man%20by%20Michael%20Moorcock&content=%0A%5BHighlighted%5D%28calibre%3A%2F%2Fview-book%2FCalibre-Library%2F111%2FEPUB%3Fopen_at%3Depubcfi%28%2F10%2F2%2F4%2F8%2F1%3A0%29%29%20on%202023-12-11%20at%2009%3A44%3A38%20UTC%3A%0A%3E%20Michael%20Moorcock%20is%20a%20wondrous%20man%2C%20twice%20the%20size%20of%20any%20of%20us%2C%20with%20a%20beard%20like%20Father%20Time%20and%20the%20ability%20to%20practically%20kill%20himself%20for%20that%20which%20he%20loves%20and%0A%0A---%0A&append=true']' returned non-zero exit status 1. |
12-11-2023, 04:57 AM | #55 |
Member
Posts: 10
Karma: 10
Join Date: Sep 2023
Device: Kobo Clara HD
|
For some reason my replies get deleted. (This is the 3rd time trying).
I get an error with this version. I suspect the uri needs to be enclosed in quotes. Code:
subprocess.CalledProcessError: Command '['xdg-open', 'obsidian://new?vault= ....... returned non-zero exit status 1. |
12-11-2023, 05:02 AM | #56 |
Member
Posts: 10
Karma: 10
Join Date: Sep 2023
Device: Kobo Clara HD
|
The full error message is here: https://pastebin.com/8xe7gDHm
|
12-16-2023, 09:54 AM | #57 |
Enthusiast
Posts: 25
Karma: 10
Join Date: Jan 2023
Device: calibre
|
Here's a version that uses os.system() instead of subprocess.run(). I added some conditionals to check operating system to fix the problem of bad error messages.
|
12-17-2023, 04:44 AM | #58 |
Member
Posts: 10
Karma: 10
Join Date: Sep 2023
Device: Kobo Clara HD
|
|
12-18-2023, 11:29 PM | #59 |
Junior Member
Posts: 1
Karma: 10
Join Date: Aug 2022
Device: none
|
First of all, I really appreciate your work. Thanks!
As I use different colors in the highlight section for different purposes and usages, I've named every color of Highlights with a specific name. Names such as "Dictionary", "Anki", "ZettleKasten", "Quote" and so on. So, It would be great to have an option like 'HighlightStyleName' in formatting options. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
KOReader Highlights in Obsidian | Edo78 | KOReader | 5 | 10-30-2023 09:12 PM |
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 03:15 PM |
[GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 05:25 AM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |