AutoHotkey Community

It is currently May 27th, 2012, 12:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 226 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 16  Next
Author Message
 Post subject:
PostPosted: November 19th, 2009, 1:29 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
A very ambitious project, tank.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 3:44 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
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: 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 :D. 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

_________________
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 19th, 2009, 3:02 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5482
Location: the tunnel(?=light)
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?

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


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

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
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

_________________
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 19th, 2009, 4:54 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5482
Location: the tunnel(?=light)
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. :roll: :lol:

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


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

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
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

_________________
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 19th, 2009, 5:23 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
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?

_________________
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 20th, 2009, 12:22 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5482
Location: the tunnel(?=light)
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.

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


Last edited by sinkfaze on November 23rd, 2009, 7:39 am, edited 1 time in total.

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

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
I think i like where thats going perhaps a dropdown with the available windows would be better than a series of message boxes

_________________
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 20th, 2009, 2:05 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
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.
  • :roll: 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)

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


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

Joined: March 19th, 2008, 12:43 am
Posts: 5482
Location: the tunnel(?=light)
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).

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2009, 2:22 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
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

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


Last edited by tank on November 20th, 2009, 2:29 am, edited 2 times in total.

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

Joined: March 19th, 2008, 12:43 am
Posts: 5482
Location: the tunnel(?=light)
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.

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


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

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
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

_________________
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 20th, 2009, 2:36 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
tank wrote:
why?
you are aware that it works as hex?

:? 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.

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 226 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 16  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon, maul.esel, SKAN and 7 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