SetFocus not working on Maxthon

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
rjw524
Pro Scripter
Posts: 104
Joined: Wed May 09, 2012 9:45 pm
Location: Michigan

SetFocus not working on Maxthon

Post by rjw524 » Wed May 23, 2012 10:02 pm

SetFocus question...

Most of my macros are related to a specific site where I do about 90% of my work.

Every time I try to use the SetFocus command on Maxthon or Firefox (basically any web browser other than IE) nothing happens. The macro just stands still.

The only way I've been able to get my macros to go to Maxthon or Firefox is by using a run command that opens the program and goes directly to the site I want to open. This works, but it's limiting.

EXAMPLE:

In this site I may have to work in a particular project file on that site, there may be 50 "pages" in that project file to go through by having the macro click "next page".

Here's the problem...

If the macro becomes stuck on Page 20 for some reason, and I need to stop it to clean something up on the site and start it again, the macro will open maxthon, go to the site, open my project, and start at page 1 all over again instead of where I want to point it.

How do I get SetFocus to work on these browsers or make a workaround other than "run"?

Thanks,

RJ

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed May 23, 2012 10:32 pm

While you are debugging, you could add a line at the appropriate spot to Press Next Page "n" number of times.

You could hard code the number, and modify as you proceed along, or you could make it an Input command with a default value to prompt you every time you run.

After debugging is done, just comment out this section (may want to keep it for future debugs vs. deleting it).
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

rjw524
Pro Scripter
Posts: 104
Joined: Wed May 09, 2012 9:45 pm
Location: Michigan

Post by rjw524 » Thu May 24, 2012 3:26 am

Bob Hansen wrote:While you are debugging, you could add a line at the appropriate spot to Press Next Page "n" number of times.

You could hard code the number, and modify as you proceed along, or you could make it an Input command with a default value to prompt you every time you run.

After debugging is done, just comment out this section (may want to keep it for future debugs vs. deleting it).
Hi Bob,

Thanks for taking a look at this, I appreciate it.

That solution still doesn't fix my problem.

A) It doesn't solve the Macro's inability to set it's focus on the web browser I'm using

B) The problem isn't the macro going to the next page. It does that just fine.

The problem is that without the ability to set the Macro's focus to the browser I have open, the only way for my macro to go to the browser is to use the "run" command.

So, My macro will only work by launching the designated browser all over again, going to the website url all over again, logging in, all over again and opening the project from page 1 all over again.

If I could use the SetFocus command, like I should be able to, I could write the macro in a way where it just goes to the browser, and as long it saw a certain item on the site (using an Image Recognition command) it would start again, whether it was page 1 or page 49.

Does that clarify the problem I'm having?

Thanks,

RJ

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu May 24, 2012 5:26 am

Have no idea why setfocus would not work. SetFocus>Mozilla* works fine on my computer. Could you post a failing code sample?

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Thu May 24, 2012 3:11 pm

Have you tried...

Code: Select all

SetFocus>Mozilla Firefox*

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts