GetTextInRect in Firefox 4
Moderators: Dorian (MJT support), JRL
GetTextInRect in Firefox 4
Hello everyone.
Here is my my problem: I have recently updated from Firefox 3.5 to Firefox 4 and the GetTextInRect command is no longer working in the scripts that worked before.
I have tested the command defining large regions from where to get text, but MDL>text is blank when my macro runs.
Does anybody know what the problem might be?
Thanks in advanced and sorry for my English.
Here is my my problem: I have recently updated from Firefox 3.5 to Firefox 4 and the GetTextInRect command is no longer working in the scripts that worked before.
I have tested the command defining large regions from where to get text, but MDL>text is blank when my macro runs.
Does anybody know what the problem might be?
Thanks in advanced and sorry for my English.
-
- Junior Coder
- Posts: 21
- Joined: Thu Mar 10, 2011 6:49 pm
- Marcus Tettmar
- Site Admin
- Posts: 7393
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
It is quite possible that FireFox has changed the way they render text and may not be calling any of the Windows text out functions to do so. A la Chrome.
I haven't tried it yet so don't know for sure. But since it worked in 3.5 and not in 4 that would be my suspicion.
I haven't tried it yet so don't know for sure. But since it worked in 3.5 and not in 4 that would be my suspicion.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Thank you both for your comments.
Adroege, that way it works but I get absolutely all the text in the window, and I only want a little text placed in an specific place. That is why I used GetTextinRect, to be able to pick the text exactly where I want.
This way I would have to work in another algorithm to process the text from the clipboard.
Adroege, that way it works but I get absolutely all the text in the window, and I only want a little text placed in an specific place. That is why I used GetTextinRect, to be able to pick the text exactly where I want.
This way I would have to work in another algorithm to process the text from the clipboard.
This way I would have to work in another algorithm to process the text from the clipboard.
Usually this is as simple as:
Code: Select all
Let>Clipboardtext=Blah Blah Blah Blah Success! Blah Blah Blah Blah
Let>StringToSearchFor=Success!
Position>StringToSearchFor,Clipboardtext,1,result
If>result>0
MessageModal>The result was successfull !
Else
MessageModal>Something bad happened
Endif
Hi Dj Telo,
You're close. At this point, you could use a RegEx to isolate your target... try the code below:
I used StringReplace> to remove any spaces from the data just to make writing of the Regex pattern easier.
The first part of the pattern is using a regex feature called Positive Lookbehind:
(?<=ratio)
This tells it that the word ratio must preceed the numbers... but it will not be included in the match. If you are lucky and the entire blob of text only ever uses the word ratio once, right before your number, you can probably dispense with any other code you might be using to isolate your numbers and just use this regex against the entire text blob. Here's a useful link to learn more about Positive Lookbehind: http://www.regular-expressions.info/lookaround.html
I did not know if the / will always appear in the number or not so I wrote the pattern so that it would be optional i.e. the following would all match:
1/1
1/22
22/1
22/22
22/333
333/22
333/333
22
333
4444
56555
666666
However the following would not match:
/1
/22
/333
1/
22/
333/
You can of course adjust the pattern to be able to handle the range of data you'll have to parse.
Good luck and take care
You're close. At this point, you could use a RegEx to isolate your target... try the code below:
Code: Select all
Let>data= item1%CRLF%ratio 64 / 115
MDL>data
StringReplace>data,%SPACE%,,data
MDL>data
Let>matches_1=
Let>pattern=(?<=ratio)[0-9]{1,3}[/]{0,1}[0-9]{1,3}
RegEx>pattern,data,0,matches,num,0
MDL>matches_1
The first part of the pattern is using a regex feature called Positive Lookbehind:
(?<=ratio)
This tells it that the word ratio must preceed the numbers... but it will not be included in the match. If you are lucky and the entire blob of text only ever uses the word ratio once, right before your number, you can probably dispense with any other code you might be using to isolate your numbers and just use this regex against the entire text blob. Here's a useful link to learn more about Positive Lookbehind: http://www.regular-expressions.info/lookaround.html
I did not know if the / will always appear in the number or not so I wrote the pattern so that it would be optional i.e. the following would all match:
1/1
1/22
22/1
22/22
22/333
333/22
333/333
22
333
4444
56555
666666
However the following would not match:
/1
/22
/333
1/
22/
333/
You can of course adjust the pattern to be able to handle the range of data you'll have to parse.
Good luck and take care
Last edited by jpuziano on Fri Apr 01, 2011 6:51 pm, edited 1 time in total.
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Sure... but it doesn't even get interesting until it gets challenging...Dj Telo wrote:That is getting challenging.
Good luck in your exams and take care
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -