Jump to content

RealisT

Active Members
  • Posts

    71
  • Joined

  • Last visited

RealisT's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Seeking a way to detect a Firefox page change, I've decided to find a specific pixel's color and then have the AutoIt code wait for this color to change. (Reasons for this listed below) The problem is that, in FF, the coordinates of the pixelsearch command are on a different part of the page than the same coordinates used by pixelgetcolor, no matter what settings I use. (Sample code below) Now before some of you start a reply about me using AutoItSetOption(), let me mention that I've tried all combinations of pixelcoordmode, as well as all combinations of pixelcoordmode along with mousecoordmode. No combination works! No matter what I do, pixelgetcolor is not looking at the same pixel as pixelsearch, even if I directly feed the coords from one to the other. If no settings work, then what do I do to use pixel coordinates effectively in FF? BTW, this issue does not exist in IE9. (Sample Code): ---------------------------------------------------------- $orangePointPos = PixelSearch(600, 0, 1200, 500, 0xF3B34C, 30) ; Finds coord within an orange button $confirmColor = PixelGetColor($orangePointPos[0], $orangePointPos[1]) ; Retrieves the actual color of the pixel ; Wait for color change (i.e., for button to disappear, i.e., for page change) Do Sleep(100) $checkColor = PixelGetColor($orangePointPos[0], $orangePointPos[1]) ; Until $checkColor <> $confirmColor ------------------------------------------------------------ These are all valid values, insofar as the searches are finding something and returning arrays, etc. In order to see the coords AutoIt is using, I inserted the following command: mousemove($orangePointPos[0], $orangePointPos[1]) This never takes me to the orange pixel detected, no matter what setting I use! I am open to other suggestions about detecting the FF page-change, but I still want to get the pixel coord issue solved. Thanks --Me (Reasons for pixel color change detection as FF page-change detection: For this specific use, window title detection is irrelevant because the title does not change names across the pages I'm browsing. Also, AutoIt does not appear to detect any text in a FireFox window either. Plus FF does not have a status bar or even the option to have a status bar. So I am going with observing the current page for changes. FYI).
  2. Does anyone have an Include which enables one to SET (not just Get) extended file properties? Examples: Title, Year, Width, Height, DateModified, etc. (My MP3 software is failing to assign data to the 'Year' and 'Comments' properties as it was designed to do, and I wanted to make an AutoIt script to take care of it for me...for a lot of files). Thanks
  3. (Monoscout999: As I stated, the array was never populated. The error is on the first line attempting to do so). **** I FOUND THE PROBLEM **** While there is absolutely nothing wrong with the array, there is something wrong with the doofus at the keyboard, since he apparently likes to create another variable elsewhere with the exact same name. Please don't e-slap me. Wouldn't you think, though, that the error would occur instead at that other line, which comes first? Why not the same error there, which would have pointed out this problem very quickly, yes?
  4. The code would be a major pain for y'all to run. It creates files, opens other apps (Sony Vegas Movie, Audacity, etc.), uses paths found only on my PC, and thus would pretty much only work on my machine...once I can get it to work : ) So if I posted it, it would be for human eyes only. The _ArrayDisplay is not an option after the problem line, since the script can't get that far. As stated, _ArrayDisplay beforehand doesn't display at all (with the Array include included, of course).
  5. No includes using my array. Just a generic GUIConstants.au3.
  6. No string-splits or any other operations on/with/using the array. Also, _arraydisplay($trackData) does not work, I suspect because AutoIt does not consider this an array (hence the problem). Oh, and this problem line of code is within a called function. The array is global, though, so it shouldn't matter. (The variable used in the array index is global, too. So no invalid values).
  7. To answer your questions: 1. This error is with the first occurrence of any line trying to populate the array. In other words, no data yet. It is not letting me populate it (post-declaration). 2. I am not exceeding the range. Is was declared as [99][2], and the values at error-time are [1][0]. I'm just not seeing any grounds for this not to be considered a legit array. No other code between declaration & this line refer to this or any other array. Hope that helps. Thanks
  8. I'm getting the infamous error, "Subscript used with non-Array Variable." This really IS an array, though! It is a declared, global, and sufficiently-sized two-dimensional array... Global $trackData[99][2] AutoIT gives an IsArray value of 0, however, for this variable! Before I paste the whole code here, let me ask this fundamental question: What (theoretically) would make AutoIT consider my array invalid as an array if: 1. It is Global declared 2. It is never re-declared or re-dimensioned 3. It is given good index (parameter) values, never out of range (confirmed) ??? Can I get an answer to this, based on your knowledge of the language rather than on looking at my code? Thanks
  9. enaiman: The workaround actually does work. Thank you. So what is it about the workaround that allows the image to appear though the generated HTML window can't do this? I wonder... Thanks again, and Happy Christmas.
  10. Deathbringer: That code doesn't work for me. I used it exactly as you gave it (after I saved the logo.png to C:\). There is still no image being displayed, even though this HTML works ok on its own. (Perhaps related/perhaps not: the _IE functions work OK for me but none of the _INet functions work on this box, though my drivers otherwise seem fine. I wonder if that's relevant at all to how AutoIt handles the IE windows/objects it creates...Just thinking out loud).
  11. Adding </img> does not change the result. In eleven years I have never used or needed the </img> end-tag. I've always understood it to be superfluous / deprecated. In any case, I've yet to find a browser that requires it.
  12. #include <IE.au3> $ieWin = _IECreate("", 0, 1, 1, 1) $webStr = "<html><head></head><body>" $webStr = $webStr & "<img src='file:///C:/MyProject/Images/TestImage.jpg' width=330 height=65>" $webStr = $webStr & "</body></html>" _IEDocWriteHTML($ieWin, $webStr)Windows XP SP3 IE8 I have a script which is to create a simple webpage using _IEDocWriteHTML or _IEBodyWriteHTML. However, this method will not let me render an image on the new webpage. (The image path is VALID; this has been confirmed). I am using absolute file paths. I have tried refreshing & not refeshing the page after creation, too. An independent webpage with this HTML works fine. But it will not render the image if this HTML is generated via _IEDocWriteHTML or _IEBodyWriteHTML. I've tried these path variations without success: C:\MyProject\Images\BattleshipsLogo.jpg file:///C:/MyProject/Images/BattleshipsLogo.jpg C:\\MyProject\Images\BattleshipsLogo.jpg Why is this happening? Is there a vital HTML change needed for use with AutoIt?
  13. Surprisingly little response. Oh well. Can't identify the cause of the problem, but there is a simple enough workaround. GUICtrlSetPos() moves the pic to the top as long as at least one value is changed from the original. Still seems kludgy to me, but it will have to do for now. Can someone at least answer how a GUI-oriented language such as AutoIt can be so weak at control layering functionality? Don't people take pride in their work anymore?
  14. And sometimes, when the newest pic is created, it appears for an instant to be layered on top. But something seems to "force" it down below older pics. I've tried to replace the older pics with labels. No change; the newer pics still are layered underneath! What must I do?
  15. Additional info: New labels appear on top, but the new pics appear underneath older pics. Very confusing.
×
×
  • Create New...