Jump to content

Script placing unwanted text into active window


 Share

Recommended Posts

Hello all, 

I've written a script that pulls info from some web pages, saves the results to variables, and prints it out to a Word document. I've tried to make this script work with a minimum of user interaction. I've noticed an issue happens when I run the script and I have another window set as active, like SciTE for example. It inserts an "ETX" character. I've done this with Notepad too. It displays an upside down L character. Any particular reason why? Unfortunately, I can't post any code. Basically, it gets a collection of tags, applies a test to find the values I want, then pulls the innerhtml from said tag. Then it assigns the results to a global variable.  Any help would be appreciated. 

Link to comment
Share on other sites

  • Moderators

So, you want us to troubleshoot your script without showing the code? You have to be able to comprehend how difficult that is going to be. If you cannot post the script itself, you can post a test script that reproduces the issue you're seeing.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

_IENavigate($oIE, "some website", 0)
_IELoadWait($oIE)
Sleep(1000)

local $loadVerify = _IEGetObjByID($oIE, "test")
If isObj($loadVerify) then
;do something
Else
    Send(:{BREAK}")
EndIf




Local $i = 0
Local $nI = 0

Do
Local $oElements = _IETagNameGetCollection($oIE, 'SPAN')
Until IsObj($oElements)

Sleep(250)

For $oElement In $oElements
   If StringInStr($oElement.innerText, "Something") AND StringLen($oElement.innerText) < 30 Then $nI = $i
       $i += 1
Next

Sleep(500)
$res = _IETagNameGetCollection($oIE, "SPAN", $nI)
$Result = StringMid($res.innertext, 1, 4)
Global $var1 = $Result
sleep(1000)

Taking your advice, JLogan, here is a test script that basically does what my actual script does. 

Link to comment
Share on other sites

and any debugging before you try and write this to notepad, does it look ok if you consolewrite it?

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

consolewrite is a function that writes the data to the console window.  F1 is your super best friend for the remainder of your days.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...