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
Sean



Joined: 12 Feb 2007
Posts: 2225

PostPosted: Thu Nov 19, 2009 1:29 am    Post subject: Reply with quote

A very ambitious project, tank.
Back to top
View user's profile Send private message
tank



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

PostPosted: Thu Nov 19, 2009 3:44 am    Post subject: Reply with quote

Sean wrote:
A very ambitious project, tank.
Yea well i figured since jethrow and sinkfaze had demonstrated such interest I might as well get off my arse. Its all your fault any way Twisted Evil If you hadn't produced COM and ACC and held my hand quite a few times i wouldn't be swamped with all this work Very Happy. Feel free to knock me in the head if you spot something I'm steering wrong of course Wink

Once objects are merged to mainstream I'll of course convert the code.

Funny thing tho you calling any one ambitious
lets see here
COM
ACC
CDO
Screen Capture with Transparent Windows and Mouse Cursor
Explorer Windows Manipulations
Invoking directly ContextMenu of Files and Folders
StdoutToVar
Voice Recognition COM
Extract Informations about TrayIcons
DDE
MD5, SHA1, CRC32 of the File
on and on
matter of fact a good 70 percent of every usefull function or idea I have ever used have come from your I think your almost up to 40-50 threads

any how we will see if it flies



@ sinkfaze
the basics of using events on the document


Code:
psink:=COM_ConnectObject(pdoc,   "events_")


then you create functions prefixed with events_ that are actual types of events
obviously this would be a click event
Code:
events_onclick()
{

global pdoc

sourceindex:=com_invoke(pdoc,"parentwindow.event.srcElement.sourceindex")
sname:=com_invoke(pdoc,"parentwindow.event.srcElement .name")
sID:=com_invoke(pdoc,"parentwindow.event.srcElement .id")
}
so we just figure out if its an inpout then the type or a link etc based on properties of the element parentwindow.event.srcElement srcElement

design mode is easy too
Code:
COM_Invoke(pdoc,"designmode","on") ; off


I will be adding the following to the iWeb library all of the both the functions that set or get values will also trigger focus blur onchange and onclick

i am also because of this conversation adding the following functions
Code:
iWeb_check(pDisp,sName,checked=true,subIndex=0,frm="")
this will obviously check a box or uncheck a box or radio control it will return the checked status
Code:
iWeb_SelectOption(pDisp,sName,t,method="selectedIndex",frm="")
to manipulate drop downs either by text or option value or selected index which will be a 0 based choice it will return the value of the dropdown
I typically just do this sort of thing with COM but see the average user having great difficulty with these

For capturing form submissions I wouldn’t even bother collecting individual form entries
Get the submit onclick event and then since peld refers to the button.
Code:
Com_invoke(pelt, “form.elements.length”)
returns the number of form elements
Loop thru them
Code:
Com_invoke(pelt, “form.elements[“ a_index-1 “].value”)
to get the values
Code:
Com_invoke(pelt, “form.elements[“ a_index-1 “].type”)
of course to get the element type but basically use the submit buttons onclick event to capture the form and determine input methods

This was the direction I was going to go but I just don’t have the code writing and testing time to do it well. If you have a better approach let me know
_________________
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: 2722
Location: the tunnel(?=light)

PostPosted: Thu Nov 19, 2009 3:02 pm    Post subject: Reply with quote

Not to get too sidetracked, but would you be in favor of adding support for the active window ("A") or for ahk_group windows in iWeb_getWin? I was beta testing a re-write of some of my work scripts using your functions exclusively and found myself having to work around those two areas. Not a big deal but it doesn't seem like it would be too bad to support.

Also, do you think it would be feasible to build the functionality of iWeb_domWin into iWeb_getWin or would that be unnecessary? I only mention that because for some of my beta test scripts I have to intersperse some COM_Invoke statements with the iWeb calls and the vast majority of them would not work with the pwb passed from iWeb_getWin. I had to pass it through iWeb_domWin first to get them to work, then release the pointer from iWeb_domWin before I could continue.

And didn't you say at one time there's a way to call to and retrieve a specific table element's contents?
_________________
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 Nov 19, 2009 4:12 pm    Post subject: Reply with quote

Quote:
support for the active window ("A")
OK
Quote:
ahk_group windows
No
Quote:
iWeb_domWin into iWeb_getWin
No not because of anything else other than it complicates the algorithm of the rest of the iWeb functions and one more thing i think isnt obvious till you do it alot. each time you navigate pwin is destroyed and must be reaquired whereas pwb points to the browser/tab and doesnt get destroyed each time
Quote:
table element's contents
TABLE Element | table Objectdescribes all the methods attributes properties etc
Focus on rows and cells in the collections
Code:
com_invoke(pwb,"document.all.tags[table].item[0].rows[1].cells[2].innertext")
would retreive the first table second row 3rd cell
_________________
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: 2722
Location: the tunnel(?=light)

PostPosted: Thu Nov 19, 2009 4:54 pm    Post subject: Reply with quote

Would it be a worthwhile venture to create an iWeb_getTblObj function?

Quote:
iWeb_getDomObj(pwb,tbl,row,obj,frm="")


Or optionally support retrieving table/row/cell in the web recorder?

BTW I am actually working on developing things for the recorder here too, not just busting your chops. Rolling Eyes Laughing
_________________
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 Nov 19, 2009 5:06 pm    Post subject: Reply with quote

Quote:
BTW I am actually working on developing things for the recorder here too, not just busting your chops
Yes but meaningfull conversation on direction is necesary or you could waste time.
Quote:
table/row/cell in the web recorder?
Let me think on how this would work and see if i can establish a reliable algorythm. If so i dont see why not because this is a very common task even for me. I just never bothered but its a good point
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
Back to top
View user's profile Send private message
tank



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

