fmen Posted May 21, 2005 Posted May 21, 2005 (edited) WinGetCaretPos ( ) does not work with Firefox. Regardless of the real position of the caret, it always returns x, y as being at the left upper corner of the browser. Does anyone have any ideas on a workaround? Thanks. Edited May 21, 2005 by fmen
fmen Posted May 22, 2005 Author Posted May 22, 2005 Bump.....OK, what I am trying to do is to automate sending an attachment via Yahoo Mail. The problem is in pressing the "Attach File" button without using the MouseClick coordinates since the coordinates will vary depending on the browser (Firefox) position, ie maximized vs smaller window size.I thought that if I could get the caret position, it could universalize the Mouseclick to work for any browser position.Here's my script:Opt("SendKeyDelay", 0)Opt("WinTitleMatchMode", 2)Winactivate("Firefox")send('!dhttp://us.f526.mail.yahoo.com/ym/Compose?login=1&To=&intl=us&.intl={enter}') Call ('HourGlass') Sleep (1000)Send ("myemailaddress{Enter}{tab}Attached File{tab}Here is the attached file")$pos = WinGetCaretPos ( )MouseClick ("left", $pos[0] + 50, $pos[1] + 94,1, 0); This is the line that would univeralize the Attach File button position Send ('{tab}{enter}')Sleep (1000)MouseClick ("Left", 787, 233)Send ("{tab 3}{Enter}")Sleep (1000)Send ('{tab 4}{Down}{PgUP}{Down}{enter}')Func HourGlass() Do Sleep(10) Until MouseGetCursor()= 2EndFunc Unfortunately, WinGetCaretPos ( ) does not work with multiple mdi windows and returns an erroneous position. There has got to be a workaround. Right?
/dev/null Posted May 22, 2005 Posted May 22, 2005 Unfortunately, WinGetCaretPos ( ) does not work with multiple mdi windows and returns an erroneous position. There has got to be a workaround. Right?From the help of WinGetCaretPos()"WinGetCaretPos might not return accurate values for Multiple Document Interface (MDI) applications if absolute CaretCoordMode is used. See example for a workaround. Note: Some applications report static coordinates regardless of caret position!"See the example code of WinGetCaretPos() in the help file.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now