AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Project Development]IE Web Recorder Developers Needed
Goto page Previous  1, 2, 3 ... , 10, 11, 12  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
sinkfaze



Joined: 19 Mar 2008
Posts: 2721
Location: the tunnel(?=light)

PostPosted: Mon Jan 04, 2010 9:27 pm    Post subject: Reply with quote

tank added but didn't explicitly mention (that I recall) a function to add encoding to text when necessary. He was going to correct that but he has a more impotant job than you or I. Wink If you still have a previous copy of the functions it would probably be easiest to revert back to using those, but if you want to fix this copy in the meantime I believe this modification will do it:

Code:
   iWeb_setDomObj(pwb,obj,t,frm="")
   {
   /*********************************************************************
   pwb   -   browser object
   obj   -   object reference; optionally
   t   -   text to place in object;
   frm -   frame reference; optionally,
   Example Usage
   The below will take a browser object, try to get an object called 'username' and set its value/innerHTML to 'john'
   iWeb_setDomObj(pwb,"username","john")
   */
         If   itm      :=   iWeb_GetElementByAll(pwb,obj,0,frm)   ;if this fails there really isnt any need to do below
         {
            ;~    making invoke take integers as Strings  ",   VT_BSTR:=8"
            ;~    http://www.autohotkey.com/forum/viewtopic.php?p=221631#221631 iWeb_uriDecode(str)
            COM_Invoke_(itm,v:=iWeb_inpt(itm) ? "Value=" : "innerHTML=",8,t) ; replace iWeb_UrlEncode(t)
            iWeb_FireEvents(itm)
            COM_Release(itm)
            d=1
         }
      Return d
   }

_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message
n-l-i-d
Guest





PostPosted: Tue Jan 05, 2010 5:39 pm    Post subject: Reply with quote

@tank: FYI, BoBo found a copy of the most important files of the cw_JS-stuff you asked for. Cool

HTH
Back to top
xclr8tr



Joined: 05 Jan 2010
Posts: 8

PostPosted: Wed Jan 06, 2010 10:34 am    Post subject: Please help - desperate Reply with quote

This is probably simple for you guys but i'm ready to tear my hair out...

please look at this post in the help section

http://www.autohotkey.com/forum/viewtopic.php?t=52993
Back to top
View user's profile Send private message
sinkfaze



Joined: 19 Mar 2008
Posts: 2721
Location: the tunnel(?=light)

PostPosted: Wed Jan 06, 2010 2:36 pm    Post subject: Reply with quote

Just thought I'd report back on this since there's been a lull in activity.

Using the values from the ini file to turn on/off things is still a bit problematic as is the script itself retaining the values as to what should be on/off. As stated earlier, I don't use the element outline much so I usually keep it turned off, yet at certain points while using the recorder element outlining will turn itself back on even when I haven't switched tabs for some time. The element outline status and the checked status in the menu also get out of whack. Not sure how to solve this problem though...

Also tank, are we going to be building a help file?
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 2416
Location: Louisville KY USA

PostPosted: Wed Jan 06, 2010 6:15 pm    Post subject: Reply with quote

sinkfaze wrote:
Also tank, are we going to be building a help file?
Yes but time has not been my friend lately

I am not entirely sure i want to "Save Settings" but if we were to i would prefer it was read on load only and saved onexit only
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
Back to top
View user's profile Send private message
xclr8trr
Guest





PostPosted: Thu Jan 07, 2010 4:41 am    Post subject: jethrow's cslid or guid function Reply with quote

jethrow's cslid or guid function

ha ha,

probably doesn't fit with official function naming criteria...

I've been going crazy trying to get the cslid or guid from the form or url because it is used with many more url addressable forms in crm to relate them.

jethrow came up with this code and i didn't see it in the iWeb.ahk - (lib)

