I noticed that you were executing the action from the action list.
I just remembered why the scripts behaves as it does (intentionally).
Therefore, I made a quick video about how the script works in different cases:
https://nextcloud.stephanroemer.net/...mSyKeZT6jMRqfK