AutoHotkey Community

It is currently May 27th, 2012, 2:52 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: November 24th, 2009, 9:52 pm 
Offline

Joined: October 29th, 2009, 10:03 pm
Posts: 50
Sorry for opening a new thread!

I have a 2 display setup, with @ each 1 Internet explorer 7 window with different tabs open.
and i have a Focus problem between them!

When i run the code below: lastname data is copied from left window, and paste at the right textbox of the right window. Thats alright

But at the 2nd action(firstname, copy/paste)
The left screen doesn't focus with: pwb:=iWeb_getwin("Contact: ")
So i tried the green lines(ifWinNotActive).
This works for the Right screen but not for left, because its not complete.

Because the Title text after Contact: is changed with every new Contact.

I tried also the url
Code:
pwb:=iWeb_getwin("http://dummyadress/sfa/conts/edit.aspx?id={9EF12E53-9AAC-DC11-B02A-005056877E90}")


But Bold part is changing also with Contact change
http://dummyadress/sfa/conts/edit.aspx?id={9EF12E53-9AAC-DC11-B02A-005056877E90}

If have some more info:
This is how the Title lookslike:
Contact: Brink, Richard - Windows Internet Explorer
Where contact name (Brink, Richard) is changed at new load.

I lookup with Webrecorder where the page gets the Title:
it is a [innertext]=Contact: Brink
Code:
msgbox % iWeb_getDomObj(pwb,"455")
iWeb_clickDomObj(pwb,"455")
iWeb_setDomObj(pwb,"455", "Contact: Brink")

Read from HTML: <TD class=formTitle noWrap>Contact: Brink</TD>


I use the latest AHK build 1.0.47.00. and updated COM library from 8 oct, and iWeb library from 22 nov.

Is there a way, out there, to get focus between these 2 windows??

Thank you! Image
Code:
 
#include COM.ahk
#include iWeb.ahk
COM_CoInitialize()

$0::
;WinWait, Contact:  - Windows Internet Explorer,
;IfWinNotActive, Contact:  - Windows Internet Explorer, , WinActivate, Invoeren persoon - Windows Internet Explorer,
;WinWaitActive, Contact:  - Windows Internet Explorer,
sleep 50
Clipboard :=
pwb:=iWeb_getwin("Contact: ") ;Window left Display
COM_Invoke(pwb, "document.all.item[lastname].focus"), ; Textbox to capture
sleep 50
Send, {CtrlDown}a{CtrlUp}{CtrlDown}c{CtrlUp}
ClipWait, 0.2  ; wait 0.2 sec for copy operation to happen

if ErrorLevel   ; error is trown when timeout occurs without a clipboard copy operation
{
   
}
else
{
WinWait, Invoeren persoon - Windows Internet Explorer,
IfWinNotActive, Invoeren persoon - Windows Internet Explorer, , WinActivate, Invoeren persoon - Windows Internet Explorer,
WinWaitActive, Invoeren persoon - Windows Internet Explorer,
sleep 50
pwb:=iWeb_getwin("Invoeren persoon") ;Window right display
iWeb_setDomObj(pwb,"ctl00xKxHxMAxFAxIAxgeslachtEdit_input", "man")
COM_Invoke(pwb, "document.all.item[ctl00_K_H_MA_FA_IA_achterNaamEdit].focus"), ; Textbox to paste
sleep 100
Send, ^v
}
sleep 100
WinWait, Contact:  - Windows Internet Explorer,
IfWinNotActive, Contact:  - Windows Internet Explorer, , WinActivate, Invoeren persoon - Windows Internet Explorer,
WinWaitActive, Contact:  - Windows Internet Explorer,
sleep 50
Clipboard :=
pwb:=iWeb_getwin("Contact: ")
COM_Invoke(pwb, "document.all.item[firstname].focus"),
sleep 50
Send, {CtrlDown}a{CtrlUp}{CtrlDown}c{CtrlUp}
ClipWait, 0.2  ; wait 0.2 sec for copy operation to happen