here is jethrow's code:
Code:
COM_Init()
pwb := iWeb_GetWin("Window Name Here")
COM_Invoke(pwb, "Navigate2", "javascript:var oId = crmForm.ObjectId")
oId := COM_Invoke(pwb, "document.parentWindow.oId")
MsgBox, %oId%
COM_Release(pwb), COM_Term()


All i did was put an "A" (for active or current ie window) where it asks for ("Windows Name Here")

I think it would be a great contribution to you efforts

Thanks
xclr8trr
Back to top
xclr8tr



Joined: 05 Jan 2010
Posts: 8

PostPosted: Wed Jan 13, 2010 3:16 am    Post subject: thread stalled 'modal' question to get it going Reply with quote

iWeb is beautiful creation as i become more familiar with it.

We need a work around for "Modal windows" even if not iWeb related as others may need it also.

i click on a lookup and it brings up what must be a modal window as there is no page title in learner etc...

stuck and can't get around it, i've seen others recently with same problem working with iWeb etc...

so i understand it doesn't fit into the iWeb model and you don't want to support.

For those of us who are starting out with the cutting edge iWebbrowser2 Learner and have software and OS that is older, can you please provide a work around of any kind even if not supported in iWeb.

Even if stupid simplistic i'm open as i skipped to the more modern innovations in AHK and bypassed the original. (yes you could tell me to start from the beginning but that would be like saying build a sprite on the amiga or trs80 first lol)

i know what needs to be input into the form so is there a way to just skip the dialog (modal) box that pops up and move right along (quick and dirty js inject etc...)...

i'm open to anything at this point, i have looked at recent info and didn't see anything i recognized as a coherent solution.

This could also be added as a special help section to the iWebbrowser2 Learner when you get around to righting the help section.

thanks
xclr8tr
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 2416
Location: Louisville KY USA

PostPosted: Wed Jan 13, 2010 5:40 am    Post subject: Reply with quote

not to be un friendly but this has been answered and this is not a help thread but im especially irritated Mad you havent even read this thread
http://www.autohotkey.com/forum/viewtopic.php?p=314753#314753
If you have a question post it in ask for help post in this thread only if you have code to submit as an idea

Could a MOD please move this and xclr8trs post to ask for help from this one
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
Back to top
View user's profile Send private message
xclr8tr



Joined: 05 Jan 2010
Posts: 8

PostPosted: Wed Jan 13, 2010 6:18 am    Post subject: pissed off lol Reply with quote

hi tank,

actually this is the only piece of code that i am looking at right now, it is greek to me though short of using it in an example format.

I will continue to trudge through it until it makes sense, i assume you are talking about the link from the link you gave that leads to the code???

i'm not purposely trying to piss you off, i just don't have years to study this stuff and am working in a call center environment like your self and looking for a better way.

What better way than to interrogate those who are in the know. coding projects is not my job but has kept us ahead of the curve and from sinking in the quicksand of this crazy market.

when i came to this work it was as a sales mgr and brought with me a lot of experience in excel vba apps, sql, access db gui's, as400 and misc other things which have kept me afloat. i pull off miracles where others can only do there jobs but it is only because i can gain information quickly from those who are in the know and your work doesn't go with out notice.

there are plenty of people i gained and implemented information from who are now highly valued vendors.

i'll work through it, posted here to get your attention which i obviously did because i pissed you off again lol

what the hell is tridentdlg, sounds like some kind of gum i uses to chew Wink

Gotta love ya tank
xclr8tr
Back to top
View user's profile Send private message
frescalus



Joined: 19 Nov 2009
Posts: 49

PostPosted: Tue Jan 19, 2010 9:44 pm    Post subject: Reply with quote

Hi all

Just wanted to post some code here see if it might interest you...let me give you the scenerio I ran into...
I'm running a script that requires getting a value from an object, some of those objects are drop down boxes.. now I'm able to get the index number however I had trouble getting the text...the solution I found is below, please tell me a) will it fit in with the recorder and/or b) am I blind and missed a better way to get a text value from a drop down?

