What is the format for readText multiline?

I am trying to read text from a floating window with readText. Because the window is mobile I input coordinates based on a static image in the window and use variables to contain the values.

I tried using the example in the refererence manual but I know it cannot be correct because the ('s and )'s do not match.

I am using readText((xval1, yval1, xval2, yval2), multiline: true)) and also readText((xval1, yval1), multiline: true)) neither works

Comments

  • SenseTalkDougSenseTalkDoug admin ForumAdmin admin
    Either delete the final ')' or insert a '(' before the word multiline. Either one should work.
  • Thanks I got the multiline to work. Now I am having other concerns.

    I used readText with multiline and depending on which parameter I use I get different results. I have turned Contrast, Trim on, separately and together
    When Trim is on V become U
    When Contrast is on S becomes 5
    and sometimes some underscores "_" are converted to "^"

    Als the return is just one line with \t and \n separators for tabs and newlines. How do I parse the information out into chunks I can work with?
  • I used readText with multiline and depending on which parameter I use I get different results. I have turned Contrast, Trim on, separately and together
    When Trim is on V become U
    When Contrast is on S becomes 5
    and sometimes some underscores "_" are converted to "^"
    The way the OCR works, different settings will work better for different kids of strings, colors, etc. My recommendation is to work with it until you find the setting that works best for your scenario. If you haven't tried using ValidCharacters you may consider that. Setting a SearchRectangle is also really helpful. Visit this post on the Knowledge Base for descriptions of these if you haven't already and don't know how they work: http://www.testplant.com/support/2012/02/working-with-ocr/
    Als the return is just one line with \t and \n separators for tabs and newlines. How do I parse the information out into chunks I can work with?
    For this, you can use the "replace" command, documented here: http://docs.testplant.com/?q=content/working-text

    So, say your variable Foo contains "ItemA\tItemB\tItemC\nIdemD\nIdemE"...
    put "ItemA\tItemB\tItemC\nIdemD\nIdemE" into foo
    
    ...and you want to parse it out into a list. You can use code like this:
    replace every occurrence of "\n" in Foo with comma
    replace every occurrence of "\t" in Foo with comma
    insert foo as list into fooList
    
    Hope that helps!
  • Thanks

    I think with the "replace" and "split" commands I can work around the "table" recognition problem.
Sign In or Register to comment.