if ErrorLevel   ; error is trown when timeout occurs without a clipboard copy operation
{
   
}
else
{
WinWait, Invoeren persoon - Windows Internet Explorer,
IfWinNotActive, Invoeren persoon - Windows Internet Explorer, , WinActivate, Invoeren persoon - Windows Internet Explorer,
WinWaitActive, Invoeren persoon - Windows Internet Explorer,
sleep 50
pwb:=iWeb_getwin("Invoeren persoon")
COM_Invoke(pwb, "document.all.item[ctl00_K_H_MA_FA_IA_roepNaamEdit].focus"),
sleep 100
Send, ^v
}
sleep 100
COM_Release(objIE)
COM_Term()
return


omg Thisss thread: IE Active Tab!!!! is the answer...:
http://www.autohotkey.com/forum/viewtopic.php?p=231093#231093

But i have no noobie idea to use it with my code :cry:
Can someone please give me somesort of example am stuck here.

_________________
The signature is away at the moment, please leave a message after the beep...


Last edited by VibrantLife on November 25th, 2009, 12:25 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2009, 12:23 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
Apparently the recorder isn't catching the whole window title...maybe this will work?


Code:
#include COM.ahk
#include iWeb.ahk
COM_CoInitialize()

$0::
Clipboard=
WinGet, iList, List, ahk_class IEFrame
Loop % iList {
  current:=iList%A_Index%
  WinGetTitle, tVar, ahk_id %current%
  if InStr(tVar,"Contact: ")
    break
}

tVar:=RegExReplace(tVar," - Windows Internet Explorer")
pwb:=iWeb_getWin(tVar) ;Window left Display
. . .


But why are you sending focus to the field to copy the data? You could use iWeb functions to copy the data straight out of the field:

Code:
lastname:=iWeb_getDomObj(pwb,"lastname")
;COM_Invoke(pwb, "document.all.item[lastname].focus"), ; Textbox to capture
;sleep 50
;Send, {CtrlDown}a{CtrlUp}{CtrlDown}c{CtrlUp}
;ClipWait, 0.2  ; wait 0.2 sec for copy operation to happen
. . .
iWeb_setDomObj(pwb,"ctl00xKxHxMAxFAxIAxgeslachtEdit_input", "man")
;COM_Invoke(pwb, "document.all.item[ctl00_K_H_MA_FA_IA_achterNaamEdit].focus"), ; Textbox to paste

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2009, 12:30 am 
Offline

Joined: October 29th, 2009, 10:03 pm
Posts: 50
sinkfaze wrote:
Apparently the recorder isn't catching the whole window title...maybe this will work?


Code:
#include COM.ahk
#include iWeb.ahk
COM_CoInitialize()

$0::
Clipboard=
WinGet, iList, List, ahk_class IEFrame
Loop % iList {
  current:=iList%A_Index%
  WinGetTitle, tVar, ahk_id %current%
  if InStr(tVar,"Contact: ")
    break
}

tVar:=RegExReplace(tVar," - Windows Internet Explorer")
pwb:=iWeb_getWin(tVar) ;Window left Display
. . .


But why are you sending focus to the field to copy the data? You could use iWeb functions to copy the data straight out of the field:

Code:
lastname:=iWeb_getDomObj(pwb,"lastname")
;COM_Invoke(pwb, "document.all.item[lastname].focus"), ; Textbox to capture
;sleep 50
;Send, {CtrlDown}a{CtrlUp}{CtrlDown}c{CtrlUp}
;ClipWait, 0.2  ; wait 0.2 sec for copy operation to happen
. . .
iWeb_setDomObj(pwb,"ctl00xKxHxMAxFAxIAxgeslachtEdit_input", "man")
;COM_Invoke(pwb, "document.all.item[ctl00_K_H_MA_FA_IA_achterNaamEdit].focus"), ; Textbox to paste


Thank Thank Thank you!
i will test this right away

edit:

OH wait!!
I just use:
Code:
iWeb_setDomObj(pwb,"ctl00xKxHxMAxFAxIAxgeslachtEdit_input", "man")

to set a multiple option list to male.

Question is: how do i send
lastname from:
Code:
lastname:=iWeb_getDomObj(pwb,"lastname")

to??:
Code:
iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_achterNaamEdit", "")


I need clipboard?
Code:
iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_achterNaamEdit", clipboard)


or will this work?

