Print selected files with the right-click context menu in Caja

OK!
I turned it into a script for the context menu, it prints the Libreoffice selected files as they appear in print preview and prints also Jpg, Png, txt and PDF files.
I tried it on the ods and odt files.
Change Samsung-M2020-Series with your printer.

3) Print selected files

#!/bin/bash
printer=Samsung-M2020-Series
echo "$CAJA_SCRIPT_SELECTED_FILE_PATHS" | while read file
do
/usr/lib/libreoffice/program/swriter -p "$printer" "$file"
done
exit 0