Jump to content

n9mfk9

Active Members
  • Posts

    196
  • Joined

  • Last visited

Everything posted by n9mfk9

  1. Hi PsaltyDS, i jut went to go throw 9 files archive.php archives.php page.php search.php index.php header.php single.php attachment.php grab every thing from <!-- Begin wordpress code --> copy every between an end it here <!-- end wordpress code --> an then no changes write it out to the same file name just put it on anoter folder thanks for any help beau
  2. I am trying to write a script to read 8 files my question is how do make this i went to start here <!-- Begin wordpress code --> copy every between an end it here <!-- end wordpress code --> $file = FileOpen("metar2.txt", 0) $fileout = FileOpen("test.txt", 1) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop ;MsgBox(0, "Line read:", $line) ;$out= StringReplace($line, '","','"> ','1') ;MsgBox(0, "Line read:", $out) ;FileWriteLine($fileout,$out) Wend FileClose($file) FileClose($fileout) thanks for any help
  3. If i use this line autoit hangs ControlClick("[REGEXPTITLE:(?i).*?Outlook Express.*?]", " ", "Button1") what did i do wrong Beau
  4. autoit hangs beau
  5. Smooke_N what did i do wrong ControlClick("[REGEXPTITLE:(?i).*?Outlook Express.*?]", " ", "Button1") window info >>>> Window <<<< Title: Outlook Express Class: #32770 Position: 350, 251 Size: 443, 126 Style: 0x94C803C5 ExStyle: 0x00010101 Handle: 0x005105BA >>>> Control <<<< Class: Button Instance: 1 ClassnameNN: Button1 ID: 6 Text: &Yes Position: 140, 60 Size: 75, 23 ControlClick Coords: 51, 10 Style: 0x50030001 ExStyle: 0x00000004 Handle: 0x001905BC >>>> Mouse <<<< Position: 544, 350 Cursor ID: 2 Color: 0xF4F4F0 >>>> StatusBar <<<< >>>> Visible Text <<<< &Yes &No The spell check on this document was halted. Do you want to send anyway?
  6. that works were can i find info on REGEXPTITLE thanks Beau
  7. Hi all im trying to click the cancel on a outlook express spelling window i tried WinWaitActive("Spelling") ControlClick("Spelling", " ", "[CLASS:Button9; TEXT:Cancel") ControlClick("Spelling", "", "[CLASS:Button9; TEXT:Cancel; INSTANCE:1]") ControlClick("Spelling", "", "[CLASS:Button; TEXT:Cancel; INSTANCE:9]") ControlClick("Spelling", "", "[CLASS:Button9; TEXT:Cancel; INSTANCE:9]") none work here the window info >>>> Window <<<< Title: Spelling Class: #32770 Position: 312, 358 Size: 407, 212 Style: 0x94C800C4 ExStyle: 0x00010101 Handle: 0x00030736 >>>> Control <<<< Class: Button Instance: 9 ClassnameNN: Button9 ID: 2 Text: Cancel Position: 326, 153 Size: 66, 23 ControlClick Coords: 55, 5 Style: 0x50010000 ExStyle: 0x00000004 Handle: 0x000107B4 >>>> Mouse <<<< Position: 696, 545 Cursor ID: 2 Color: 0xFAFAF9 >>>> StatusBar <<<< >>>> Visible Text <<<< Not In Dictionar&y: kgkjkkjkjkjkkk Change &To: kgkjkkjkjkjkkk Suggestio&ns: &Ignore I&gnore All &Change Change A&ll &Add &Suggest &Options... &Undo Last Cancel thanks Beau
  8. Im using a program called yahoo pops so i can use localhostBeau
  9. Hi All, here my code #include <INet.au3> $s_SmtpServer = "localhost" $s_FromName = "n9mfk9" $s_FromAddress = "n9mfk9@yahoo.com" $s_ToAddress = "n9mfk@comcast.net" $s_Subject = "My Test UDF" Dim $as_Body[2] $as_Body[0] = "Testing the new email udf" $as_Body[1] = "Second Line" $Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body) $err = @error If $Response = 1 Then MsgBox(0, "Success!", "Mail sent") Else MsgBox(0, "Error!", "Mail failed with error code " & $err) EndIf im getting Mail failed with error code 50 how can i fixthis beau
  10. Hi everyone here my code #include <array.au3> #include<File.au3> $tagname ="" $ext =".txt" $sInput = "" ;$tagname = "" $FileIn = @ScriptDir & "\tagslist"&$ext $Fileout = @ScriptDir & "\mytest"&$ext ;$hFileOut = FileOpen($FileOut, 2) $sInput = FileRead($FileIn, FileGetSize($FileIn)) If @error = 1 Then MsgBox(0, "Error", "Unable to open file."&$FileIn) Exit EndIf ;MsgBox(0,"test", $FileIn) $avInput = StringSplit($sInput, @CRLF, 1) ;_ArrayDisplay($avInput, "$avInput") Global $avOutput[$avInput[0] + 1] = [$avInput[0]] For $n = 1 To $avInput[0] $sFormatted = "" $tag = StringRegExp($avInput[$n], "%.*?%", 1) If @error = 0 Then ;$tagname = $tag[0] Global $tagname[Ubound($tag)] $tagname[0] = $tag[0] $tagname[0] = StringReplace($tagname[0],'-','_') $tagname[0] = StringReplace($tagname[0],'<','LT') $tagname[0] = StringReplace($tagname[0],'>','GT') $tagname[0] = StringReplace($tagname[0],'=','') $tagname[0] = StringReplace($tagname[0],'/','_') $tagname[0] = StringReplace($tagname[0],',','CM') ;MsgBox(0,"",$tagname) ; ConsoleWrite("Debug: " & $n & ": " & $tag[0] & @LF) $sFormatted = "$" & StringReplace($tagname[0], "%", "") & ' = "' & $tag[0] & '" ' ;MsgBox(0,"",$sFormatted) ;ConsoleWrite("Debug: $sFormatted = " & $sFormatted & @LF) EndIf $avOutput[$n] = $sFormatted & "\\ " & StringRegExpReplace($avInput[$n], "\.{2,}", "", 0) ; ConsoleWrite("Debug: Output " & $n & ": " & $avOutput[$n] & @LF) Next Dim $avohdr $avohdr= _ArrayCreate("<?php" & @CRLF & "// converted"& $FileIn& "to"& $FileOut & "for php tags" & @CRLF & _ "// by " & "// Author: n9mfk" & @CRLF & "//// ---------------------------------" & @CRLF & _ "// allow viewing of generated source"&@CRLF&@CRLF&"if ( \$_REQUEST['sce'] == 'view' ) {" & @CRLF & _ " download('view');"& @CRLF & "exit;}"&@CRLF) _ArrayDisplay($avohdr, "$avOutput") $hFileOut = FileOpen($FileOut, 2) _FileWriteFromArray($hFileOut, $avohdr,0) _FileWriteFromArray($hFileOut, $avOutput,1) FileClose($hFileOut) ;MsgBox(0,"test", $avOutput) ;_ArrayDisplay($avOutput, "$avOutput") here the code i need help with Dim $avohdr $avohdr= _ArrayCreate("<?php" & @CRLF & "// converted"& $FileIn& "to"& $FileOut & "for php tags" & @CRLF & _ "// by " & "// Author: n9mfk" & @CRLF & "//// ---------------------------------" & @CRLF & _ "// allow viewing of generated source"&@CRLF&@CRLF&"if ( \$_REQUEST['sce'] == 'view' ) {" & @CRLF & _ " download('view');"& @CRLF & "exit;}"&@CRLF) _ArrayDisplay($avohdr, "$avOutput") $hFileOut = FileOpen($FileOut, 2) _FileWriteFromArray($hFileOut, $avohdr,0) when i look at my file the <?php is printed on lne 2 line 1 ins blank how can i move it to line 1 thanks Beau
  11. hi everyone, can an array be writen to a file with out using ubound thanks beau
  12. Thanks every one for the help
  13. Hi Everyone is there a better way to write a long string $eohdr= "<?php" &@CRLF &"// converted $infile to $outfile for php tags"&@CRLF&"// by "&"// Author: n9mfk"&@CRLF&"//"&"// --------------------------------------------------------------------------"&@CRLF&"// allow viewing of generated source"&@CRLF&@CRLF&"if ( \$_REQUEST['sce'] == 'view' ) {"&@CRLF & " download('view');"&@CRLF& "exit;"&"}" thanks Beau
  14. I got C:\Documents and Settings\beau thompson\My Documents\au3\test\weatherpage\mytagmaker4.au3 (25) : ==> Subscript used with non-Array variable.: $avField3[0] = $avField[0] $avField3^ ERROR ->14:38:31 AutoIT3.exe ended.rc:1 Beau
  15. no what im trying to do is make one array $avField1[0] in to $avfield3[0] so i tried $avField3[0] = $avField[0] but i did not work so my question is how to make an array in to a new array Thanks beau
  16. Hi, PsaltyDS that code works great I do have one ? is there a away to make an array into a new array im trying to add tss sep for the old code $tagname = $aArray1[$a] $tagname = StringReplace($tagname,'-','_') $tagname = StringReplace($tagname,'<','LT') $tagname= StringReplace($tagname,'>','GT') $tagname = StringReplace($tagname,'=','') $tagname = StringReplace($tagname,'/','_') $tagname = StringReplace($tagname,',','CM') #include <array.au3> Dim $avField1 $ext =".txt" $sInput = "" $FileIn = @ScriptDir & "\tagslist"&$ext $sInput = FileRead($FileIn, FileGetSize($FileIn)) If @error = 1 Then MsgBox(0, "Error", "Unable to open file."&$FileIn) Exit EndIf ;MsgBox(0,"test", $FileIn) $avInput = StringSplit($sInput, @CRLF, 1) ;_ArrayDisplay($avInput, "$avInput") Global $avOutput[$avInput[0] + 1] = [$avInput[0]] For $n = 1 To $avInput[0] $sFormatted = "" $avField = StringRegExp($avInput[$n], "%.*?%", 1) If @error = 0 Then $avField1[0] = $avField[0] MsgBox(0,"",$avField1[0]) ; ConsoleWrite("Debug: " & $n & ": " & $avField[0] & @LF) $sFormatted = "$" & StringReplace($avField[0], "%", "") & ' = "' & $avField[0] & '" ' ;MsgBox(0,"",$sFormatted) ;ConsoleWrite("Debug: $sFormatted = " & $sFormatted & @LF) EndIf $avOutput[$n] = $sFormatted & "\\ " & StringRegExpReplace($avInput[$n], "\.{2,}", "", 0) ; ConsoleWrite("Debug: Output " & $n & ": " & $avOutput[$n] & @LF) Next _ArrayDisplay($avOutput, "$avOutput")
  17. sorry about that this should be better to readBeau
  18. Hi everyone i need some advice here my code were i need the help is im try to get all the data back in my output file I have included my input output an what im looking for thanks #include <String.au3> #include <array.au3> Dim $tag Dim $tagname $file = FileOpen("tagslist.txt", 0) $fileout = FileOpen("myphp3.txt", 2) ;Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $aArray1 = _StringBetween($line, '\%','\%', -1, 1) If Not @error Then ; _ArrayDisplay($aArray1, 'Default Search') For $a = 0 To UBound($aArray1) - 1 $tag = '"'&'%'& $aArray1[$a]&'%'&'"'&';'& ' // ' $tag1 = '%'& $aArray1[$a]&'%' $tagname = $aArray1[$a] $tagname = StringReplace($tagname,'-','_') $tagname = StringReplace($tagname,'<','LT') $tagname= StringReplace($tagname,'>','GT') $tagname = StringReplace($tagname,'=','') $tagname = StringReplace($tagname,'/','_') $tagname = StringReplace($tagname,',','CM') $new = '$'&$tagname& ' = '& $tag $line = StringReplace($line,$tag1,$new) $line= StringRegExpReplace($line,"\.{2,10}","") ;MsgBox(0,'', $output) FileWriteLine($fileout,$line ) Next EndIf WEnd FileClose($fileout) FileClose($file) here my input tagslist.txt what_i_looking_for.txt myphp3.txt
  19. Hi everyone i got it working with $output = StringRegExpReplace($line,"\.{2,9}","") thanks Beau
  20. I got this error C:\Documents and Settings\beau thompson\My Documents\au3\test\weatherpage\mytagmaker.au3(35,48) : ERROR: unbalanced paranthesis expression. $test = StringRegExpReplace($line,('\.{2,4}', ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\beau thompson\My Documents\au3\test\weatherpage\mytagmaker.au3 - 1 error(s), 0 warning(s) thanks Beau
  21. here the input $sunrise = "%sunrise%"; ..................sun rise time (make sure you have the correct lat/lon here what i went $sunrise = "%sunrise%"; //sun rise time (make sure you have the correct lat/lon the number of dots change on each line that why i was trying to seat a range thanks beau
  22. hi everyone Im try to look for .. or .... this is not working $test = StringRegExpReplace($line,('.{2,4}','//') what did i do wrong Thanks Beau
  23. What did i do wrorg _StringBetween($line, '\%','(/n+/r)', -1, 1) Beau
  24. Hi everyone is there a way to have_StringBetween look for a end of a line or cr thanks Beau
  25. HI Everyone i need some help pull data form a txt file here what I have to start with I have included what i am get an what im trying to get im not sure how to grap parts of the text thanks beau #include <String.au3> #include <array.au3> Dim $tag Dim $tagname $file = FileOpen("tagslist.txt", 0) $fileout = FileOpen("myphp.txt", 1) ;Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $aArray1 = _StringBetween($line, '%', '%') If Not @error Then ; _ArrayDisplay($aArray1, 'Default Search') For $a = 0 To UBound($aArray1) - 1 $tag = '%'& $aArray1[$a]&'%' $tagname = $aArray1[$a] $tagname = StringReplace($tagname,'-','_') $tagname = StringReplace($tagname,'<','LT') $tagname= StringReplace($tagname,'>','GT') $tagname = StringReplace($tagname,'=','') $tagname = StringReplace($tagname,'/','_') $tagname = StringReplace($tagname,',','CM') FileWrite($fileout, '$'&$tagname& ' = ' &'"'&$tag&'"'&';' &@CRLF ) ;MsgBox(0,'',$aArray1[$a]) ;$aArray1[$a] = "" & $aArray1[$a] & "%" Next EndIf WEnd FileClose($fileout) FileClose($file)
×
×
  • Create New...