SUMMARY File Name is outdated when asking Python the documents name. STEPS TO REPRODUCE 1. Create a new file 2. Save new file as “test_AAA.kra” 3. now save file again as “test_BBB.kra” 4. Close file 5. Open file “test_BBB.kra” 6. Go to: Tools > Scripts > Scripter 7. Run the following code: """ import krita name = Krita.instance().activeDocument().name() print(str(name)) """ OBSERVED RESULT Result file name will always be the first saved name “test_AAA” being outdate regardless of the version of the file. EXPECTED RESULT should output "test_BBB" as the file name "test_BBB.kra" indicates. SOFTWARE/OS VERSIONS Windows: 10 Qt Version: 5.12
The image name is not the same thing as the filename, so this is expected. This dates back to when Krita could store multiple images in a single file, but because of compatibility issues, it's pretty hard to refactor this out. Use filename() instead.