-
Posts
29 -
Joined
-
Last visited
Everything posted by fspafford
-
-
How can I use a technique, like conditional compilation, that would allow me to use code that is dependent on the version of AutoIt? (Example, the changes to the Excel UDF in 3.3.12.)
-
Format used by AutoItTools:ExportLibrary()?
fspafford replied to fspafford's topic in AutoIt General Help and Support
I am still looking for an answer - mainly what is needed to match this pattern from the Lua code above: local pattern = ";%s+(" .. name .. "%s*%([^" .. nl .. "]+)" .. nl .. ";%s+;(.-);%s+Parameters" -
Format used by AutoItTools:ExportLibrary()?
fspafford replied to fspafford's topic in AutoIt General Help and Support
I looked at the description of AutoItTools:ExportLibrary() and added it to my Tools menu, but I can't seem to make it work. Perhaps the format of my UDF headers is wrong. Can anyone give a short sample that shows the format required? I currently get the following lines (I added the region): #Region Members Exported #cs Exported Functions #ce Exported Functions #endregion Thanks, Frank -
Format used by AutoItTools:ExportLibrary()?
fspafford replied to fspafford's topic in AutoIt General Help and Support
I have been successful in triggering a few LUA functions from the Tools menu of SciTE, but that is not where I have a question. Sorry for the confusion, and thanks for AutoIt! Currently, I have added the LUA routine AutoItTools:ExportLibrary() to the Tools menu (source file C:Program Files (x86)AutoIt3SciTELUAAutoItTools.lua), but when I run the tool, I don't see any routines added to the #Region Members Exported region. I looked at the LUA script, and I suspect my routines are missing some type of formatting required by the regular expression in ExportLibrary(). The LUA code is: -------------------------------------------------------------------------------- -- ExportLibrary() -- -- Creates an exports section in an AutoIt file containing comments describing -- the functions in the file. -- -- Tool: AutoItTools.ExportLibrary $(au3) savebefore:no,groupundo:yes Ctrl+Alt+E Export Library -------------------------------------------------------------------------------- function AutoItTools:ExportLibrary() -- These are constants used throughout. local region_text = "#Region Members Exported" local comment_start = "#cs Exported Functions" local comment_end = "#ce Exported Functions" local nl = self:NewLineInUse() -- We work over the entire document. local doc = editor:GetText() if not doc:find(region_text, 1, true) then print("Error: Unable to find "" .. region_text .. "" in the library, no export list created.") else local from, to, found = false if not doc:find(comment_start, 1, true) then print("Warning: Unable to find "" .. comment_start .. "" in the library, there may be multiple export lists.") from = doc:match(region_text .. nl .. "()") to = from else from = doc:match(comment_start .. nl .. "()") to = doc:match("()" .. comment_end) found = true end -- This should never happen due to the checks above. if not from or not to then print("Error, unable to determine where to add the export list.") else -- Store the list in this variable. local text = "" -- We only build the list for functions we can find in the code. -- Orphaned comments will not be found. for pos, str in doc:gmatch(self.Pattern) do -- Pull the name out of string so we can build a pattern. local name = str:match("^(.-)[%(%s]") -- First check that the name doesn't start with __ which means -- it's private. if not str:find("^__") then -- Build the pattern. It's a bit complicated to keep it -- from running over lines it shoudn't. local pattern = ";%s+(" .. name .. "%s*%([^" .. nl .. "]+)" .. nl .. ";%s+;(.-);%s+Parameters" -- Get the two parts. local func, desc = doc:match(pattern) -- Ensure they are valid. if func and desc then -- Clean up the text, put on a single line, remove trailing spaces. func = func:gsub("%s*$", "") -- Trailing spaces desc = desc:gsub("%s*;%s*", " ") -- Multiple lines desc = desc:gsub("^%s*", "") -- Leading spaces desc = desc:gsub("%s*$", "") -- Trailing spaces -- Concatenate the formatted text. text = text .. func .. " - " .. desc .. nl end end end -- We have to offset our indices because SciTE is 0-based while Lua -- strings are 1-based. editor:SetSel(from - 1, to -1) -- If the exports section already exists, we are replacing it. if found then editor:ReplaceSel(text) -- Otherwise, we have to insert the exports section. else editor:ReplaceSel(comment_start .. nl .. text .. comment_end .. nl) end print("Exports list created. ") end end end -- ExportLibrary() Frank -
Format used by AutoItTools:ExportLibrary()?
fspafford replied to fspafford's topic in AutoIt General Help and Support
ExportLibrary() is a routine included in the LUA file typically installed with AutoIt at: C:Program Files (x86)AutoIt3SciTELUAAutoItTools.lua The routines in the file can be added to the Tools menu in the AutoIt editor. (Some are there already.) Frank -
I looked at the description of AutoItTools:ExportLibrary() and added it to my Tools menu, but I can't seem to make it work. Perhaps the format of my UDF headers is wrong. Can anyone give a short sample that shows the format required? I currently get the following lines (I added the region): #Region Members Exported #cs Exported Functions #ce Exported Functions #endregion Thanks, Frank
-
Find in Files doesn't work?
fspafford replied to RichardL's topic in AutoIt General Help and Support
Thanks, that worked for me! Frank -
Find in Files doesn't work?
fspafford replied to RichardL's topic in AutoIt General Help and Support
I have the same find-in-files problem. I am using the latest version (Version 2.27 Jun 24 2011 17:46:25). >findstr /n /s /I "inputbox" "*.au3" >%1 is not a valid Win32 application. If I try the findstr command in a console window, it works fine. Does anyone know how to correct the problem? Regards, Frank -
I found my problem, and it was related to the Dll I am using.
-
I have a script which uses an external communications Dll. The main loop of the script uses the Dll to send commands and then wait for responses. DllCallbackRegister is used to register a callback routine which processes the responses. The script works for several iterations of the loop, and then aborts. When it aborts, it seems (by observing console output) that something is causing the the script to restart at the beginning. I have verified the main routine and the callback routine execute with the same thread id. Any suggestions for narrowing down my problem? I am using AutoIt version v3.3.4.0.
-
I have tried to use _FFClick and _FFFormSubmit to submit this form (below) without success. Any suggestions? This page is within a frame, and I am using version 0.5.3.7b. <html> <head> <title>BpclMod.htm</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="author" content="ics#cap"> <meta name="rev_author" content="ics#cap"> <meta http-equiv="pragma" content="NO-CACHE"> <meta http-equiv="expires" content="-1"> <meta name="alternate_title" content="BpclMod"> <link href="style.css" rel="stylesheet" type="text/css"> <style type="text/css"></style> <script language="javascript"> function PortChanged() { var nPortNumber = parseInt(document.getElementById('BpclPortList').value, 10); document.getElementById('PortNumber').value = nPortNumber; document.Form1.submit(); UpdatePage(); } function UpdatePage() { var start = new Date().getTime(); var cur = start; while (cur - start < 50) cur = new Date().getTime(); window.location.replace("BpclMod.ssi"); } function Validate_Fields() { var nPercent = document.Form1.BpclPercentage; if (!top.Validate_Number(nPercent, 0, 100)) return false; return true; } </script> </head> <body onload="top.FixTable(document.getElementById('Table1'))"> <form id="PageHeader"><p class=nth1>Fault: Low voltage on power supply V1.<br></p></form> <form name="Form1" id="Form1" method="post" onsubmit="return Validate_Fields();" action="System_Cmd"> <center> <h2>Broadcast Packet Count Limit Configuration</h2> <table id="Table1" border="2" cellspacing="0" cellpadding="4"> <tr> <td class="LabelTop">Port Name</td> <td valign="top" class="Value"><select name="BpclPortList" id="BpclPortList" onchange="PortChanged()"><option value=1>TX1</option><option value=2>TX2</option><option value=3>TX3</option><option value=4>TX4</option><option value=5 selected>TX5</option><option value=6>TX6</option><option value=7>FX1</option><option value=8>FX2</option><option value=100>All</option></select></td> </tr> <tr> <td class="LabelTop">BPCL Percentage</td> <td valign="top" class="Value"><input type="text" id="BpclPercentage" name="BpclPercentage" maxlength="3" size="3" value="3"</td> </tr> </table> <br> <input type="submit" id="Update" name="Update" value="Update"> <input type="button" value="Cancel" id="Cancel" name="Cancel" onclick="location=document.Form1.Destination.value"> <input type="hidden" id="ID" name="ID" value="Update_BpclConfig"> <input type="hidden" id="Destination" name="Destination" value="BpclView.ssi"> <input type="hidden" id="PortNumber" name="PortNumber" value="0"> </center> </form> <form id="PageFooter" name="PageFooter"><hr><p class=ntf1><strong>NOTE: </strong>Changes have been made that have not been <a href="Config.ssi" target=main>saved</a>.</p></form> </body> </html>
-
I noticed a problem with _FFFrameEnter while upgrading from V0.5.3.7b to 0.6.0.0b-5. I had to change this statement: _FFFrameEnter("main", "id") to: _FFFrameEnter(2) to make subsequent things work. Is this a problem with the newer version? Here are the console logs: >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Frank\Script\Firefox\ff-factory.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +>08:42:02 Starting AutoIt3Wrapper v.2.0.0.3 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X64 OS:X86) >Running AU3Check (1.54.19.0) from:C:\Program Files\AutoIt3 +>08:42:02 AU3Check ended.rc:0 >Running:(3.3.2.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Frank\Script\Firefox\ff-factory.au3" _FFConnect: OS: WIN_XP WIN32_NT 2600 Service Pack 3 _FFConnect: AutoIt: 3.3.2.0 _FFConnect: FF.au3: 0.5.3.7b _FFConnect: IP: 127.0.0.1 _FFConnect: Port: 4242 _FFConnect: Delay: 2ms _FFConnect: Socket: 1660 __FFSend: try{window.content.frames["top"].document.browserDOMWindow}catch(e){'_FFCmd_Err';}; __FFRecv: __FFSend: try{navigator.userAgent}catch(e){'_FFCmd_Err';}; __FFRecv: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729) _FFConnect: Browser: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729) __FFSend: try{content.frames.length}catch(e){'_FFCmd_Err';}; __FFRecv: 3 __FFSend: try{content.frames[0].name}catch(e){'_FFCmd_Err';}; __FFRecv: banner __FFSend: try{content.frames[1].name}catch(e){'_FFCmd_Err';}; __FFRecv: contents __FFSend: try{content.frames[2].name}catch(e){'_FFCmd_Err';}; __FFRecv: main @@ Debug(518) : $i = 2 >Error code: 0 _FFOpenURL: BpclView.ssi __FFSend: try{window.content.frames[2].document.location.href="BpclView.ssi";}catch(e){'_FFCmd_Err';}; __FFRecv: BpclView.ssi _FFLoadWait: .... loaded in 874ms @@ Debug(523) : 1 = 1 >Error code: 0 _FFLoadWait: . loaded in 31ms __FFSend: try{FFau3.simulateClick(window.content.frames[2].document.getElementById('Modify'),0,0);}catch(e){'_FFCmd_Err';}; __FFRecv: 1 _FFLoadWait: .... loaded in 949ms __FFSend: FFau3.xpath=null;try{FFau3.xpath=window.content.frames[2].document.evaluate("//form[@name='Form1']//select[@id='BpclPortList']//option[@value='7']",window.content.frames[2].document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue.selected=true;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: 1 __FFSend: try{window.content.wrappedJSObject.frames[2].document.getElementById('BpclPercentage').value='77';}catch(e){'_FFCmd_Err';}; __FFRecv: 77 __FFSend: try{window.content.frames[2].document.forms[1].elements.length;}catch(e){'_FFCmd_Err';}; __FFRecv: 7 __FFSend: try{window.content.frames[2].document.forms[1].submit();}catch(e){'_FFCmd_Err';}; __FFRecv: _FFLoadWait: .... loaded in 875ms _FFLoadWait: . loaded in 32ms +>08:42:09 AutoIT3.exe ended.rc:0 +>08:42:10 AutoIt3Wrapper Finished >Exit code: 0 Time: 8.381 >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Frank\Script\Firefox\ff-factory.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +>08:44:11 Starting AutoIt3Wrapper v.2.0.0.3 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X64 OS:X86) >Running AU3Check (1.54.19.0) from:C:\Program Files\AutoIt3 +>08:44:11 AU3Check ended.rc:0 >Running:(3.3.2.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Frank\Script\Firefox\ff-factory.au3" _FFConnect: OS: WIN_XP WIN32_NT 2600 Service Pack 3 _FFConnect: AutoIt: 3.3.2.0 _FFConnect: FF.au3: 0.6.0.0b-5 _FFConnect: IP: 127.0.0.1 _FFConnect: Port: 4242 _FFConnect: Delay: 2ms _FFConnect: Socket: 1660 __FFSend: try{window.content.top.document.browserDOMWindow}catch(e){'_FFCmd_Err';}; __FFRecv: __FFSend: try{navigator.userAgent}catch(e){'_FFCmd_Err';}; __FFRecv: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729) _FFConnect: Browser: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729) __FFSendJavascripts: Sending functions to FireFox .......... done @@ Debug(518) : $i = 1 >Error code: 0 _FFOpenURL: BpclView.ssi __FFSend: try{window.content.top.main.document.location.href="BpclView.ssi";}catch(e){'_FFCmd_Err';}; __FFRecv: _FFCmd_Err @@ Debug(523) : 1 = 1 >Error code: 8 _FFLoadWait: ._FFOpenURL ==> No match: BpclView.ssi loaded in 31ms __FFSend: try{FFau3.simulateEvent(window.content.top.main.document.getElementById('Modify'),'MouseEvents','click');}catch(e){'_FFCmd_Err';}; __FFRecv: _FFCmd_Err _FFClick ==> No match: $sElement: window.content.document.getElementById('Modify') +>08:44:14 AutoIT3.exe ended.rc:0 +>08:44:15 AutoIt3Wrapper Finished >Exit code: 0 Time: 4.945
-
I would like to see @ScriptLineNumber work in compiled scripts. That way, I can report errors that include the line number where they occur.
-
Tidy - full description of options
fspafford replied to fspafford's topic in AutoIt General Help and Support
I saw the help file, but still had some questions. For example, what are the allowed values for the "delim" option? Should "/Remove_EndFun_comment" be "/Remove_EndFunc_comment" ? I also tried to disable the "Update Spaces around delimiters" for a few lines in a script by using: #Tidy_Parameters= /delim=0 ;..lines where I want to leave spacing alone #Tidy_Parameters= /delim=1 but this did not work. Is there a way to do this for selected lines? Thanks, Frank -
Where can I find a full description of Tidy options, such as the ones in a Tidy.ini file?
-
Stilgar, I have a question about _FFTableGetCell. I am using version $_FF_AU3VERSION = "0.5.3.7b". This code excerpt begining at line 124: ; title of the current page $sTitle = _FFCmd( ".title") ;If Not @error Then MsgBox(64,"Title of the current page:",$sTitle) if $sTitle <> "UserMgmtView.htm" Then SetError (1) EndIf $cell = _FFTableGetCell("Users", 2, 2, "id") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $cell = ' & $cell & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console $val = _FFXPath ("/html/body/form[@id='Form1']/center/table[@id='Users']/tbody/tr[2]/td[2]") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $val = ' & $val & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console shows this console output: __FFRecv: UserMgmtView.htm __FFSend: try{content.document.getElementsByTagName('tbody')['Users'].getElementsByTagName('tr')[2].getElementsByTagName('td')[2].textContent;}catch(e){'_FFCmd_Err';}; __FFRecv: _FFCmd_Err _FFCmd ==> Error return value: _FFCmd_Err @@ Debug(132) : $cell = >Error code: 8 __FFSend: FFau3.xpath=null;try{FFau3.xpath=window.content.frames[2].document.evaluate("/html/body/form[@id='Form1']/center/table[@id='Users']/tbody/tr[2]/td[2]",window.content.frames[2].document,null,XPathResult.STRING_TYPE,null).stringValue;}catch(e){'_FFXPath_Error: '+e;}; _FFTableGetCell ==> No match: Table/Column/Row: Users/2/2 __FFRecv: us0 @@ Debug(135) : $val = us0 >Error code: 0 I went with _FFXPath because I could not get _FFTableGetCell to work. Do you see any problems? Regards, Frank
-
With an earlier version of FF.au3 (V0.3.6.1beta), I can use these statements to open a page: _FFFrameEnter($Socket, "main", "id") _FFOpenURL($Socket, 'PortConfigView.ssi') _FFLoadWait($Socket) Console: __FFSend: content.wrappedJSObject.frames[1].name __FFRecv: contents __FFSend: content.wrappedJSObject.frames[2].name __FFRecv: main __FFSend: content.wrappedJSObject.frames[2].document.location.href="PortConfigView.ssi" __FFRecv: PortConfigView.ssi _ With the latest version of FF.au3 (0.5.3.6b) (I removed the $Socket argument) I get an error trying to open "http://PortConfigView.ssi". Console: __FFSend: try{content.frames[1].name}catch(e){'_FFCmd_Err';}; __FFRecv: contents __FFSend: try{content.frames[2].name}catch(e){'_FFCmd_Err';}; __FFRecv: main _FFOpenURL: http://PortConfigView.ssi __FFSend: try{window.content.frames[2].document.location.href="http://PortConfigView.ssi";}catch(e){'_FFCmd_Err';}; __FFRecv: http://PortConfigView.ssi How can I correct this problem? Is it caused by the addition of "http://"? And thanks for a nice tool. Regards, Frank
-
I am having problems with the Bit*** functions because they work with signed integers and I need to work with unsigned integers. Is there a recommended workaround for this problem?
-
Thank you, that worked. The page is from a network switch, which is not publicly accessible.
-
The button does not submit a form - it causes another page to be opened. Currently, I use _FFOpenURL() to simulate the button click. Unfortunately, the page analyzer does not work on this page - I get the error "can't open connection to Firefox". (It does work on other pages.)
-
Thanks for FF.au3. I know the id of a button on a form in a frame. How do I use _FFClick to click the button?
-
Thanks for the program. I noticed that if I resize a label to multiple lines, save the form, close and reopen the form, the label size is not restored. I have tried this with 1.7.0.1 and 1.7.0.5 Beta. Am I doing something wrong, or is this a bug in Koda? Thanks, Frank
-
In _SysTrayIconHandle, I made a simple change to support WindowsXP 64bit edition: if(@ProcessorArch = "X64") Then Local $str = "int;int;byte;byte;byte[6];dword;int";char[128]" Else Local $str = "int;int;byte;byte;byte[2];dword;int";char[128]" EndIf