Fixed: script keeps running for ever

When a text selection begins or ends with spaces the script keeps running, draining battery. This correct that behavior