AutoHotkey Community

It is currently May 27th, 2012, 12:21 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 226 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 16  Next
Author Message
 Post subject:
PostPosted: December 4th, 2009, 6:23 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
sinkfaze wrote:
I have upgraded to iWebBrowser2 Learner Build 2.6 for review:
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

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 4th, 2009, 7:32 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
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. :lol: 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. :roll: That is also fixed in 2.6.1.

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


Last edited by sinkfaze on December 4th, 2009, 3:41 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 4th, 2009, 1:41 pm 
Online
User avatar

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

_________________
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: December 4th, 2009, 2:55 pm 
Offline
User avatar

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

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 4th, 2009, 5:11 pm 
Online
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
there is no reason it wouldnt

_________________
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: December 4th, 2009, 5:17 pm 
Offline
User avatar

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

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 4th, 2009, 5:21 pm 
Online
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
grrr i hate being wrong and it appears i am

that really sucks

_________________
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: December 4th, 2009, 6:52 pm 
Offline
User avatar

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

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2009, 11:46 am 
Offline
User avatar

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

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Last edited by jethrow on December 6th, 2009, 5:37 am, edited 3 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2009, 3:02 pm 
Online
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
jethrow wrote:
Code:
% !GetKeyState("Shift","P") ? "" : IE_HtmlElement()
really why didnt i think of this i think its good

_________________
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: December 5th, 2009, 6:44 pm 
Offline
User avatar

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

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2009, 7:40 pm 
Offline
User avatar

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

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2009, 7:48 pm 
Offline
User avatar

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

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2009, 12:54 am 
Offline
User avatar

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

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2009, 6:04 am 
Offline
User avatar

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

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

_________________
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 ... 5, 6, 7, 8, 9, 10, 11 ... 16  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Cristi®, tidbit and 57 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