Open In External Editor, Rename, Duplicate for Image, Audio,Video [Official thread]

When I click ‘image-edit’ from reveiw, path error occurs in Anki 2.1.56 Qt5

@jojoman: Can you provide more details? I assume during review you right click an image and from the context menu click “image-edit”. What happens then? What’s the exact error message? Post your whole config. what OS are you using? If its macos I most likely can’t help because I don’t have a Mac.

During review, right click an image and from the context menu click “image-edit”.

그림판 2023-06-26 오전 5_52_47

Error message displays.

OS : Win 10 Pro, Anki 2.1.56 Qt5

I havent seen such a messsage before … I think I need to change the addon so that it allows a user to easily copy more relevant information.

you could right click the image and select “Image - Copy path to clipboard” and then from a CMD window run the command “mspaint path” where path is what you’ve copied to the clipboard. this should open the file in paint?

as a a workaround you could use the “image - show in file manager” option and then right click and edit the image. hopefully this works and at least that’s only two more clicks.

1 Like

Thank you for helping me!

For your information, the image saves in C:\Users\JO\AppData\Roaming\Anki2\User1\collection.media.

When I right click an image and from the context menu click “image-edit" in browser. It works well.

it’s really strange that the context menu works from the browser. As I said I’ll have to change the addon code and I think I’m already half a year late with changes to this addon …

Posted from github issue (Infinite loop in image editing (sometimes))

_*** Maybe I’ll just add an option “Clear Cache” to the context menu that you need to run after editing the image.

  • Maybe I should show an askUser dialog (“external image edit finished?”)?
  • When a user starts editing an image externally I could start watching the file for changes and if one is detected I could clear the anki cache. I should always stop this watching when (in the add window) this note is added, (in the browser) when a different note is loaded into the editor, (in the preview) when the window closes. But I wonder what happens if I clear the cache at a random time …**_

Hey @ijgnd , is there any way to add this line of reasoning for when the ‘show image in finder’ option is selected? On Anki 2.1.65qt5 MacOS.

I ask this because I use this option to edit the images since it allows me to take advantage of the Quick Look → Markup feature (from Preview), which somehow bypasses the permission issues of editing the image via triggering the external editor. However, I still run into the same issue of the Anki browser not updating these changes.

Quick Look → Markup feature (from Preview), which somehow bypasses the permission issues of editing the image via triggering the external editor.

this is expected. you manually trigger quick look on an image so the editing is based on a user interaction in trusted software.

the next version will include a context menu for reloading the editor (but I guess the reviewer is also needed). My problem is still twofold: primarily I have no time and I also don’t have a mac …

Hello,
I’d like to use the edit image function on Anki Desktop.
My machin is a MacBook Air (M1, 2020) mac OS Monterey version 12.1
Obviously I don’t have paint so I wanted to do as someone how said : “Using the Config options, I set the external image editor to SeaShore.app (available on the App Store), and it works beautifully on Mac. Thank you very much.”
So I went to the Config options and changed “mspaint” to “SeaShore.app” but I get this message :

Can someone help me ?

the addon probably won’t work for you.

see the heading “MacOS” on the addon description page. To make this limitation more clear I just added a sentence to the top of the addon description. Even if you solved the sandboxing/permission problem you’d have to adjust the config. See the heading “Configuration” on the addon page. this addon needs the path you would type into a terminal.

General info: on MacOS if you want to run an app from the command line (terminal) it’s not enough to type in the app name, instead you need to call a specific file from the application bundle. E.g. for the app Anki you need to run the following command: Console Output - Writing Anki Add-ons Other apps have different internals and need completly different commands.

ijgnd: you can use open -a Foo.app --args ...

1 Like

I am using the latest Anki (23, 24) on Windows.
When I edit an image during a review, the image in the editor updates correctly, but all images in the reviewer seem to be hidden.(Not found image icon is displayed, including non-edited images.)

If I stop reviewing, return to DeckBrowser, and then review again, the images seem to show up correctly, so I added this to the _editExternal function for now.

           if mw.state == "review":
                from aqt import QTimer
                QTimer.singleShot(500, lambda: mw.moveToState("deckBrowser"))
                QTimer.singleShot(1000, lambda: mw.moveToState("review"))

thanks for your code. Unfortunately at the moment I’m pretty busy. I’ll probably include this in mid/ late may.

1 Like

Hi there, I just encountered an issue with your addon. I’m currently using Anki version 24.06.3 (d678e393) with Python 3.9.18, Qt 6.6.2, and PyQt 6.6.1. The addons I have installed include Extended Editor for Field for Tables Searchplace, Image Occlusion Enhanced, and Review Heatmap.

After running a quick test, it seems that when Extended Editor for Field is enabled, editing images using your addon causes the images to not display properly. I hope this helps in identifying the issue.

I also want to express my gratitude for creating such a fantastic addon—it’s incredibly helpful! Your contributions to this small but passionate community are truly invaluable. Thank you so much for all your hard work!

Below is what happened after a image editing with only turning on Extended Editor for Field and this addon:

1 Like

10/7 update: with Extended Editor for Field addon closed, image still crashed after editing, and it will recover once I restart Anki

Thanks for the add-on. I wonder if it is possible to make it work for other file formats to open/reveal PDF, PSD, or even Finder/Explorer folders? It would be very helpful to have this functionality.

1 Like

for pdfs I use https://ankiweb.net/shared/info/319501851 or https://ankiweb.net/shared/info/879473266

psd: they are not shown in the browser so the approach of my addon shouldn’t work. Maybe you can adjust my "Open linked … " addon

for file paths: sounds useful. there should be an addon for this. I need to think, if there’s already an add-on for this … but I’m really busy at the moment …

1 Like