| View previous topic :: View next topic |
| Author |
Message |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Fri Dec 04, 2009 5:23 am Post subject: |
|
|
I had made a few changes since the version you used. Here is a copy of the script you posted (with those updates) if you want to check it out. IMO, we don't need to remove the outlines if another tab is selected. (but I didn't change that in the script)
| tank wrote: | | i found it you didnt update the title so i replaced it in the controlget with %GuiWinTitle% | I didn't change that. However, I did change the following:
| Code: | #IfWinActive iWebBrowser2 Learner Build ID: 2.5
; to
#IfWinActive iWebBrowser2 Learner |
_________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Fri Dec 04, 2009 6:32 am Post subject: |
|
|
| jethrow wrote: | | I had made a few changes since the version you used. Here is a copy of the script you posted (with those updates) if you want to check it out. |
And we both missed the fact that the left click/copy function was bass ackwards. I uploaded your revised version with that correction as Build 2.6.1.
| jethrow wrote: | | IMO, we don't need to remove the outlines if another tab is selected. (but I didn't change that in the script) |
I only considered it after I decided to make all other tabs pause automatically, and I had to think about it for a while before I made the change. Ultimately my reasoning came down to this: the outline is only particularly useful when on the Viewer tab since it re-assures you're on the element you want to get data on in the Viewer. If you're not on that tab, the outline serves little purpose (especially if the script is paused). On another note, if you're switching to some other task that requires IE but is not related to usage of the Learner while the Learner is still open, the red border just becomes a nuisance feature. Granted, you can disable it from the menu but it would be more user-friendly, IMO, to have it shut off when on a different tab.
Also I'm concerned what expenses we're incurring in memory and processor usage. I'm not sure exactly how to benchmark it, though, but it wouldn't hurt to find ways to cut back if possible. If this change is undesireable I have no qualms with that, just thought I'd make my reasoning clear.
| tank wrote: | I didn't change that. However, I did change the following:
| Code: | #IfWinActive iWebBrowser2 Learner Build ID: 2.5
; to
#IfWinActive iWebBrowser2 Learner |
|
Ugh, another thing I screwed up. That is also fixed in 2.6.1. _________________ Try Quick Search for Autohotkey or see the tutorial for newbies.
Last edited by sinkfaze on Fri Dec 04, 2009 2:41 pm; edited 1 time in total |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Fri Dec 04, 2009 12:41 pm Post subject: |
|
|
%GuiWinTitle% is the best way versions of the title stay uniform i think we should use that instead what if i decide to this weekend rename it? _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Fri Dec 04, 2009 1:55 pm Post subject: |
|
|
| tank wrote: | | %GuiWinTitle% is the best way versions of the title stay uniform i think we should use that instead what if i decide to this weekend rename it? |
In the #IfWinActive command? I don't believe it allows variables. _________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Fri Dec 04, 2009 4:11 pm Post subject: |
|
|
there is no reason it wouldnt _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Fri Dec 04, 2009 4:17 pm Post subject: |
|
|
I think sinkfaze is correct on this one. I had originally changed it to #IfWinActive %GuiWinTitle% with no success. Perhaps this would be better?
| Quote: | | #IfWinActive iWebBrowser2 Learner ahk_class AutoHotkeyGUI |
| #IfWinActive documentation wrote: | | Variable references such as %Var% are not currently supported. Therefore, percent signs must be escaped via `% to allow future support for them. |
_________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Fri Dec 04, 2009 4:21 pm Post subject: |
|
|
grrr i hate being wrong and it appears i am
that really sucks _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Fri Dec 04, 2009 5:52 pm Post subject: |
|
|
| sinkfaze wrote: | | jethrow wrote: | | Is there any particular reason not to use the SetBatchLines, -1 setting? | It does not play well with the script tester. Makes it work extremely slow. |
How about making this setting dynamic - so that it is -1 if the Viewer Tab is active, and 10ms otherwise? Here would be the code (insert after GetWin: label): | Code: | GetWin:
ControlGet, ActiveTab, tab,, SysTabControl321, %GuiWinTitle%
SetBatchLines, % ActiveTab=1 ? -1 : "10ms" |
NOTE - we could then use the ActiveTab variable to prevent the user from unpausing the program if the Viewer tab isn't active.
Also, just a thought, how about having the program only update the webpage data if a certain key is held down while you move the cursor. Then you wouldn't even need the "PAUSE" functionality. Something like this: | Code: | | % !GetKeyState("Shift","P") ? "" : IE_HtmlElement() |
_________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Sat Dec 05, 2009 10:46 am Post subject: |
|
|
I made a few changes to the Viewer tab - based on sinkfaze's build2.6- put the frames in a ListView
- removed the mouse coordinates & "To Clipboard" checkbox
- CTRL button must be held for Viewer Tab info to be updated
- added the current element tag name to the WinTitle
- couple other minor changes
Here is the script if you would like to check it out. Also, I added a dynamic SetBatchLines - mentioned in the previous post. _________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Last edited by jethrow on Sun Dec 06, 2009 4:37 am; edited 3 times in total |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Sat Dec 05, 2009 2:02 pm Post subject: |
|
|
| jethrow wrote: | | Code: | | % !GetKeyState("Shift","P") ? "" : IE_HtmlElement() |
| really why didnt i think of this i think its good _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Sat Dec 05, 2009 5:44 pm Post subject: |
|
|
| tank wrote: | | ... i think its good | I updated my previous link to incorporate this - except I used the CTRL key rather than Shift. I went though and commented-out the "PAUSE" functionallity. Also, added the current element tag name to the WinTitle. _________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Sat Dec 05, 2009 6:40 pm Post subject: |
|
|
@ jethrow
Since every newly launched thread can have a fresh SetBatchLines setting placing the directive in that spot in the script won't matter. The only applicable launch point would be right when the RunScript subroutine is called. It doesn't seem to matter much how you tinker with a SetBatchLines directive there, some other portion of the script (acting on the default SetBatchLines setting) is colliding with it for priority; not even specifying Critical will override it.
Ironically, if you remove the SetBatchLines directive from the auto-execute section, then specify SetBatchLines -1 in the RunScript subroutine, it works fine.
One thing that will improve performance that for some reason I've had in many of my test scripts but never one that I've uploaded for review is SetControlDelay -1.
| jethrow wrote: | | I didn't remove the "PAUSE" functionality yet though - can you guys think of any reason why we shouldn't? |
Basically for the same reason disabling the element outline on the other tabs is probably a good idea in the end; given the workload this script will put out, if it doesn't need to be running, it shouldn't. Also, the table ListView hotkey relies upon the page title in the Viewer tab, if the script can't be paused and the user inadvertently passes the mouse onto another IE window it's going to retrieve that page's table contents and not the intended one. This same argument would also apply to the Source and Forms tabs, I suppose.
After some more thought I'm thinking it might be a good idea to optionally allow unpaused and element outline on the Script tab, since if a user is writing a script they'll probably want to retrieve page elements while they're on that page; I'll look into an update with that this evening. In the meantime I've updated my previous build (but did not update the number) with a few things:
- added SetControlDelay -1 in the auto-execute and SetBatchLines -1 to the RunScript subroutine for performance reasons
- corrected a couple of minor issues with forms retrieval so every form will have a name and the first found form will populate in the dropdown and the edit box
- set 'Left Click/Copy' to default "off" when switching to the Script tab
_________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Sat Dec 05, 2009 6:48 pm Post subject: |
|
|
| sinkfaze wrote: | | Basically for the same reason ... and not the intended one. | This was very true, until I made this change:
| Code: | | % !GetKeyState("CTRL","P") ? "" : IE_HtmlElement() ;GetKeyState("LButton","P") ? "" : IE_HtmlElement() | Now, releasing the CTRL button is the same as pausing the script was before this change. The page title in the Viewer tab won't be updated.
| sinkfaze wrote: | | Since every newly launched thread can have a fresh SetBatchLines setting placing the directive in that spot in the script won't matter. | I did notice increased performance for the outlining though . I'm sure I don't understand threads as well as you, but the A_BatchLines setting is -1 for the IE_HtmlElement() function, which is where speed is important. I suppose it could now be changed to: | Code: | GetWin:
SetBatchLines, % !GetKeyState("CTRL","P") ? "10ms" : -1 |
I will check out the changes you made. _________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Sat Dec 05, 2009 11:54 pm Post subject: |
|
|
| jethrow wrote: | This was very true, until I made this change:
| Code: | | % !GetKeyState("CTRL","P") ? "" : IE_HtmlElement() ;GetKeyState("LButton","P") ? "" : IE_HtmlElement() | Now, releasing the CTRL button is the same as pausing the script was before this change. The page title in the Viewer tab won't be updated.[/code] |
I like that.
| jethrow wrote: | I suppose it could now be changed to: | Code: | GetWin:
SetBatchLines, % !GetKeyState("CTRL","P") ? "10ms" : -1 |
|
Actually if SetBatchLines isn't a auto-executed directive you could just put SetBatchLines -1 and there shouldn't be a problem. The problem with the Script Writer only occurs when SetBatchLines -1 is specified in the auto-execute.
Somehow edit box detection has been "broken" in your version, it returns a iWeb_getDomObj call when you press Ctrl+e over an edit box. I checked the code of the hotkey in yours against mine and it's the same so you might want to review your recent changes to see if you can sniff out what may have caused that. _________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Sun Dec 06, 2009 5:04 am Post subject: |
|
|
| sinkfaze wrote: | | Somehow edit box detection has been "broken" in your version ... | It was a result of the changes in the VIEWER tab - I had removed this line: | Code: | | Gui, Add, Edit, x150 y255 w70 h10 Hidden vHTMLTag ReadOnly | The Ctrl+e hotkey wasn't having a value to work with for the HTMLTag variable. I made this variable global in the IE_HtmlElement() function and re-uploaded the script. (btw - this required me to actually look at the ^e hotkey - nice coding sinkfaze )
| sinkfaze wrote: | | Actually if SetBatchLines isn't a auto-executed directive you could just put SetBatchLines -1 and there shouldn't be a problem. The problem with the Script Writer only occurs when SetBatchLines -1 is specified in the auto-execute. | Ok, but since this is a continuously executing script, we want the batchlines setting to be at 10ms, except when outlining elements (Ctrl is pressed) - right?
| SetBatchLines documentation wrote: | | on most systems a setting of 10ms will prevent the script from using any more than 50% of an idle CPU's time |
_________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
|