I did copy and paste some stuff from other pieces of code you guys developed FYI... but this might look ugly or I may have overcomplicated things... but take a look...it worked for me so it solved my issue of retrieving text from a drop down box. I could've probably used iWeb_execScript however in some of our internal sites that we have I can't use that as much....

Code:

iWeb_getSelectedOption(pdsp, sName, frm="")
{
   ErrorLevel:=
   If   ErrorLevel:=!(pWin   :=   iWeb_DomWin(pdsp,frm)) ? "failed to get a window handle" : false
      Return ErrorLevel
   COM_Error(0)
   sOption := pWin ? COM_Invoke(pWin, "document.all('" sName "')") : False
   COM_Error(1)
   if !sOption
      Return ErrorLevel:="**** failed to get the dropdown reference ****"
   selected:=sOption ? COM_Invoke(sOption, "selectedIndex") :
   iWeb_FireEvents(sOption)
   
   COM_Error(0)
   textValue := pWin ? COM_Invoke(pWin, "document.all('" sName "').options[" selected "]") : False
   COM_Error(1)
   COM_Release(pWin)
   if !textValue
      Return ErrorLevel:="**** failed to get the text value drop the drop down ****"
   result:=textValue ? Com_Invoke(textValue, "text") :
   iWeb_FireEvents(textValue)
   COM_Release(textValue)
   Return result
}
Back to top
View user's profile Send private message
sinkfaze



Joined: 19 Mar 2008
Posts: 2721
Location: the tunnel(?=light)

PostPosted: Thu Feb 18, 2010 6:26 pm    Post subject: Reply with quote

Since I've found a few things to work on with the iWeb functions (functions and documentation), I had a proposal I wanted to run by you guys.

If iWeb_getTagLen and iWeb_getTagObj are to be added to the standard library, I propose that accommodations for accessing table data be removed form them as they make those particular functions more cumbersome. I suggest that two separate functions be created specifically for dealing with tables, iWeb_getTblLen and iWeb_getTblObj and that iWeb_tableParse be deprecated:

Code:
iWeb_getTagLen(pdsp,tag,frm="") {

  If (tag="table") {
    MsgBox, 48, iWeb Functions
     , Please use the iWeb_getTblLen function to retrieve table length data.
    return 0
  }
  If pWin:=iWeb_DomWin(pdsp,frm)
    res:=COM_Invoke(pWin,"document.all.tags[" tag "].length")
  COM_Release(pWin)
  return res

}

iWeb_getTagObj(pdsp,tag,ind,type="innerText",frm="") {

  If (tag="table") {
    MsgBox, 48, iWeb Functions
     , Please use the iWeb_getTblObj function to retrieve table data.
    return 0
  }
  If pWin:=iWeb_DomWin(pdsp,frm)
    res:=COM_Invoke(pWin,"document.all.tags[" tag "].item[" ind "]." type)
  COM_Release(pWin)
  return res

}


Code:
iWeb_getTblLen(pdsp,t,r=-1,frm="") {

  If pWin:=iWeb_DomWin(pdsp,frm)
    res:=COM_Invoke(pWin,"document.all.tags[table].item[" t "]"
     . ((row < 0) ? ".rows" : "rows[" r "].cells")
     . ".length")
  COM_Release(pWin)
  return res

}

