SUMMARY Section found here: https://docs.digikam.org/en/batch_queue/custom_script.html#proof-of-concept In the context of a custom script, the variables `$INPUT` and `$OUTPUT` are special. The are interpolated by digikam before executing the script. This means that the script will evaluate to something like this before execution: ``` echo "INPUT FILE: "<path/to/input>"" echo "OUTPUT FILE: "<path/to/output>"" echo "TITLE: $TITLE" echo "COMMENT: $COMMENT" echo "COLORLABEL: $COLORLABEL" echo "PICKLABEL: $PICKLABEL" echo "RATING: $RATING" echo "TAGSPATH: $TAGSPATH" cp ""<path/to/input>"" ""<path/to/output>"" exit $? ``` This causes the quotes to cancel out and the copy to fail. Removing the quotes from around `$INPUT` and `$OUTPUT` fixes the issue. STEPS TO REPRODUCE 1. Run proof of concept from docs using a files with a space in the path. OBSERVED RESULT `cp` fails to run EXPECTED RESULT script executes correctly
Git commit b4eb097064115709825f6882d4fffee29f61b90e by Gilles Caulier. Committed on 22/11/2025 at 15:59. Pushed by cgilles into branch 'master'. remove double quote around file paths in the proof of concept script to handle paths with spaces. M +1 -1 batch_queue/custom_script.rst https://invent.kde.org/documentation/digikam-doc/-/commit/b4eb097064115709825f6882d4fffee29f61b90e diff --git a/batch_queue/custom_script.rst b/batch_queue/custom_script.rst index ae02b7466..124c7dd3f 100644 --- a/batch_queue/custom_script.rst +++ b/batch_queue/custom_script.rst @@ -96,7 +96,7 @@ This first example shown below does nothing special. It prints on the console th echo "RATING: $RATING" echo "TAGSPATH: $TAGSPATH" - cp "$INPUT" "$OUTPUT" + cp $INPUT $OUTPUT exit $? If you have started digiKam from a terminal and enabled the debug traces on :ref:`Setting/Miscellaneous/System dialog page <system_settings>`, you will see something like this: