Is there an addon to reveal files in a file manger fom editor window?

@ferophila : thanks for the report.

At the moment I can’t reproduce this on 2.1.55 qt6 beta 7 on intel macos 12. I can handle file names that contain “@”.

I wonder why you seem to have the html tag “pre” in the replacement. I guess something else goes wrong on your machine …

It would be really helpful if you could do two things:

  1. if possible could you share the content of the field before you tried renaming. You might have to restore a backup to a temporary profile to get the unchanged field content, for details see Backups - Anki Manual

  2. You could run anki from the commandline with a modified version of my add-on that displays debugging messages.

To run Anki from the commandline you need to find the actual binary first. On MacOS you usually have Anki in the folder “Programme”. If you right click “Anki” in it you should see an option like “show contents”. Actually behind the anki icon there’s a whole folder that the finder just hides from you. Then you have to click through until you find the right file. It should be something like Contents/MacOS/AnkiMac (or maybe it’s just Anki)

Then you can drag and drop this path into the app terminal or you can directly go into the app terminal and enter the full path. Assuming Anki is in your /Applications folder, please open Terminal.app and run /Applications/Anki.app/Contents/MacOS/AnkiMac

The point of doing is that Anki will now show many status messages in the terminal app window.

You could modify my add-on in a text editor and change the file rename.py (source) . To find this file: Click the “show files” button in the add-on dialog when my add-on is selected - also see Managing Files - Anki Manual.

change it from

def _replace_all_img_src(parent, orig_name: str, new_name: str):
    "new_name doesn't have whitespace, dollar sign, nor double quote"
    
    orig_name = re.escape(orig_name)

to

def _replace_all_img_src(parent, orig_name: str, new_name: str):
    "new_name doesn't have whitespace, dollar sign, nor double quote"
    print(f"___orig_name is: ---{orig_name}---")    
    orig_name = re.escape(orig_name)

i.e. you insert this line print(f"orig_name is: ---{orig_name}---") (it’s important that it has four leading spaces).

After restarting anki my add-on will now always show in the terminal what it considers as the original name of the file that you want to rename. Maybe the problem in my code is earlier, i.e. that my add-on has the wrong code for reading the file name.

It would be great if you could add this line to my add-on, then run anki from the terminal and then try to rename the affected file and then post in this forum the line in your terminal that starts with “___orig_name is”.

I know this is complicated. But such print debugging is very helpful. The problem is that some bugs can’t be reproduced on other machines so that help from the user is needed. Knowing this can also be useful if you want another add-on developer to take care of a problem only you have …