Code:
iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_achterNaamEdit", pwb,"lastname")

_________________
The signature is away at the moment, please leave a message after the beep...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2009, 12:57 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
Literal strings must be quoted, variables can be sent as is:

Code:
iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_achterNaamEdit",lastname)

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2009, 1:45 am 
Offline

Joined: October 29th, 2009, 10:03 pm
Posts: 50
Uhm.. i test these 2 scripts, but neither of one do something, On Winxp sp3 with IExplorer 7. What am i doin wrong¿

Code:
#include COM.ahk
#include iWeb.ahk
COM_CoInitialize()

$0::
Clipboard=
WinGet, iList, List, ahk_class IEFrame
Loop % iList {
  current:=iList%A_Index%
  WinGetTitle, tVar, ahk_id %current%
  if InStr(tVar,"Contact: ")
    break
}

tVar:=RegExReplace(tVar," - Windows Internet Explorer")
pwb:=iWeb_getWin(tVar) ;Window left Display

lastname:=iWeb_getDomObj(pwb,"lastname")
iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_achterNaamEdit", lastname)

sleep 50

WinGet, iList, List, ahk_class IEFrame
Loop % iList {
  current:=iList%A_Index%
  WinGetTitle, tVar, ahk_id %current%
  if InStr(tVar,"Contact: ")
    break
}
tVar:=RegExReplace(tVar," - Windows Internet Explorer")
pwb:=iWeb_getWin(tVar) ;Window left Display

firstname:=iWeb_getDomObj(pwb,"firstname")
iWeb_setDomObj(pwb,"document.all.item[ctl00_K_H_MA_FA_IA_roepNaamEdit", firstname)

COM_Release(objIE)
COM_Term()
return


It should switch between windows so i thought this might work but isn't :

Code:
#include COM.ahk
#include iWeb.ahk
COM_CoInitialize()

$0::
Clipboard=
WinGet, iList, List, ahk_class IEFrame
Loop % iList {
  current:=iList%A_Index%
  WinGetTitle, tVar, ahk_id %current%
  if InStr(tVar,"Contact: ")
    break
}
tVar:=RegExReplace(tVar," - Windows Internet Explorer")
pwb:=iWeb_getWin(tVar) ;Window left Display

lastname:=iWeb_getDomObj(pwb,"lastname")
sleep 50
WinGet, iList, List, ahk_class IEFrame
Loop % iList {
  current:=iList%A_Index%
  WinGetTitle, tVar, ahk_id %current%
  if InStr(tVar,"Invoeren persoon")
    break
}
tVar:=RegExReplace(tVar," - Windows Internet Explorer")
pwb:=iWeb_getWin(tVar) ;Window Right Display

iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_achterNaamEdit", lastname)
sleep 50

Clipboard=
WinGet, iList, List, ahk_class IEFrame
Loop % iList {
  current:=iList%A_Index%
  WinGetTitle, tVar, ahk_id %current%
  if InStr(tVar,"Contact: ")
    break
}
tVar:=RegExReplace(tVar," - Windows Internet Explorer")
pwb:=iWeb_getWin(tVar) ;Window left Display

firstname:=iWeb_getDomObj(pwb,"firstname")
sleep 50
WinGet, iList, List, ahk_class IEFrame
Loop % iList {
  current:=iList%A_Index%
  WinGetTitle, tVar, ahk_id %current%
  if InStr(tVar,"Invoeren persoon")
    break
}
tVar:=RegExReplace(tVar," - Windows Internet Explorer")
pwb:=iWeb_getWin(tVar) ;Window Right Display

iWeb_setDomObj(pwb,"document.all.item[ctl00_K_H_MA_FA_IA_roepNaamEdit", firstname)

COM_Release(objIE)
COM_Term()
return

_________________
The signature is away at the moment, please leave a message after the beep...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2009, 5:06 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
You need to put some error checks into the script and once you've used the window loop to identify the potentially vague window you shouldn't need to do it again:

Code:
#include COM.ahk
#include iWeb.ahk

