# Released plugin Joplin Batch

**URL:** <https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528>\
**Category:** Plugins\
**Created:** [8 August 2024 10:46 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528 "2024-08-08T10:46:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [8 August 2024 10:46 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/1 "2024-08-08T10:46:08Z")

</div>

Released Joplin plugin Joplin Batch version 0.1.0. Previously, it was a web application called [Joplin Batch Web](https://joplin-utils.rxliuli.com/en-US/joplin-batch-web/). Now it can be directly installed as a Joplin plugin for offline use. In the future, I will attempt to support mobile platforms.

Handle some batch operations that Joplin itself doesn't support, compatible with Joplin desktop/mobile versions.

- Clean up unused attachment resources
- Search and replace across all notes

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/c/1/c1c8500357284adf13b9376c3570d6a2efa54019.png)

 ![clean](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/0/1/017ccc7e96795198e561db514bbd46e4c94d90b0.png)  
 ![replace](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/2/e/2e5e6f1b6ed5ee3bfdfc1b99d581a3baacb6a7d9.png)  
 ![diff](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/6/a/6ae292357d6335dcd2c6fa5890dbcb8512348fec.png)

Download link: [Release joplin-batch@0.1.0 · rxliuli/joplin-utils · GitHub](https://github.com/rxliuli/joplin-utils/releases/tag/joplin-batch%400.1.0)

---

<div class="post-metadata">

**Author:** ![johano](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/johano/32/1053_2.png) [@johano](https://discourse.joplinapp.org/u/johano)\
**Post date:** [8 August 2024 15:03 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/2 "2024-08-08T15:03:15Z")

</div>

Great work! Thanks.

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [8 August 2024 15:17 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/3 "2024-08-08T15:17:28Z")

</div>

Release 0.2.0, Compatible with mobile devices.

[![](https://img.youtube.com/vi/xhYq69aBxOA/maxresdefault.jpg "Joplin Batch Plugin: Mobile Usage Demo") ](https://www.youtube.com/watch?v=xhYq69aBxOA)

Download link: [Release joplin-batch@0.2.0 · rxliuli/joplin-utils · GitHub](https://github.com/rxliuli/joplin-utils/releases/tag/joplin-batch%400.2.0)

---

<div class="post-metadata">

**Author:** ![kai452](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/kai452/32/22334_2.png) [@kai452](https://discourse.joplinapp.org/u/kai452)\
**Post date:** [11 August 2024 08:58 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/5 "2024-08-11T08:58:16Z")

</div>

Use with caution!  
Deletes pictures from notes in history.  
Recovering such a note will be than incomplete, pictures are gone.

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [11 August 2024 09:18 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/6 "2024-08-11T09:18:13Z")

</div>

Yes, this will clean up the images in the history, but this is where the preview images come into play. Users should be able to check through the previews whether an image should be deleted or not. in any case, a backup should be made before performing any bulk operations.

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/f/4/f43a79f27bb176197e7f98010855f86d1e14c4a6.png)

---

<div class="post-metadata">

**Author:** ![kai452](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/kai452/32/22334_2.png) [@kai452](https://discourse.joplinapp.org/u/kai452)\
**Post date:** [11 August 2024 09:31 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/7 "2024-08-11T09:31:34Z")

</div>

Thanks for Your reply.

But what is the sense?

1. not deleteting a note in history but holding it without the important part (pictures).
2. the effort needed, to go through all deletable pictures can be heavy too. At the end: For what?

---

<div class="post-metadata">

**Author:** ![Isaac](https://avatars.discourse-cdn.com/v4/letter/i/8e8cbc/32.png) [@Isaac](https://discourse.joplinapp.org/u/Isaac)\
**Post date:** [14 August 2024 07:25 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/8 "2024-08-14T07:25:18Z")

</div>

Is it possible to use regex for 'search and replace' function?

E.g. I converted from evernote to joplin and have now many notes with e.g. the following text/link in it:

`Bestellung: #[028-5659582-7620329](https://www.amazon.de/gp/r.html?C=EY07A4VFU)`

I want to remove all those # which stands in front of the links.  
E.g. search for `Bestellung: #[` and replace it with `Bestellung: [`?

Do I have to escape #[ characters in any way?

Could I fine tune this search to include some regex to check for e.g. at least 3 digits (`\d`) after the `[`?

Thanks

---

<div class="post-metadata">

**Author:** ![Rolograaf](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rolograaf/32/1675_2.png) [@Rolograaf](https://discourse.joplinapp.org/u/Rolograaf)\
**Post date:** [14 August 2024 17:37 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/9 "2024-08-14T17:37:33Z")

</div>

After some refactoring or cleanup of notes, there will be a lot of unlinked resources left. If I check on any resources without link in Joplin with this utility, I can free a lot of memory in the resources folder.

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [20 August 2024 12:04 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/10 "2024-08-20T12:04:12Z")

</div>

Release joplin-batch@0.2.2, Fixed an issue where notes without any matching items would be searched, ref: [#104](https://github.com/rxliuli/joplin-utils/issues/104)

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/a/2/a2a86f16a33072ee4f114dea92d24f2cc3cf2cd3.png)  
 ![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/8/9/898c562223286c97c89cecb53e9074240c0a8f28.png)

> **[Release joplin-plugin-joplin-batch@0.2.2 · rxliuli/joplin-utils](https://github.com/rxliuli/joplin-utils/releases/tag/joplin-plugin-joplin-batch%400.2.2)**
>
> fix: Fixed an issue where notes without any matching items would be searched, ref: #104

---

<div class="post-metadata">

**Author:** ![PEP8](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@PEP8](https://discourse.joplinapp.org/u/PEP8)\
**Post date:** [27 August 2024 08:39 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/11 "2024-08-27T08:39:54Z")

</div>

Hi, I'm using the Joplin desktop client, and installed the Joplin batch plugin.

Where in the client interface do I trigger this plugin?  
Specifically, I want to check /home/blackfrank/.config/joplin-desktop/resources/ for orphaned files... per a manual check I suspect I have approx 26k deletable orphan files (7+ GB)

* * *

Joplin 3.0.13 (prod, linux)  
Client ID: 7965d57c4ca34af58aebfa5c83dd20f5  
Sync Version: 3  
Profile Version: 47  
Keychain Supported: No  
Revision: 599cf5b  
Joplin Batch: 0.2.2  
Markdown Prettier: 0.1.0  
 ![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/c/5/c5d2c25f1194310a8b5703fff7de7c5dba24351d.png)

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [27 August 2024 08:52 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/12 "2024-08-27T08:52:17Z")

</div>

![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/e/6/e69c88513cc4c664cb8bb1ed0097d35cdad292e8.png)

---

<div class="post-metadata">

**Author:** ![PEP8](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@PEP8](https://discourse.joplinapp.org/u/PEP8)\
**Post date:** [27 August 2024 10:08 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/13 "2024-08-27T10:08:46Z")

</div>

I do not have that menu option?  
 ![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/6/4/64e6e8228b1479ba1ecc3dda083b5e214bf2facf.png)  
EDIT - I just upgraded to Joplin 3.0.15, still don't have that menu option.

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [27 August 2024 10:27 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/14 "2024-08-27T10:27:01Z")

</div>

Strange, are there any errors in DevTools?

---

<div class="post-metadata">

**Author:** ![PEP8](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@PEP8](https://discourse.joplinapp.org/u/PEP8)\
**Post date:** [28 August 2024 07:23 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/15 "2024-08-28T07:23:27Z")

</div>

I followed these instructions - [How to enable debugging | Joplin](https://joplinapp.org/help/apps/debugging/#desktop-application)

Full console history here - [joplinconsole.txt](https://discourse.joplinapp.org/uploads/short-url/2aeJsF4A7OE1aX9H2jJDEs4oJHx.txt) (41.1 KB)

Possibly relevant finding -

plugin markdown-prettier follows this 3 step load pattern -  
**step 1**  
/tmp/.mount\_JoplincMcIPY/resources/app.asar/node\_modules/@joplin/utils/dist/Logger.js:270 17:03:52: PluginService: **Loading plugin** from /home/blackfrank/.config/joplin-desktop/cache/shufo.markdown-prettier  
**step 2**  
/tmp/.mount\_JoplincMcIPY/resources/app.asar/node\_modules/@joplin/utils/dist/Logger.js:270 17:03:53: joplin.plugins: **Starting plugin** : shufo.markdown-prettier  
**step 3**  
/tmp/.mount\_JoplincMcIPY/resources/app.asar/node\_modules/@joplin/utils/dist/Logger.js:270 17:03:53: joplin.plugins: Finished running **onStart handler** : shufo.markdown-prettier (Took 226ms)

but for plugin joplin-batch I only see this 1 step load pattern -  
**step 1**  
/tmp/.mount\_JoplincMcIPY/resources/app.asar/node\_modules/@joplin/utils/dist/Logger.js:270 17:03:52: PluginService: **Loading plugin** from /home/blackfrank/.config/joplin-desktop/cache/rxliuli.joplin-batch

Should there be a step 2 and maybe step 3 as with markdown-prettier?

Nothing useful in log.txt

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [1 September 2024 14:09 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/16 "2024-09-01T14:09:51Z")

</div>

I apologize for the late reply. Currently, I'm using a Mac and haven't encountered this issue. I don't have a laptop with Linux installed, but I'll try to reproduce this error later using a virtual machine

---

<div class="post-metadata">

**Author:** ![PEP8](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@PEP8](https://discourse.joplinapp.org/u/PEP8)\
**Post date:** [1 September 2024 22:30 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/17 "2024-09-01T22:30:27Z")

</div>

No worries, let me know if there's anything else I can do.  
If it matters re yr VM setup - I use Ubuntu 22.04.4 LTS.

---

<div class="post-metadata">

**Author:** ![Eduardo](https://avatars.discourse-cdn.com/v4/letter/e/6a8cbe/32.png) [@Eduardo](https://discourse.joplinapp.org/u/Eduardo)\
**Post date:** [2 September 2024 00:01 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/18 "2024-09-02T00:01:03Z")

</div>

Sorry but it seems there is not any relate to Linux, I have the same Ubuntu 22.04.4 LTS, but I can see the menu option "Joplin Batch"  
 ![Screenshot from 2024-09-01 11-44-47](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/6/9/69d0c56b51f4983252ef45aedbbaf938384a9d40.png)

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [2 September 2024 03:10 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/19 "2024-09-02T03:10:05Z")

</div>

Perhaps you could try disabling other plugins first and only enable Joplin Batch. There might be conflicts between different plugins. Also, try this new version; I've added an error log. If an error occurs, it should be printed out.

[rxliuli.joplin-batch.jpl](https://discourse.joplinapp.org/uploads/short-url/50aCkEirKiFQXphi1SN8bEEyy93.jpl) (413 KB)

---

<div class="post-metadata">

**Author:** ![PEP8](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@PEP8](https://discourse.joplinapp.org/u/PEP8)\
**Post date:** [2 September 2024 13:18 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/20 "2024-09-02T13:18:45Z")

</div>

Solved, though I'm not sure exactly what fixed it...

1. I disabled my sole other plugn-in --\> markdown-prettier + restarted joplin - no change.
2. uninstalled markdown-prettier + restarted joplin - no change.
3. uninstalled joplin-batch, reinstalled old version + restarted joplin - no change.
4. uninstalled joplin-batch, installed new version, restarted - FIXED.
5. uninstalled new joplin-batch version, reinstalled old version, restarted - still FIXED
6. reinstalled markdown-prettier, restarted - still FIXED.

Regardless, thanks for the help. The (old) plugin is now scanning for unused resources.

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [2 September 2024 13:34 UTC](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528/21 "2024-09-02T13:34:18Z")

</div>

I don't understand... Is there anyone familiar with Joplin Plugin development who can help me review the code? The main thread code is less than 100 lines, and I don't understand what could be causing this situation.

> <https://github.com/rxliuli/joplin-utils/blob/master/packages/joplin-batch/src/index.ts>

[Next page](https://discourse.joplinapp.org/t/released-plugin-joplin-batch/39528.md?page=2)