iWeb_getTblObj(pdsp,t,r=-1,c=-1,type="innerText",frm="") {

  If pWin:=iWeb_DomWin(pdsp,frm)
    res:=COM_Invoke(pWin,"document.all.tags[table].item[" tbl "]"
     . ((r >= 0) && (c >= 0) ? ".rows[" r "]".cells[" c "]"
      : ((r >= 0) && (c < 0) ? ".rows[" r "]"
      : ""
     . "." type)
  COM_Release(pWin)
  return res

}


I'm also curious as to if there would be sufficient interest to wrap Sean's IE_GetDocument into an iWeb function, like iWeb_getDoc? I can see where something like this might be beneficial:

Code:
iWeb_getDoc(hWnd="") {

  if !hWnd
    ControlGet,hWnd,Hwnd, ,Internet Explorer_Server1, ahk_class IEFrame
  return IE_GetDocument(hWnd)

}

IE_GetDocument(hWnd)
{
   Static
   If Not   pfn
      pfn := DllCall("GetProcAddress", "Uint", DllCall("LoadLibrary", "str", "oleacc.dll"), "str", "ObjectFromLresult")
   ,   msg := DllCall("RegisterWindowMessage", "str", "WM_HTML_GETOBJECT")
   ,   COM_GUID4String(iid, "{00020400-0000-0000-C000-000000000046}")
   If   DllCall("SendMessageTimeout", "Uint", hWnd, "Uint", msg, "Uint", 0, "Uint", 0, "Uint", 2, "Uint", 1000, "UintP", lr:=0) && DllCall(pfn, "Uint", lr, "Uint", &iid, "Uint", 0, "UintP", pdoc:=0)=0
   Return   pdoc
}

_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 2416
Location: Louisville KY USA

PostPosted: Thu Feb 18, 2010 6:41 pm    Post subject: Reply with quote

sinkfaze wrote:
I'm also curious as to if there would be sufficient interest to wrap Sean's IE_GetDocument into an iWeb function, like iWeb_getDoc? I can see where something like this might be beneficial:
why of what benifet would this be over getting the browser object
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
Back to top
View user's profile Send private message
sinkfaze



Joined: 19 Mar 2008
Posts: 2721
Location: the tunnel(?=light)

PostPosted: Thu Feb 18, 2010 7:19 pm    Post subject: Reply with quote

tank wrote:
why of what benefit would this be over getting the browser object


Well, ease of grabbing modal windows for one thing (an annoying cow if there ever was one). For another I would assume that Sean's rationale for connecting to the Word and Excel objects with GetWord()/GetExcel() would similarly apply to Internet Explorer in using IE_GetDocument(), no?
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 2416
Location: Louisville KY USA

PostPosted: Thu Feb 18, 2010 7:24 pm    Post subject: Reply with quote

sinkfaze wrote:
Well, ease of grabbing modal windows for one thing
then this wont work for them

Code:
ControlGet,hWnd,Hwnd, ,Internet Explorer_Server1, ahk_class IEFrame

since MODALS dont use IEFrame

Further unlike word and excel which do not change the document object IE loads a new document object with every navigation. i know it seems more intuitive to avoid the whole browser object but it just isnt in any case i have found
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
Back to top
View user's profile Send private message
sinkfaze



Joined: 19 Mar 2008
Posts: 2721
Location: the tunnel(?=light)

PostPosted: Thu Feb 18, 2010 7:43 pm    Post subject: Reply with quote

tank wrote:
then this wont work for them
Code:
ControlGet,hWnd,Hwnd, ,Internet Explorer_Server1, ahk_class IEFrame

since MODALS dont use IEFrame


Yes but this would work?

Code:
ControlGet,hWnd,Hwnd, ,Internet Explorer_Server1, ahk_class Internet Explorer_TridentDlgFrame
pdoc:=iWeb_getDoc(hWnd)


Would also prevent someone who wants to use the function from having to search the forums for it anyway. Furthermore the function could be adjusted to accommodate modals and give them precedence for manipulation if they exist at the time the function is called:

Code:
iWeb_getDoc(hWnd="") {

  modal:="ahk_class Internet Explorer_TridentDlgFrame"

  if !hWnd
    ControlGet,hWnd,Hwnd, ,Internet Explorer_Server1
     , % (WinExist(modal) ? modal : "ahk_class IEFrame")
  return IE_GetDocument(hWnd)

}


tank wrote:
Further unlike word and excel which do not change the document object IE loads a new document object with every navigation. i know it seems more intuitive to avoid the whole browser object but it just isnt in any case i have found


Fair enough. Like I said, just interested in some feedback on the idea.
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3 ... , 10, 11, 12  Next
Page 11 of 12

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group