An AI Agent that interacts with Windows OS at GUI level.
Python
"""Desktop module utilities."""
def escape_text_for_sendkeys(text: str) -> str:
"""Escape special characters so uia.SendKeys types them correctly."""
result = []
for ch in text:
if ch == "{":
result.append("{{}")
elif ch == "}":
result.append("{}}")
elif ch == "\n":
result.append("{Enter}")
elif ch == "\t":
result.append("{Tab}")
elif ch == "\r":
continue
else:
result.append(ch)
return "".join(result)