| View previous topic :: View next topic |
| Author |
Message |
BoBo Guest
|
Posted: Wed Nov 29, 2006 12:51 am Post subject: IE + ControlSendRaw |
|
|
Sending JavaScript Bookmarklets with ControlSend(Raw) to IE's adress field (Edit1) isn't working, while a plein Send works just fine (but its to slow ) Any idea/workarround ? An out of the box Send-/PostMessage (prefered ) I'm stuck.  |
|
| Back to top |
|
 |
ScottEdge
Joined: 14 Aug 2005 Posts: 57 Location: Connecticut,USA
|
Posted: Wed Nov 29, 2006 1:42 am Post subject: |
|
|
| Code: |
ie = Microsoft Internet Explorer
WinActivate %ie%
WinWaitActive, %ie%
StatusBarWait, Done, 60, , %ie%,
ControlSetText Edit1, javascript:with(document.forms[0]){elements[1].value="";elements[2].value="";void(0)}, %ie%
ControlSend Edit1, {Enter}, %ie% |
This is how I do it. What is your code?
To make send faster I like to set the clipboard to what I want to paste in then send ^v. much faster then sending actual data.
| Quote: |
[update] fixed typo in code. sorry about that deleted my value and got the ending quote. |
Last edited by ScottEdge on Thu Nov 30, 2006 3:22 am; edited 1 time in total |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Wed Nov 29, 2006 1:48 am Post subject: |
|
|
| Code: | SetTitleMatchMode, 2
SetControlDelay, 100
WinActivate, Microsoft Internet Explorer
ControlFocus, Edit1, Microsoft Internet Explorer
ControlSendRaw, javascript:document.subscriberAddForm.FirstName.value="BoBo"; void(0);, Microsoft Internet Explorer
ControlSend, {Enter} | If entered manually it's working in 9/10 tries.   |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Wed Nov 29, 2006 1:50 am Post subject: |
|
|
| Quote: | | ControlSendRaw, Edit1, ... |  |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Wed Nov 29, 2006 2:59 am Post subject: |
|
|
I've made it!! 02:55 AM CET
Fixed, several JavaScript typos (spaces,quotation marks,.. )
Replaced ControlSendRaw with ControlSetText (pushed the performance min. 5 times )
Now I'm really really tired. Good night folx *BoBo schnarsching* |
|
| Back to top |
|
 |
BETLOG
Joined: 27 Nov 2006 Posts: 218 Location: Queensland, Australia
|
|
| Back to top |
|
 |
BETLOG
Joined: 27 Nov 2006 Posts: 218 Location: Queensland, Australia
|
Posted: Wed Nov 29, 2006 6:54 am Post subject: |
|
|
| SCottEdge wrote: | [code]
javascript:with(document.forms[0]){elements[1].value="";elements[2].value=";void(0)}, %ie% |
I'm curious: shouldn't there be another quote (") near the end of that line:
javascript:with(document.forms[0]){elements[1].value="";elements[2].value="";void(0)}, %ie% [/quote]
...or am I not understanding something about that syntax? |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed Nov 29, 2006 1:09 pm Post subject: |
|
|
This is probably a typo.
Do your page has frames? This can wreak havoc.
To be sure, paste this in the address bar: javascript:alert(parent.frames.length);
If different of 0, you have frames to take in account. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
BETLOG
Joined: 27 Nov 2006 Posts: 218 Location: Queensland, Australia
|
Posted: Wed Nov 29, 2006 1:34 pm Post subject: |
|
|
| PhiLho wrote: | This is probably a typo.
Do your page has frames? This can wreak havoc.
To be sure, paste this in the address bar: javascript:alert(parent.frames.length);
If different of 0, you have frames to take in account. |
Yes, that code returns '13' ....so I guess i have 13 frames to navigate... gah!
AWESOME...i just figured it out.
You people are excellent...iv'e been pondering this for nearly 2 days, and now i can proceed with my funky script...many thanks.
BTW, the correct answer was:
javascript:top.logframe.document.dailyreportdetailform.elements[39].value="BETLOG";void(0); |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed Nov 29, 2006 2:50 pm Post subject: |
|
|
Good, you figured out the remainder. For those searching, here is a way to have a list of the frames:
javascript:fr = parent.frames; for (var i = 0, l = ''; i < fr.length; i++) { l += fr[i].name + '\n'; } alert(l);
13 frames... They are crazy! 2 is already too much for my taste... _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
BETLOG
Joined: 27 Nov 2006 Posts: 218 Location: Queensland, Australia
|
Posted: Wed Nov 29, 2006 3:04 pm Post subject: |
|
|
| PhiLho wrote: | Good, you figured out the remainder. For those searching, here is a way to have a list of the frames:
javascript:fr = parent.frames; for (var i = 0, l = ''; i < fr.length; i++) { l += fr[i].name + '\n'; } alert(l);
13 frames... They are crazy! 2 is already too much for my taste... |
I always at least TRY to figure it out before asking again.. because I know that people who don;t try to think things out for themselves don't get much help from the experts.
You guys get paid to do this stuff.... so the laest i can do is try a few things and do a bit of googling before saying i don't get it.
This .js is coming back to me... but frames are something iv'e never had to deal with before...and I am sure that this application TRIES to make things confusing - proprietry software and all that kind of thing.
Thanks for the script, that is excellent... i was going to ask for that before i just saved the page and realised that the folders that get created correspond to the individual frames. |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Wed Nov 29, 2006 3:06 pm Post subject: |
|
|
More on referencing frames:
parent = the frameset page
parent.frameName = the particular frame
or
top = the frameset page
top.frameName = the particular frame
If you are dealing with nested frames (frames inside frames), you'd need to reference something like this:
parent.parent.frameName
NB: This might not give the same result as top.parent.frameName. Nested frames are a bitch.
If you are referencing back to a frame that opened a new window, use this to reference the frame that opened the window from the new window:
opener.parent.FrameName
Hope this helps |
|
| Back to top |
|
 |
BETLOG
Joined: 27 Nov 2006 Posts: 218 Location: Queensland, Australia
|
Posted: Wed Nov 29, 2006 3:10 pm Post subject: |
|
|
| n-l-i-d wrote: | More on referencing frames:
....
If you are dealing with nested frames (frames inside frames), you'd need to reference something like this:
....
Hope this helps |
Yeah, they are nested :[
Thanks for the help, it's saved me spending another day googling huge quantities of knowledge just so i can pick out the tiny bits i need to do this one thing.
I have a script already, and it works fine... i just want to make it so the window does not require focus... and i'm getting stumped on the frames and .js syntax i was never very good with... and i'm sooo tired now :)
BUT I WILL GET IT!!!
I WILL...
I MUST WORK ON!
}:] |
|
| Back to top |
|
 |
|