Travb Posted August 29, 2016 Share Posted August 29, 2016 (edited) Hi guys, If I were to use ControlSend on a program that had brackets in its title how would I do it? I've read a bit about it and apparently you use double quotation marks?? Eg. ControlSend("programwithbracketsinitsname ""(bracketspart)"" ", "text", controlID, "string" [, flag = 0] ) Is this how I would do it? Edited August 29, 2016 by Travb Link to comment Share on other sites More sharing options...
232showtime Posted August 29, 2016 Share Posted August 29, 2016 what kind of program do you want to automate? ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
AutoBert Posted August 29, 2016 Share Posted August 29, 2016 1 hour ago, Travb said: ControlSend("programwithbracketsinitsname ""(bracketspart)"" " just use single quotes: ControlSend('programwithbracketsinitsname "(bracketspart)" ', "text", controlID, "string") yours should also run, if you correct synstax for the last [optional] param: ControlSend("programwithbracketsinitsname ""(bracketspart)"" ", "text", controlID, "string") Link to comment Share on other sites More sharing options...
Malkey Posted August 29, 2016 Share Posted August 29, 2016 Here is an example testing ControlSend to a window with brackets in a window's title, and, Also tests ControlSend to a window with double quotes in a window's title. Note:- ' is a single quote, " is a double quote, and, "" is two double quotes. $sFileName = "programwithbracketsinitsname(bracketspart) .txt" If FileExists($sFileName) Then FileDelete($sFileName) $fFile = FileOpen($sFileName, 10) ; $FO_OVERWRITE (2) = Write mode (erase previous contents) + $FO_CREATEPATH (8) FileClose($fFile) ShellExecute($sFileName) WinActivate("programwithbracketsinitsname(bracketspart) ") WinWait("programwithbracketsinitsname(bracketspart) ", "", 10) ControlSend("programwithbracketsinitsname(bracketspart) ", "", "Edit1", "This string is sent using ControlSend with brackets in title" & @LF, 0) Sleep(3000) WinSetTitle("programwithbracketsinitsname(bracketspart) ", "", "programwithDouble Quotesinitsname ""Double Quotes"" ") ControlSend("programwithDouble Quotesinitsname ""Double Quotes"" ", "", "Edit1", "This string is sent with double quotes in title.", 0) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now