themax90 Posted December 24, 2004 Share 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted December 24, 2004 Developers Share 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. Link to comment Share on other sites More sharing options...
themax90 Posted December 24, 2004 Author Share Posted December 24, 2004 (edited) Thanks this will help with my IM app, Edited December 24, 2004 by Agent Smith Link to comment Share on other sites More sharing options...
themax90 Posted December 24, 2004 Author Share 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? Link to comment Share on other sites More sharing options...
this-is-me Posted December 24, 2004 Share Posted December 24, 2004 Look for ControlSendPlus on the forum. Who else would I be? Link to comment Share on other sites More sharing options...
themax90 Posted December 24, 2004 Author Share Posted December 24, 2004 Where can I obtain a copy of the udf and how to I implement it Link to comment Share on other sites More sharing options...
this-is-me Posted December 25, 2004 Share 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? 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