$0::
Clipboard=
WinGet, iList, List, ahk_class IEFrame
errlvl=1
Loop % iList {
  current:=iList%A_Index%
  WinGetTitle, tVar, ahk_id %current%
  if InStr(tVar,"Contact: ") {
    errlvl=0 ; sets errlvl to 0 so script will not error out
    break
  }
}
if (errlvl=1) { ; if window not found
  MsgBox, 48, Warning, the window loop was unable to locate the appropriate window.
  return
}

WinActivate, %tVar% ; if window found will
win:=RegExReplace(tVar," - Windows Internet Explorer")
COM_CoInitialize()
pwb:=iWeb_getWin(win) ;Window left Display
firstname:=iWeb_getDomObj(pwb,"firstname")
lastname:=iWeb_getDomObj(pwb,"lastname")
COM_Release(pwb)
WinActivate, Invoeren persoon
pwb:=iWeb_getWin("Invoeren persoon") ;Window Right Display
iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_roepNaamEdit", firstname)
iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_achterNaamEdit", lastname)
COM_Release(pwb)
COM_CoUnInitialize()

return

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2009, 5:47 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
from the iweb library
Code:
iWeb_Activate(sTitle)
activates the window and tab of the tab matching the full or partial title

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 26th, 2009, 12:59 am 
Offline

Joined: October 29th, 2009, 10:03 pm
Posts: 50
tank wrote:
from the iweb library
Code:
iWeb_Activate(sTitle)
activates the window and tab of the tab matching the full or partial title


Tank!

What i need to do, or write code to get focus between
2 IExplorer Window Tab Title name's:

(Tabtitlename:)-> Contact:
(Tabtitlename:)-> Invoeren persoon

How do i trigger/fire that fine script?

I read "Change the condition here as appropriate!"
Like.how...I'm confused,
i need a small direction to digest the tutorial :shock:

