Jump to content

AutoitMike

Active Members
  • Posts

    194
  • Joined

  • Last visited

Everything posted by AutoitMike

  1. Mister Squirrle Thanks for the input. 1. All of my includes are at the top of my main script. 2. My custom "Include" is listed last in a list of about 10 includes. 3. I Moved my include script to the same location as all of the other "Include" scripts, removed the path part of the include statement and the problem went away, 4. The include script makes no references outside of the script or any other functions The name of the function was always correct and never changed. The complete solution was to move the location of the script to the same locations all of the existing include scripts (The default AutoIt location).
  2. OK, I figured it out. You can not have "Include files" in multiple locations throughout the PC. (at least within a single script). I think that AutoIt wants all include files in one location. Maybe this is a bug?? Once I moved MyInclude.au3 to the same location as all of the other include files and included it the same way that I include all my other "Includes"". IE #include <MyInclude.au3>, it works.
  3. I am not able to create folders from the root, even from the CMD prompt as administrator (Win7)
  4. Using the quotes instead of the brackets produces the same exact behavior.
  5. Consider this example: This is MyInclude.au3 #Include-once Func Abc() Msgbox(0,'','Hello from "ABC" ') EndFunc Func Def() Msgbox(0,'','Hello from "DEF" ') EndFunc This is my main script: #include <C:\Folder\MyInclude.au3> Abc() ;Runs OK if Def() is commented out Def() ;Produces error "Undefined function" script does not run This is the structure that I see in all of the existing AutoIt "Include" scripts that am currently using. THIS particular script is not in the same location as all of the other "Includes" , that is why I have the path in the "Include" statement (Which works for ABC() ) Why does this not work?? Thanks for your help
  6. I have many scripts with dozens of UDF's that I want to put into my own Include file. I moved a UDF from one of my scripts to my own "Include file" I added the include script file to my script and the script ran OK. (#include <C:\folder\MyInclude.au3>) I thought "Wow", lets put a bunch of my UDF's into my include script and reduce my 1200 line script a whole bunch. No matter what I do, the second UDF that I moved out of my main script causes an error "Undefined function Abc2()" when I attempt to run the script. I have "include-once" at the top of the include script file. Thanks for your help
  7. I am usually scared to death to update anything. I know that the latest version of AutoIt is a code killer for previous versions. My mantra is : "If it aint broke, dont fix it" However, it seems that there has to be someway to include this function's type ahead that I have added to the include file. Its going to take some research.........
  8. I discovered that my version of String.au3 does not include the function I found on line : _StringTitleCase() I went to GitHUB ,copied this function and added to my existing String.au3 However, when typing this command into the script editor, the type ahead does not include this command. Its as if this function does not exist. I believe that there is a file somewhere that I need to update to get this functionality ? Thanks for your help
  9. There is no such function in FF.au3 "....Gettitle......."
  10. I not sure how to answere this question any differently. I the most simple terms: 1. There are multiple instances of an application that will be interacted with by Autoit at some time after each instance is created. 2 A different application gets the handle value from a record from a database query based on other information that is available. EG : select paid from report.db where fieldx=‘abc’ and fieldy =‘def’ Now this ‘different’ Autoitn app has the window handle so that it can interact with the correct INSTANCE of the app that has multiple instances open. With the correct handle value, there is no way that the wrong instance is selected. The window handle for the correct app is obtained with the standard Autoit “WinGetHandle” during the time that AutoiIt app is automating the creation of a new instance of the app that has multiple instances. When a new instance is created, a new xml file is created and an associated record is added to the database. I can change the process so that I leave the each new instance open and just close the current report. I then can update the xml file, update the correct record in the database and then re-open the report. I just have re-invent some new processes. If I can do one of the following it would make things easy: 1. Assing a window handle to an application that I am about to open 2. Assume that if a specific application is closed and then reopened before any Other app is opened , the handle will be the same. 3. “Look ahead” and know what the next handle will be for the next application opened.
  11. OK, I will explain in more detail. A home inspection app I will call HG stores all information in an xml file called report.hg5 It also adds a record to an SQLlite database that stores various data. There is a field that I can use to store whatever I want called “Status” After an inspection is made there are pictures to import into the application. A poorly written , tedious process. I have a AutoIt app that automates this import process. It has to know Which instance of HG to interact with. I cant 100% rely on the title bar being unique. So if it knows the window handle value, boom , we got it. I have a Autoit app that automates the process of starting a new report using data from an attached .pdf from an email (1280 lines of code, 12 “includes”) Currently I have to use a screen input method to store the windows handle value. This value is in both the xml file and the SQLlite database record. BUT, I would like to store the handle directly in to the xml file and update the record in the database. And to do this I have to close the hg app, update the files and then reopen it. To do this I need to know what the handle WILL BE. Or, would the window handle value be the same after closing the app and reopening it? I hope this explains the situation better. Thanks for your inputs
  12. Mistersquirrel Is not true that if get the handle to an apps window, close that app, repen that app, wouldnt the handle be different now? At a later time a different app needs to know the handle value for this app in order to select, activate the correct app because there is always multiple instances of this app existing.
  13. In an Autoit application I am sending text to a field that is the window handle value. That application stores this value in an XML file. Of course I cant open up that XML file and write to it because the app has that file open. So now I am using "Send" to send text to the app. It would be sooo much cleaner if I could update the associated XML file before the app is opened with a valid window handle value. When the app is opened, the window handle is the value that I somehow created. Is this possible ? (Win 7) Thanks
  14. Dan, After studying the code I now see that I need to look at $cReply I assumed that the function returned the valid address. I will modify my copy to return $cReplly Thanks again for the help
  15. I went to the postal web site. I a now waiting for the e-mail with my info. Thanks for the link.
  16. Dan, I used the following on the second example and I get a '0' return value: $C1=_ValidateAddressUSPS('3225 Courthouse dr','','Union City','Ca','94587') msgbox(0,'',$C1) But I just now realized that you said it wont work. However, I dont understand the part $cZip = ' ' Is the command line wrong?
  17. Thanks for the quick reply and the code. Does your second example also require registration and approval from the PO? If so how do I go about doing this. Also, It looks like I need WinHttp.au3 for all examples (2000 lines of code OMG)
  18. I need to validate addresses used / captured in an Autoit app. These addresses are not validated, prone to misstakes and errors. I see that Chilkat has a good example script for their API, however, the $300 fee is too steep for me. I see that Loqate has an API for $100, much better price. It runs at $.044 per lookup. I use it untill the $100.00 is used up I am looking for an example script for Loqate or any other API that is around the $100 range or less. Thanks
  19. Mistersquirrle, This looks nice. I see that I need Taskschduler.au3 to use as the #Include file Cant seem to find it anywhere.
  20. DanP2 A big fat YES!!!!!!!! Thanks Very Mucho
  21. I discovered a really neat function that was in a script that I found on a forumn that was used to demo a solution to something not really related to what I am looking for. I cant seem to find it. It was something like _Loadlibsys([your script name],[how often to run it in ms] ) It loads your script and runs it every x miliseconds as defined in the function. The help for this function cautions to not to use small values to load and run because this could over tax the cpu This function is way better than a timer. Its almost like a NT service. Anybody know this function?? Thanks
  22. OK, Now I have a different error in WinAPISys.au3: C:\Program Files (x86)\AutoIt3\Include\WinAPISys.au3(1141,48) : WARNING: $STR_STRIPLEADING: possibly used before declaration. Here is the code inside of WinAPISys: 1138 Func _WinAPI_GetModuleHandleEx($sModule, $iFlags = 0) 1139 Local $sTypeOfModule = 'ptr' 1140 If IsString($sModule) Then 1141 If StringStripWS($sModule, $STR_STRIPLEADING + $STR_STRIPTRAILING) Then 1142 $sTypeOfModule = 'wstr' 1143 Else 1144 $sModule = 0 1145 EndIf 1146 EndIf 1148 Local $aRet = DllCall('kernel32.dll', 'bool', 'GetModuleHandleExW', 'dword', $iFlags, $sTypeOfModule, $sModule, 'ptr*', 0) 1149 If @error Or Not $aRet[0] Then Return SetError(@error, @extended, 0) ; If Not $aRet[0] Then Return SetError(1000, 0, 0) 1152 Return $aRet[3] 1153 EndFunc Maybe I just need to declare $STR_STRIPLEADING ?
  23. Thanks for the info. I thought that there was an error in the code. I got it from github This is a simple code change I can make.
  24. I found some neat functions and one of them needs "Includes" that I do not have in my "Include" folder. I copied a few from GitHub.com that appear to work, But I get an error when attempting to use WinAPIInternals.au3 The error is on line 629, character 16: 628 Func __Iif($bTest, $vTrue, $vFalse) 629 Return $bTest ? $vTrue : $vFalse 630 EndFunc ;==>__Iif The 16th character is the question mark. I never seen this used, it looks like it needs to be: 628 Func __Iif($bTest, $vTrue, $vFalse) 629 Return $bTest, $vTrue : $vFalse 630 EndFunc ;==>__Iif But that is wrong also. I cant find anywhere else to get WinApIInternals.au3 Thanks for any help
×
×
  • Create New...