Bug 421231 - Krita won't save a favourite script
Summary: Krita won't save a favourite script
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (show other bugs)
Version: 4.2.9
Platform: macOS (DMG) macOS
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-09 16:24 UTC by Emilio
Modified: 2022-09-20 13:35 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Krita System Information (2.95 KB, text/plain)
2020-05-09 16:24 UTC, Emilio
Details
Screen recording of the problem (1.97 MB, video/quicktime)
2020-05-09 16:32 UTC, Emilio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emilio 2020-05-09 16:24:06 UTC
Created attachment 128295 [details]
Krita System Information

SUMMARY

I made a python script in order to save to a .kra file and export to PNG at the same time. When I tried to attribute it to a keyboard shortcut I noticed that it won't keep it. There are no errors whatsoever, it just doesn't.

I tried looking the log to see if I could find something relevant but there was none.

I can't think of a way to reproduce it, it just happens. Sorry. If you think of something I can tell you in order for you to reproduce it, I'll be glad to help.

OBSERVED RESULT
The pop-up window with the favourite scripts is empty, as if it cleared itself as soon as I clicked the 'OK' button. The script won't run when pressing the corresponding keys.

EXPECTED RESULT
The script shortcuts should stay and run when pressing the corresponding keys.

SOFTWARE/OS VERSIONS
macOS: 10.15.4
Qt Version: 5.12.7
Comment 1 wolthera 2020-05-09 16:26:14 UTC
can you check if this still happens with the 4.3 beta? We changed how python loads action in that...
Comment 2 Emilio 2020-05-09 16:32:34 UTC
Created attachment 128296 [details]
Screen recording of the problem
Comment 3 Emilio 2020-05-09 16:42:36 UTC
(In reply to wolthera from comment #1)
> can you check if this still happens with the 4.3 beta? We changed how python
> loads action in that...

Interestingly enough, with a fresh install of the 4.3 beta, the script I was trying to save was already there. However, I tried writing a basic 'hello world' script to see if the problem was gone and couldn't get it to stay in another slot. Really strange stuff!
Comment 4 Bug Janitor Service 2020-05-10 04:33:20 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 5 vanyossi 2020-05-11 02:00:35 UTC
on macos and linux (the ones tested) I found the following behaviour.

Adding a script works and can be called immediatly. but the action is not shown if "ten scripts" is opened again. krita has to be restarted for the scripts selected to be visible.
Comment 6 Halla Rempt 2020-05-14 08:53:11 UTC
The bug report is talking about scripts set in the Ten Scripts plugin, not script actions added to the toolbar, which is what I fixed for 4.3.0.
Comment 7 Halla Rempt 2022-09-20 13:34:48 UTC
Git commit 890a75597bcd91b37496bb0738b650c31ff815b1 by Halla Rempt.
Committed on 20/09/2022 at 13:34.
Pushed by rempt into branch 'master'.

Save the scripts to the tenscripts' scripts list

M  +3    -0    plugins/python/tenscripts/tenscripts.py

https://invent.kde.org/graphics/krita/commit/890a75597bcd91b37496bb0738b650c31ff815b1
Comment 8 Halla Rempt 2022-09-20 13:35:08 UTC
Git commit c3df24efc2882c738741fdb8b5029e5bc471723b by Halla Rempt.
Committed on 20/09/2022 at 13:34.
Pushed by rempt into branch 'krita/5.1'.

Save the scripts to the tenscripts' scripts list
(cherry picked from commit 890a75597bcd91b37496bb0738b650c31ff815b1)

M  +3    -0    plugins/python/tenscripts/tenscripts.py

https://invent.kde.org/graphics/krita/commit/c3df24efc2882c738741fdb8b5029e5bc471723b