61 posts in this topic
Error When running complied Script
Okay guys, I have written a script which essentially runs once a week to copy files to a server. It also copies the files to a local directory. When I run in Autoit it works perfectly. When I compile and run I get the attached error. Any help would be appreciated. How should I debug this? I am not a programmer by the way but love Autoit as it has done so much for me.
"Error: Variable must be of type object" on new machine
I've been using autoit for about a year now and overall it's been great despite my limited understanding of all of its features. I have several scripts that run on virtual machines that have been running smoothly for several months without any issues. Recently, I had to create new virtual machines and migrate my scripts over and now I am getting errors that I can't seem to repeat, but seem to happen at least once a day with all of my executables that were flawless before.
The error that I keep getting is:
Line [this number varies per script] (File "[path to my executable]"); Error: variable must be of type object.
I never received this error before until I moved everything to the new VMs, and when I rerun my scripts after clearing the error everything seems to work and run fine until hours later or sometimes the next day. I am assuming that that the root cause may be in some kind of settings on the VM itself since it is happening nearly across the board, but I have no idea where to even look. These are running on Windows 7, which is what they were running on before I had any errors.
The only consistent include used in these scripts is IE.au3
Has anyone run into a similar problem or can maybe point me in the right direction. I am at the point of pulling hair out trying to resolve this. I have even rewritten and re-compiled the scripts to see if somehow the executables got corrupted, but that didn't help.
I use _AD_Open() in a script and a strange thing happens. The first time I logon to a computer with an active directy user login the _AD_Open() function gives @error=4 with no description of the @extended error. It just says LDAP Provider generated the error. When I log off the workstation and than log on with the same user login name the function _AD_Open() works perfectly. It seems that if the workstation has a profile of the user on the local PC, _AD_Open() works correctly but if the profile of the login user does not yet exist it gives the error. Any suggestions? I would like to make it work the first time a user logs on on a not yet used workstation. Much thx in advance for your advice.
P.S. I love the AD-extensions to Autoit; they work prefectly in the (mostly logon ) tools I've written for our domain workstations.
Subscript Used on Non-Accessible Variable WinGetPos error
Func workSpaceSetup () ConsoleWrite ("workSpaceSetup" &@CRLF) $workSpace = WinGetHandle ("some site - Google Chrome") ConsoleWrite ($workSpace&@CRLF) $pos1 = WinGetPos ($workSpace) WinMove ($workSpace , "", $pos1 , $pos1 , 1366, 768, 0) EndFunc So the script is first, the error I get is second in the quote.
This is one function of many for an app I am building but it is the first one that runs so I know there aren't other things at play here.
The idea is to keep the window in the same space it is when the script runs but just resize it as this app is used across multiple computers with different screen resolutions.
Could someone please elaborate upon what "Subscript used on non-accessible variable" means?
Oh and the variable is declared as "Global $pos1 = 0" at the top outside of any functions with the other global variables.
Any advice would be greatly appreciated!
FileWriteLine error in expression
I am trying to do something a little whacky but here's the function that's kicking back an error.
I am fairly sure I am overlooking a simple error but I am not seeing it.
Func mouseSpot () Global $mouseSpot = MouseGetPos() ConsoleWrite ($mouseSpot & ", " & $mouseSpot & @CRLF) FileWriteLine ("mouseGrabs.txt" , "MouseClick ('"'primary'"' , $mouseSpot , $mouseSpot, 1, 10)" ) EndFunc The error displays as this