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 ... 8, 9, 10, 11, 12  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
frescalus



Joined: 19 Nov 2009
Posts: 49

PostPosted: Wed Dec 09, 2009 6:43 pm    Post subject: Reply with quote

ok maybe I can't read or don't know what I'm doing but I get some errors when I try to turn this into a .exe

anyone edumacate me in the right direction?
Back to top
View user's profile Send private message
jethrow



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

PostPosted: Wed Dec 09, 2009 7:51 pm    Post subject: Reply with quote

The first post of this thread gives you a download with an exe already in it. If you are trying to compile a script, make sure you have all the appropriate libraries (iWeb & COM), and they are in the "Lib" folder (you could even just #Include them). Finally, how could we help if you don't supply the error messages you're getting?
_________________
AHKL, COM_L,Webpage Controls,Donate to AHK
Back to top
View user's profile Send private message
sinkfaze



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

PostPosted: Fri Dec 11, 2009 8:22 am    Post subject: Reply with quote

@ tank,

I'm sure you've caught it already but I thought I'd point it out anyway since I've been banging my head against a wall for a good couple of hours trying to figure it out; iWeb_fireEvents() in its current state doesn't do anything. Apparently something about the way the handle is being passed to the function is not acceptable:

Code:
ele:=COM_Invoke(pWin,"document.all[" sName "].")


It also struck me as odd that there was no call to "fireEvent" in the iWeb_fireEvents() function. Anyway, if you write the function in a more literal format it works fine:

Code:
iWeb_fireEvents(pdsp,sName) {

  COM_Error(0)
  COM_Invoke(pdsp,"document.all[" sName "].fireEvent","onfocus")
  COM_Invoke(pdsp,"document.all[" sName "].fireEvent","onblur")
  COM_Invoke(pdsp,"document.all[" sName "].fireEvent","onchange")
  COM_Invoke(pdsp,"document.all[" sName "].fireEvent","onclick")
  COM_Invoke(pdsp,"document.all[" sName "].fireEvent","onkeyup")
  COM_Error(1)
   
}


And since we can pass the referring function's pWin to iWeb_fireEvents() we don't have to traverse the frame path again. You probably have a much more elegant solution waiting in the wings, just thought I'd mention it.

I have also uploaded Build 2.7 for review:
  • Re-tooled layout for the Viewer tab in accordance with jethrow's last rewrite, which eliminated the coordinates subsection.
  • Added support for iWeb_SelectOption() back to the Ctrl+e hotkey and added a while loop to extract the index number.
  • Ctrl+e hotkey will now work on all tabs and will return the user to the Viewer tab.
  • Set Left Click/Copy to off when selecting the Script Writer tab.

The default options are getting mildly buggy so I might need some help getting those straightened out. Here's what I'm aiming for:

  • Viewer Tab: All options (Always on top/Element Outline/Left-click/Copy) are on but can be turned off and remembered if the user scrolls away from the tab and comes back.
  • Script Writer Tab: Left-click/Copy option will always be turned off by default when it is initially scrolled to.
  • All other tabs: Element Outline will always be turned off by default when it is initially scrolled to.

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



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

PostPosted: Fri Dec 11, 2009 8:59 am    Post subject: Reply with quote

sinkfaze wrote:
I have also uploaded Build 2.7 for review
As usual, great work Very Happy . Here's a couple of (hopefully constructive) small critisizms on the viewer tab:
  • How about spacing the frames LV headers to leave a gap at the end wide enough for a vertical scroll bar. Otherwise, once you get 3 frames, you get the annoying horizontal scroll bar a the bottom. I had the settings at LV_ModifyCol(1, 70), LV_ModifyCol(2,53), LV_ModifyCol(3,102), LV_ModifyCol(4,102)
  • Also in the LV, I had wanted to use the header Index as well; however, I thought this might be somewhat confusing, considering there are actual frame indexes (ie. frames[1].frames[3])
  • You completely removed the section to allow for clicking on the LV to copy to the clipboard - were you meaning to do this? In the WM_LBUTTONDOWN function, starting with If( A_GuiControl = "VarListView" )
  • What does the To Clipboard checkbox actually do anymore? Isn't this the same as the left click copy option?
sinkfaze wrote:
The default options are getting mildly buggy so I might need some help getting those straightened out.
I'll look into this.
_________________
AHKL, COM_L,Webpage Controls,Donate to AHK
Back to top
View user's profile Send private message
sinkfaze



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

PostPosted: Fri Dec 11, 2009 3:01 pm    Post subject: Reply with quote

Most of the stuff you mentioned regarding the ListView is just my inability to know what exactly I was copying and pasting from your last build to mine and why (although I did want to tidy up the column headers). I'll try to polish that up better today. I'm still a little hesitant on using a frames ListView since the ability to copy a mass of data from it is not quite fleshed out (and the example that started us on this was a page with five frames(!)), but I definitely like the concept.

jethrow wrote:
What does the To Clipboard checkbox actually do anymore? Isn't this the same as the left click copy option?


It's similar but not exactly the same. The Left-Click/Copy subroutine could probably be adapted to handle that but it then you sacrifice the choice between appending to the bottom of the script automatically or copying to Clipboard so you can paste yourself. And if the option is available on the Script Writer tab and selecting a function on the Viewer tab will be "writing" script it'd be nice to preserve the same functionality there.

For similar reasons I wanted the Left-Click/Copy option turned off by default on the Script Writer tab. Difficult to paste something when you can't click in the box without overwriting your Clipboard.

jethrow wrote:
I'll look into this.


Thanks, I'm quite sure the tab subroutine is a mess. I was about 5 minutes from not uploading anything last night because I couldn't pinpoint a bug that was randomly leaving certain rolled tabs unrolled. I copied and pasted my way to sanity, though. 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: Fri Dec 11, 2009 3:41 pm    Post subject: Reply with quote

When my wife gets out of the hopital i will be getting back into this I much apologise for my absence in my own project thanks for carrying on without me
_________________
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: 2718
Location: the tunnel(?=light)

PostPosted: Fri Dec 11, 2009 8:05 pm    Post subject: Reply with quote

jethrow wrote:
I'll look into this.


Well if you're really looking for the business you can try troubleshooting Build 2.7.2 Twisted Evil . This build contains the beta implementation of ini file usage; currently the ini file tracks the last known x/y of the upper left corner and the last known toggle state of Always on Top, Element Outline and Left-Click/Copy. It appears to track them and remember them from script load to script load just fine, but when you start switching between tabs all heck seems to break loose and the script remembers false settings.

For your reference when looking over the file, I created a Prefs subroutine that runs whenever the script is reloaded or closed and a startup subroutine which adjusts the script according to the saved preferences. Gosub, Startup now supercedes the previous Gosub, ontop once the GUI is loaded.
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message
jethrow



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

PostPosted: Sat Dec 12, 2009 7:01 pm    Post subject: Reply with quote

I have been working on trying to get the Element Outline to move as you scroll a webpage - which I have working, except in frames (I'm finding this to be particularly tricky in frames). So I thought, how about having the element outline only function when the IE_HtmlElement() function is being called? (ie - only when the CTRL button is pressed) Otherwise, the outline will disappear. Then we wouldn't even need an Element Outline menu option.

@sinkfaze
What's do you think about this? (I would like your opinion before I do this because it will require several changes)

@ tank
I also would like your opinion, but I know you're busy. (sorry to hear about you wife - I hope she's getting better)
_________________
AHKL, COM_L,Webpage Controls,Donate to AHK
Back to top
View user's profile Send private message
tank



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

PostPosted: Sat Dec 12, 2009 7:52 pm    Post subject: Reply with quote

how bout something in the middle
the outline stays but if the content moves the outline disappears?
_________________
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: 794
Location: Iowa, USA

PostPosted: Sat Dec 12, 2009 10:47 pm    Post subject: Reply with quote

tank wrote:
how bout something in the middle
the outline stays but if the content moves the outline disappears?
Here are two issues I'm encountering:
  1. Differentiating between if the entire webpage has been scrolled, or if just the frame document has been scrolled. This is what I meant by tricky, though I think it's doable.
  2. I'm using the documentElement.scrollTop and/or body.scrollTop document properties to determine if scrolling has occurred. Do you know of a better way? The issue comes up when the frame is in a different domain. Aren't these properties then inaccessible? This would make determining if scrolling has occurred quite difficult.
This is why I was thinking the outlining could serve for identifying the element, but then disappear as soon as the CTRL button is released. It would also decrease the workload of the script a little. (it would be nice if there were a reliable way to outline the element within the webpage, rather than external GUIs)
_________________
AHKL, COM_L,Webpage Controls,Donate to AHK
Back to top
View user's profile Send private message
sinkfaze



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

PostPosted: Sun Dec 13, 2009 12:27 am    Post subject: Reply with quote

I like the idea of the border disappearing when Ctrl is released but I can also see instances where someone might like that border to remain (if possible). Would it be possible to support both with default off?
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message
jethrow



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

PostPosted: Sun Dec 13, 2009 6:02 am    Post subject: Reply with quote

sinkfaze wrote:
Would it be possible to support both with default off?
Well yeah, but that's how it is now. IMO, it becomes annoying when the outline remains if the webpage (or frame document) has been scrolled. That's why I was trying to support this, but as I stated above, I'm not sure if this will be a possibility.
_________________
AHKL, COM_L,Webpage Controls,Donate to AHK
Back to top
View user's profile Send private message
jethrow



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

PostPosted: Sun Dec 13, 2009 1:18 pm    Post subject: Reply with quote

Here's a link to a modified Build 2.7.2. I made the following changes:
  • added support to LClick/copy ListView "cells"
  • adjusted width for ListView header "Index"
  • added SetWorkingDir, %A_ScriptDir% so iWeb.ini is created in A_ScriptDir
  • moved the DIRECTIVES section above the CONSTANTS/PARAMETERS section
  • adjusted the Element Outline to only be visible when the "CTRL" button is pressed
  • removed Element Outline menu item/preference
  • added OnExit - program will execute "Prefs" label when exited/reloaded
  • added "Rolled_Up" variable - keeps track if GUI is rolled up (F1), and stores in INI file
  • rewrote "IsTab" label - Left Click/Copy will be turned off everytime "Script Writer" tab is selected. Upon selecting another tab, Left Click/Copy will return to previous state
  • minor changes to "Contents copied..." tooltip

... not sure what you guys like this or not, but if you do want to auto-remove the Element Outline when the "CTRL" button is released, we could replace the continuously running "getwin" label with a hotkey - which should be easier on system performance:
Code:
~Ctrl::
SetBatchLines, -1
Ctrl_Pressed:=True
While( Ctrl_Pressed )
   IE_HtmlElement()
Outline("Hide")
SetBatchLines, 10ms
Return
~Ctrl Up:: Ctrl_Pressed:=False

EDIT - I also made the following change:
  • variable "oFrm", which is for the ^e hotkey, is set at the bottom of the IE_HtmlElement() function

_________________
AHKL, COM_L,Webpage Controls,Donate to AHK
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Dec 14, 2009 7:05 pm    Post subject: Reply with quote

I noticed in the iWeb_SetDomObj() function, you can't set the value/text of an element to a value with a comma in it, because it gets treated as a list. So I propose adding a test to check if "obj" is a list or not:
Code:
iWeb_setDomObj(pwb,obj,t,frm="")
   {
      If   pWin   :=   iWeb_DomWin(pwb,frm)
      {
         If  col      :=   COM_Invoke(pWin,   "document.all")
         {
            If InStr(obj,",") ; test if obj is a comma delimited list
            {
               StringSplit,tt,t,`,
               Loop,Parse,obj,`,
               {
                  If   itm      :=   COM_Invoke(col,"item", A_LoopField)   ;if this fails there really isnt any need to do below
                  {
                     StringReplace,tt%A_Index%,tt%A_Index%,,,`,,all   ;   unescape all commas in text extracted always
            ;~          making invoke take integers as Strings  ",   VT_BSTR:=8"
            ;~          http://www.autohotkey.com/forum/viewtopic.php?p=221631#221631
                     COM_Invoke_(itm,   v   :=   iWeb_inpt(itm)   ?   "Value="   :   "innerHTML=",   VT_BSTR:=8,   tt%A_Index%)
                     iWeb_FireEvents(itm)
                     COM_Release(itm)
                     d=1
                  }
               }
            }
            Else
            {
               If   itm      :=   COM_Invoke(col,obj)
               {
                  StringReplace,t,t,,,`,,all
                  COM_Invoke_(itm,   v   :=   iWeb_inpt(itm)   ?   "Value="   :   "innerHTML=",   VT_BSTR:=8,   t)
                  iWeb_FireEvents(itm)
                  COM_Release(itm)
                  d=1
               }
            }      
            COM_Release(col)
         }
         
         COM_Release(pWin)
      }
         
      Return d
   }
Back to top
jethrow



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

PostPosted: Mon Dec 14, 2009 7:07 pm    Post subject: Reply with quote

Embarassed - the last post is mine.
_________________
AHKL, COM_L,Webpage Controls,Donate to AHK


Last edited by jethrow on Mon Dec 14, 2009 7:08 pm; edited 1 time in total
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 ... 8, 9, 10, 11, 12  Next
Page 9 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