themax90 2 Posted December 24, 2004 (edited) I want to write into a file and then check the file for special characters. Like if there is a ! then set $compound = $compound & "{shiftdown}1{shiftup}" Then controlsend $compond. Is there a special character analyzer already built or how can I search a file after reading it for a special char? Can you alter this code to make it work? #include <GuiConstants.au3> Dim $WS_OVERLAPPEDWINDOW = 0xCF0000, $WS_VISIBLE = 0x10000000, $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("MyGUI", 392, 226,(@DesktopWidth-392)/2, (@DesktopHeight-226)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Edit_1 = GuiCtrlCreateEdit("Edit1", 10, 20, 370, 160) $Button_2 = GuiCtrlCreateButton("Button2", 50, 200, 120, 20) GuiSetState() While 1 $msg = GuiGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit EndIf If $msg = 4 Then $info = GUICtrlRead($edit_1) FileWrite("test", $info) $info = FileRead ( "test", 300) If $info = "!" Then $compound = $compund & "{SHIFTDOWN}1{SHIFTUP}" EndIf Run("cmd.exe") sleep(1000) ControlSend("C:\WINDOWS\System32\cmd.exe", "", "", $compound) EndIf WEnd Exit Thanks Edited December 24, 2004 by Agent Smith Share this post Link to post Share on other sites
Jos 2,165 Posted December 24, 2004 (edited) $chr = "!" $FName = "YourFile.txt" If StringInStr(Fileread($FName,FileGetSize($FName)),$chr) Then ; whatever you want to do when character is found EndIf Edit: syntax error Edited December 24, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
themax90 2 Posted December 24, 2004 (edited) Thanks this will help with my IM app, Edited December 24, 2004 by Agent Smith Share this post Link to post Share on other sites
themax90 2 Posted December 24, 2004 do you know how to do that then for every ! replace it with {shiftdown}1{shiftup} ? and rewrite it to that file. like take in the string of $info and find all !'s then change all the !'s to {shiftdown}1{shiftup} and save it the variable $info with the original string of info only the !'s to {shiftdown}1{shiftup} or back to a file. Possible? Share this post Link to post Share on other sites
this-is-me 6 Posted December 24, 2004 Look for ControlSendPlus on the forum. Who else would I be? Share this post Link to post Share on other sites
themax90 2 Posted December 24, 2004 Where can I obtain a copy of the udf and how to I implement it Share this post Link to post Share on other sites
this-is-me 6 Posted December 25, 2004 'Scuse me. I wasn't plain enough.Translation:Look for ControlSendPlus on the forum.toSearch for ControlSendPlus with the search feature in the top right of this forum. Who else would I be? Share this post Link to post Share on other sites