COLLNAME with complex strings, FIND QUERY, Windows Search, AQS

I'm learning how to use Windows Search with DOpus. I made a .dcf file I can run with Autohotkey because I'm mouseless and don't use any buttons as buttons. Here's a simplified version to show my problem.

<?xml version="1.0" encoding="UTF-8"?>
<button>
	<function>
		<instruction>@set input={dlgstring|Windows Search AQS}</instruction>
		<instruction>FIND COLLNAME "{$input}" QUERY {$input}</instruction>	
	</function>
</button>

This works for simple search strings, like "green".

But it doesn't work for something like "filename:green".

The problem seems to be special characters like the colon intruding on the COLLNAME part. If I delete the COLLNAME portion of the instruction, it works fine. Is there a way to pass these strings to COLLNAME? Maybe some kind of string sanitizing function?

You could use scripting and apply any changes you need to the input when building the command.