Code:
iWeb_Activate(sTitle)
{
; thanks Sean
; http://www.autohotkey.com/forum/viewtopic.php?p=231093#231093
   DllCall("LoadLibrary", "str", "oleacc.dll")
   DetectHiddenWindows, On
;~    Winshow,% "ahk_id " HWND:=COM_Invoke(pwb:=iWeb_getwin(sTitle),"HWND")
;~    COM_Release(pwb)
   ;WinRestore,% "ahk_id " HWND
   WinActivate,% "ahk_id " HWND
   WinWaitActive,% "ahk_id " HWND,,5

   ControlGet, hTabBand, hWnd,, TabBandClass1, ahk_class IEFrame
   ControlGet, hTabUI  , hWnd,, DirectUIHWND1, ahk_id %hTabBand%

   If   hTabUI && DllCall("oleacc\AccessibleObjectFromWindow", "Uint", hTabUI, "Uint",-4, "Uint", COM_GUID4String(IID_IAccessible,"{618736E0-3C3D-11CF-810C-00AA00389B71}"), "UintP", pacc)=0
   {
      Loop, %   COM_Invoke(pacc, "accChildCount")
        If   paccChild:=COM_Invoke(pacc, "accChild", A_Index)
          If   COM_Invoke(paccChild, "accRole", 0) = 0x3C
          {
            paccTab:=paccChild
            Break
          }
          Else   COM_Release(paccChild)
      COM_Release(pacc)
   }
   If   pacc:=paccTab
   {
      Loop, %   COM_Invoke(pacc, "accChildCount")
        If   paccChild:=COM_Invoke(pacc, "accChild", A_Index)
          If   COM_Invoke(paccChild, "accName", 0) = sTitle   ; Change the condition here as appropriate!
          {
            COM_Release(pwb),VarSetCapacity(pwb,0),VarSetCapacity(HWND,0)
            COM_Invoke(paccChild, "accDoDefaultAction", 0)
            COM_Release(paccChild)
            Break
          }
          Else   COM_Release(paccChild)
      COM_Release(pacc)
   }
            WinActivate,% sTitle



When i try Tab Title Google:
Nothing happens.
Code:
#Include COM.ahk

iWeb_Activate(sTitle)
{
; thanks Sean
; http://www.autohotkey.com/forum/viewtopic.php?p=231093#231093
   DllCall("LoadLibrary", "str", "oleacc.dll")
   DetectHiddenWindows, On
;~    Winshow,% "ahk_id " HWND:=COM_Invoke(pwb:=iWeb_getwin(sTitle),"HWND")
;~    COM_Release(pwb)
   ;WinRestore,% "ahk_id " HWND
   WinActivate,% "ahk_id " HWND
   WinWaitActive,% "ahk_id " HWND,,5

   ControlGet, hTabBand, hWnd,, TabBandClass1, ahk_class IEFrame
   ControlGet, hTabUI  , hWnd,, DirectUIHWND1, ahk_id %hTabBand%

   If   hTabUI && DllCall("oleacc\AccessibleObjectFromWindow", "Uint", hTabUI, "Uint",-4, "Uint", COM_GUID4String(IID_IAccessible,"{618736E0-3C3D-11CF-810C-00AA00389B71}"), "UintP", pacc)=0
   {
      Loop, %   COM_Invoke(pacc, "accChildCount")
        If   paccChild:=COM_Invoke(pacc, "accChild", A_Index)
          If   COM_Invoke(paccChild, "accRole", 0) = 0x3C
          {
            paccTab:=paccChild
            Break
          }
          Else   COM_Release(paccChild)
      COM_Release(pacc)
   }
   If   pacc:=paccTab
   {
      Loop, %   COM_Invoke(pacc, "accChildCount")
        If   paccChild:=COM_Invoke(pacc, "accChild", A_Index)
          If   COM_Invoke(paccChild, "accName", 0) = Google   ; Change the condition here as appropriate!
          {
            COM_Release(pwb),VarSetCapacity(pwb,0),VarSetCapacity(HWND,0)
            COM_Invoke(paccChild, "accDoDefaultAction", 0)
            COM_Release(paccChild)
            Break
          }
          Else   COM_Release(paccChild)
      COM_Release(pacc)
   }
            WinActivate,% sTitle
}

_________________
The signature is away at the moment, please leave a message after the beep...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 26th, 2009, 1:18 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
um dont alter the function??? why would you do that
Code:
iweb_init()
iWeb_Activate("Contact")
sleep,2000
iWeb_Activate("Invoeren persoon")
iweb_term()

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 27th, 2009, 3:44 pm 
Offline

Joined: October 29th, 2009, 10:03 pm
Posts: 50
tank wrote:
um dont alter the function??? why would you do that
Code:
iweb_init()
iWeb_Activate("Contact")
sleep,2000
iWeb_Activate("Invoeren persoon")
iweb_term()


Alright! :D Tabswitching works perfectly

But the transport of the text from one to another tab is EXtremly slow
I also had to add:
Code:
pwb:=iWeb_getwin(" ")

Otherwise it wasn't copying anything.

I also tried to iwebinit/term @ every iwebactivate but doesn't speed it up.

Am i missing something¿

Code:
#include COM.ahk
#include iWeb.ahk

COM_CoInitialize()

$0::
iweb_init()
iWeb_Activate("Contact: ")
pwb:=iWeb_getwin("Contact: ")            
lastname:=iWeb_getDomObj(pwb,"lastname"),

iWeb_Activate("Invoeren persoon")
pwb:=iWeb_getwin("Invoeren persoon")
iWeb_setDomObj(pwb,"ctl00xKxHxMAxFAxIAxgeslachtEdit_input", "man"),
iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_achterNaamEdit", lastname),

iWeb_Activate("Contact: ")
pwb:=iWeb_getwin("Contact: ")
firstname:=iWeb_getDomObj(pwb,"firstname"),

iWeb_Activate("Invoeren persoon")
pwb:=iWeb_getwin("Invoeren persoon")
iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_roepNaamEdit", firstname),

iWeb_Activate("Contact: ")
pwb:=iWeb_getwin("Contact: ")
middlename:=iWeb_getDomObj(pwb,"middlename"),

iWeb_Activate("Invoeren persoon")
pwb:=iWeb_getwin("Invoeren persoon")
iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_tussenvoegselsEdit", middlename),

iweb_term()
COM_Release(objIE)
COM_Term()
return

_________________
The signature is away at the moment, please leave a message after the beep...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 27th, 2009, 6:54 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
there is no need whatsoever to switch tabs using the iweb functions they work even if the tab isnt visible and IE is minimized

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 27th, 2009, 7:19 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
VibrantLife wrote:
Am i missing something?


Yes. As you said previously, the viewer isn't retrieving the full title of the Contact page, you need to get something that will get the correct page title for you:

Code:
#include COM.ahk
#include iWeb.ahk

$0::
iweb_init()
WinGet, iList, List, ahk_class IEFrame
Loop % iList {
  current:=iList%A_Index%
  WinGetTitle, tVar, ahk_id %current%
  if InStr(tVar,"Contact: ")
    break
}
tVar:=RegExReplace(tVar," - Windows Internet Explorer")
pwb:=iWeb_getWin(tVar) ; instead of iWeb_getWin("Contact: ")
firstname:=iWeb_getDomObj(pwb,"firstname")
middlename:=iWeb_getDomObj(pwb,"middlename")
lastname:=iWeb_getDomObj(pwb,"lastname")
COM_Release(pwb) ; release pointer to Contact page
pwb:=iWeb_getwin("Invoeren persoon") ; create new pointer to 'Invoeren persoon'
iWeb_setDomObj(pwb,"ctl00xKxHxMAxFAxIAxgeslachtEdit_input",firstname)
iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_tussenvoegselsEdit", middlename)
iWeb_setDomObj(pwb,"ctl00_K_H_MA_FA_IA_achterNaamEdit",lastname)
iWeb_Activate("Invoeren persoon")
COM_Release(pwb) ; instead of COM_Release(objIE)
iWeb_Term()
return

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2009, 7:51 pm 
Offline

Joined: October 29th, 2009, 10:03 pm
Posts: 50
Great! I didn't know Com & iweb works so lightning fast.
It paste text instantly, simply amazing :D i'm so happy with this!
Thanks guys!!

I still copy telephonenr's with clipboard.
Can this with Com & iweb also?

Something like:

Code:

$0::

iweb_init()
WinGet, iList, List, ahk_class IEFrame
Loop % iList {
  current:=iList%A_Index%
  WinGetTitle, tVar, ahk_id %current%
  if InStr(tVar,"Contact: ")
    break
}
tVar:=RegExReplace(tVar," - Windows Internet Explorer")
pwb:=iWeb_getWin(tVar)

telephone1:=iWeb_getDomObj(pwb,"telephone1") ; Get telephonenr1 split it in areacode and subscribercode with RegexReplace:

telephone1_Areacode := RegexReplace(telephone1, "^\s*\(?0*(\d+)\)?", "$1") ; without clipboard the tabs aren't needed, 't are tabs?
    StringReplace, telephone1_Areacode, telephone1_Areacode, -, %A_Space%, All
    StringReplace, telephone1_Areacode, telephone1_Areacode, %A_Space%,,All

telephone1_SubscrNr := RegexReplace(telephone1, "^\s*\(?0*(\d+)\)?", "$2")
    StringReplace, telephone1_SubscrNr, telephone1_SubscrNr, -, %A_Space%, All
    StringReplace, telephone1_SubscrNr, telephone1_SubscrNr, %A_Space%,,All

COM_Release(pwb)

pwb:=iWeb_getwin("Invoeren persoon")

iWeb_setDomObj(pwb,"igtxtctl00_K_H_MA_FA_IA_bereikbaarheid_TW_InvoerUserControl_landNrEdit", "31") ; = Landcode field, i just put landcode 31 in it

iWeb_setDomObj(pwb,"igtxtctl00_K_H_MA_FA_IA_bereikbaarheid_TW_InvoerUserControl_netNrEdit", telephone1_Areacode) ; paste First part of telephonenr1 Areacode

iWeb_setDomObj(pwb,"igtxtctl00_K_H_MA_FA_IA_bereikbaarheid_TW_InvoerUserControl_abonneeNrEdit", telephone1_SubscrNr) ; = paste second part of telephonenr1 subscribernr
iWeb_Activate("Invoeren persoon")
COM_Release(pwb)
iWeb_Term()
return


I think i need to leave tabs behind and split the RegexReplacecode in Two but i can't figure out which part where to use.

Image

Landcodenr, Areacodenr, Subscribernr fields

_________________
The signature is away at the moment, please leave a message after the beep...


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: rbrtryn, Yahoo [Bot] and 21 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group