PostPosted: Thu Nov 19, 2009 5:23 pm    Post subject: Reply with quote

One more thing i think we need to target certain types of automation to record we cant just shoot for a catch all recorder it just simply will turn into a mess

things i see automation requests for and have used professionally
Loginscripts

parsing datasets(tables) to csv. Perhaps we present a gui and allow them to set column headers for a single sheet and put a function call for each datafeild and let the script just pull out each item with it as an automatic function. Users can take the script generated and add custome criteria with scite but the recorder will demonstrate the simple process

filling out forms from data in excell or csv. (special note we wont record the data being parsed from excel or csv but we can provide information on how to enter it with script)

downloading images from a page

ripping youtube vidios there are a few scripts that more or less do this now

word or phrase lookups with a right click user can configure froma a limited supply of search sites wiki google etc

what do you think isnt this enuff to start with can you think of common automateable taks that should be in this list instead?
_________________
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: 2722
Location: the tunnel(?=light)

PostPosted: Fri Nov 20, 2009 12:22 am    Post subject: Reply with quote

I have uploaded a "script pad" GUI for testing purposes. Mostly I'm interested in making sure that the pad's functionality itself is solid. I think this could be a complimentary GUI to anchor to the recorder itself that will record the appropriate functions and give the user a place to test and even output their script. I've included brief explanations of the available options and a test script to try out. Have a look and see what you think.
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.


Last edited by sinkfaze on Mon Nov 23, 2009 7:39 am; edited 1 time in total
Back to top
View user's profile Send private message
tank



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

PostPosted: Fri Nov 20, 2009 1:51 am    Post subject: Reply with quote

I think i like where thats going perhaps a dropdown with the available windows would be better than a series of message boxes
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
Back to top
View user's profile Send private message
jethrow



Joined: 24 May 2009
Posts: 795
Location: Iowa, USA

PostPosted: Fri Nov 20, 2009 2:05 am    Post subject: Reply with quote

I updated my link (3rd post) with a new version of iWebBrowser2 Learner. Some small changes:
  • Utilizes window HWND instead of name for comparisons
  • Checks (iWebBrowser2 object) window Title, HWND, and position each time. If any changed, element outline is removed.
  • Rolling Eyes Previous list item will still execute while program is paused
  • Program starts in Always-On-Top mode
  • WinTitle shows "PAUSED" if program is paused
Also, I had thought about modifying the webpage element properties if you're hovering over them, rather than drawing GUI's. I thought perhaps change the background color, but this wouldn't be effective for images. I also thought about using the style.outline object, though I haven't had consistent results with this. Finally, I tried the elements style.border property, but this could be tricky to change and then change back. What are other people's thoughts? (also, I sometimes get a COM error when trying to access the style object)
_________________
AHKL, COM_L,Webpage Controls,Donate to AHK
Back to top
View user's profile Send private message
sinkfaze



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

PostPosted: Fri Nov 20, 2009 2:20 am    Post subject: Reply with quote

Ugh...those COM errors that appear despite the script functioning as expected will be the death of me. I'm thinking of adding ;COM_Error(0) to the initialization output so the user can uncomment it if necessary and ignore those error messages (even though Sean understandably despises that).
_________________
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: Fri Nov 20, 2009 2:22 am    Post subject: Reply with quote

Jethrow
Modifying the style is precarious at best all tags do not support borders

best to perhaps wrap the outerhtml in a div with a border and remove it when the mouse exits. even so i think the Gui's with some fine tuning will give us our best results

one thing
Code:
SetFormat, Integer, Hex
WinHWND += 0 ; convert HWND from Dec to Hex
why?
you are aware that it works as hex?

ie
Code:
winexist("pagetitle") == com_invoke(pwb,"hwnd")
ahk would show the equal hex value mathimatically the same as the decimal value without converting
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow


Last edited by tank on Fri Nov 20, 2009 2:29 am; edited 2 times in total
Back to top
View user's profile Send private message
sinkfaze



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

PostPosted: Fri Nov 20, 2009 2:23 am    Post subject: Reply with quote

tank wrote:
I think i like where thats going perhaps a dropdown with the available windows would be better than a series of message boxes


Did you mean get and load all windows at load time? I thought about that (but not in a dropdown), I just wouldn't want windows that were opened after the script pad was loaded to be ignored...not that you couldn't force the GUI to load an updated list of windows once 'Initialize' is clicked. I'll have to toy with that thought.
_________________
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: Fri Nov 20, 2009 2:26 am    Post subject: Reply with quote

sinkfaze wrote:
Ugh...those COM errors that appear despite the script functioning as expected will be the death of me. I'm thinking of adding ;COM_Error(0) to the initialization output so the user can uncomment it if necessary and ignore those error messages (even though Sean understandably despises that).
show me what your getting com errors with perhaps i"ll have an idea
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
Back to top
View user's profile Send private message
jethrow



Joined: 24 May 2009
Posts: 795
Location: Iowa, USA

PostPosted: Fri Nov 20, 2009 2:36 am    Post subject: Reply with quote

tank wrote:
why?
you are aware that it works as hex?

Confused Good question - honestly, it wasn't working correctly yesterday Wink . I removed that & updated the link. Also, if anyone finds any disturbing issues with the outlining GUIs, or has ideas on how to improve them, let me know. I rather enjoy enhancing my GUI knowledge.
_________________
AHKL, COM_L,Webpage Controls,Donate to AHK
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 2 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