scripting: use contains to check if a string contains a substring

Change-Id: I7cbd32310e362f43f0a456e45b58930eb5453f0c
Reviewed-on: https://gerrit.libreoffice.org/11289
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>