Jump to content
Macro Express Forums

Get Control


camarosource

Recommended Posts

I understand that the GET CONTROL can be used to run Mouse moves, clicking buttons and type text HIDDEN in the background, however is there a way to run PAGE UP/DOWN?

 

I need a part where it will jump to the BOTTOM of a page.. I figure it would need to click PAGE DOWN but I don't see a way of running keyboard buttons like these.

Link to comment
Share on other sites

Use the Text Type command. It does whatever you would normally do. If, for example, you wanted to page down in a document, you would normally hit the PageDown key. Using Macro Express the command would be:

Text Type: <PAGE DOWN>

Link to comment
Share on other sites

how would it know that I want this to work in the BACKGROUND with the use of the GET CONTROL? Once you use a GET CONTROL command does everything you enter into the code after that act like it's in the background already?
To send the text to a Control choose the 'Send Text to Control' option in the Text Type command dialog.
Link to comment
Share on other sites

how would it know that I want this to work in the BACKGROUND with the use of the GET CONTROL? Once you use a GET CONTROL command does everything you enter into the code after that act like it's in the background already?
To send the text to a Control choose the 'Send Text to Control' option in the Text Type command dialog.

The thing is Kevin, that's not what I had asked.

 

I was asking how I would send a PAGE UP/DOWN command int the BACKGROUND while the foreground is not effected.

 

If you cannot use PAGE UP/DOWN in a Get Control Evironment, HOW can I? Let's say I have a browser with a website opened in the background. I want the page on the website to stroll down to the very bottom of the page and so I can execute so the MOUSE moves to a certain X/Y location in the get control invironment so I can send text to it.

 

Or is there NO WAY to have it somehow SCROLL down the entire page in the background?

 

I have a page with a form at the bottom (requires scrolling down to the very bottom).. how can I? Thanks

Link to comment
Share on other sites

If the Control is in the background, using the Text Type command with the Send Text to Control chosen will send it as you expect. As a test, create a macro that does the following:

  • Launch IE
  • Goto a web page
  • Capture the page to Control %C1%
  • Now launch something in the forground, say Notepad
  • Set the Notepad window so that you can see part of the web page
  • Now Text Type <PAGE DOWN> to the %C1% Control
  • You will see the web page scroll in the background

Link to comment
Share on other sites

If the Control is in the background, using the Text Type command with the Send Text to Control chosen will send it as you expect. As a test, create a macro that does the following:
  • Launch IE
     
  • Goto a web page
     
  • Capture the page to Control %C1%
     
  • Now launch something in the forground, say Notepad
     
  • Set the Notepad window so that you can see part of the web page
     
  • Now Text Type <PAGE DOWN> to the %C1% Control
     
  • You will see the web page scroll in the background

Tried that but it's not working.

 

[With Microsoft window loaded already before running this macro]

 

This is the exact code: <REM2:Microsoft><ACTIVATE2:Microsoft><REM2:><CAPCONTROL:T:1:1:><LAUNCHDEL2:0:01C:\WINDOWS\notepad.exe><TEXTTYPECT:1:<END>><DELAY:1><TEXTTYPECT:1:<HOME>><DELAY:1><TEXTTYPECT:1:<END>><DELAY:1><TEXTTYPECT:1:<HOME>>

 

 

Activate "Microsoft" <- Activate only
Capture Control (Control Focused) [Save to C1] (Capture using text : OFF)
Program Launch (Launch program only) Notepad
Text Type <END> [Send text to control C1]
Delay 1 sec
Text Type <HOME> [Send text to control C1]
Delay 1 sec
Text Type <END> [Send text to control C1]
Delay 1 sec
Text Type <HOME> [Send text to control C1]

 

Here is what happens:

 

1. Jumps to the Microsoft browser.

2. It launches Notepad and I can see the browser in the background.

3. NOTHING happens in the browser that is behind the Notepad

 

Did I do this wrong? I want this TEST macro to:

 

1. Jump to the Microsoft window and activate it

2. make it as C1 so I can send instructions to IT and not the forground

3. Load Notepad

4. Send a END command to jump to the bottom of the page.

5. pause for 1 second

6. Send a HOME command to jump back to the top of the page.

7. Pause for 1 second

8. Send a END command to jump to the bottom of the page.

 

HELP.

Link to comment
Share on other sites

When sending text to a Window Control the special keys like <PAGE UP>, <PAGE DOWN>, <SHIFTD> and <SHIFTU> cannot be sent.

 

However, there is a way to scroll down and scroll up in IE. Typing a space will scroll down. Typing a shift-space will scroll up. I assume this will only work if the cursor is not in a field on the web page.

 

These examples work:

 

To scroll down:

    Text Type:     // this contains a space and ‘Send Text to Control’ is enabled

To scroll up:

    Text Type: <SHIFTD>    // the ‘Type Text Normally’ (not ‘Send Text to Control’) is selected
   Text Type:                    // this contains a space and ‘Send Text to Control’ is selected
   Text Type: <SHIFTU>    // the ‘Type Text Normally’ (not ‘Send Text to Control’) is selected

The reason Joe's example did not work for you is because you did not send <PAGE DOWN> as specified. You sent <HOME> and <END>. It turns out that the space in <PAGE DOWN> is what caused IE to scroll.

 

There may be a key sequences that perform the same functions as <HOME> and <END> in IE but I did not find them by typing other keystrokes into IE.

Link to comment
Share on other sites

Ok. That scroll works, but not the mouse movement and clicking isn't working without interfering with the forground.

 

Activate "Microsoft" <- Activate only
Capture Control (Control Focused) [Save to C1] (Capture using text : OFF)
Program Launch (Launch program only) Notepad
Mouse Single Left Click on Control C1 (Advance - COORDINATES; 56 / 121)

 

The mouse click doesn't seem to work.

 

I want to be able to run this script so I can be going things in the foreground, (TYPING and using the mouse) and in the BACKGROUND, it's clicking on specific regions.. but it's not working?

Link to comment
Share on other sites

From the Help file.

Note: Not every button, menu item or component on a program is actually a Control. Sometimes the only control in a given program is the window or dialog that pops up when the program starts. We have also noticed that many of Microsoft's programs seem to have fewer controls than programs from other manufacturers. How the controls work will depend upon the way the program you are working with is designed.

 

Items on web pages such as buttons and edit boxes are not actually controls, they are graphics. Macro Express will not be able to see them as the controls do not exist.

Link to comment
Share on other sites

From the Help file.
Note: Not every button, menu item or component on a program is actually a Control. Sometimes the only control in a given program is the window or dialog that pops up when the program starts. We have also noticed that many of Microsoft's programs seem to have fewer controls than programs from other manufacturers. How the controls work will depend upon the way the program you are working with is designed.

 

Items on web pages such as buttons and edit boxes are not actually controls, they are graphics. Macro Express will not be able to see them as the controls do not exist.

In that case, why can't you just have it click on a specific X/Y location with the mouse? That's the problem i'm having. It isn't working.

Link to comment
Share on other sites

OK.. It's been 3 days and I STILL cannot get the answer I am looking for.. So I'll try 1 last time and describe EXACTLY what I am trying to get this to do. Someone PLEASE reply with the EXACT way on how to do this. Little bits of info back and forth is really frustrating :( Especially like it's 1 reply ever 1 or 2 days..

 

I'ml going to try this again from the beginning:

 

NOTE: ALL of this is to work IN THE BACKGROUND. ANYTHING I do in the FOREGROUND (using keyboard to write letters, using the mouse in a paint program, etc...) are COMPLETELY unaware of this script work.

 

OK.. so. ("Microsoft" is just for me testing)

 

[i ALREADY have a browser open with a page open with the title "Microsoft"

 

1. I want to Activate this window (Assuming you must activate it so you can use the macro on)

 

2. LEFT MOUSE CLICK on a SPECIFIC X/Y region

 

3. SCROLL DOWN TO END of this page (type text with a space seems to work to scroll 1 page at a time)

 

4. LEFT MOUSE CLICK a SPECIFIC X/Y region

 

5. Have a certain MSG typed where it clicked (actually a form on the page)

 

6. Pause 3 Seconds

 

7. LEFT MOUSE CLICK a SPECIFIC X/Y region

 

SO.. Can someone PLEASE give me the EXACT SCRIPT to do this? Remember ALL of this is to be done COMPLETELY HIDDEN in the background. I want to be able to work on the computer in the foreground and not even know that this is working. Perhaps if you could paste the DIRECT EDITOR SCRIPT (unless the msgboard will corrupt some code in which case please post it EXACTLY how I do this, step-by-step, with ANY and ALL TOGGLES that must be ON/OFF.. Thanks.

 

basically so I don'y need to reply again except for "AWESOME!! THANK YOU SO MUCH FOR THE CODE, THAT WORKED PERFECTLY!!" :P:P;)

Link to comment
Share on other sites

Camarosource -

 

One more nasty post like your last one and you are out of here. I guarantee it.

 

The reality of any online forum is this: you think your problem is the most important one in the world. Others don't.

 

People are doing their best to help you here. I spent a good hour of my own time trying to find a solution for you. Maybe one exists for your problem. Maybe not. But if you want help keep a civil tone in your posts.

Link to comment
Share on other sites

Camarosource -

 

One more nasty post like your last one and you are out of here. I guarantee it.

 

The reality of any online forum is this: you think your problem is the most important one in the world. Others don't.

 

People are doing their best to help you here. I spent a good hour of my own time trying to find a solution for you. Maybe one exists for your problem. Maybe not. But if you want help keep a civil tone in your posts.

WOW.. I'm sorry, I never intended on that sounding "nasty".

 

I posted the msg again that way cause It appeared those who were replying were not entirely understanding my exact question as the answers I was getting were not right. Even you Joe, (The author of the program? who would know his own program inside and out) wasn't working ;-) :P

 

I posted the msg as descriptive as possible to help others replying understand what it was about so they didn't reply and waste their time only to be wrong. :P:P

 

Please ignore the "additude" perhaps thought to be given to that msg, I meant it in the most sincere intention. Thanks.

Link to comment
Share on other sites

NOTE: ALL of this is to work IN THE BACKGROUND. ANYTHING I do in the FOREGROUND (using keyboard to write letters, using the mouse in a paint program, etc...) are COMPLETELY unaware of this script work.

 

5. Have a certain MSG typed where it clicked (actually a form on the page)

I believe the two requirements of yours that I have quoted are mutually exclusive. In general, the TEXT TYPE command operates on the foreground window, i.e. the one with the focus, so I can't see how you could achieve what you want.

Link to comment
Share on other sites

NOTE: ALL of this is to work IN THE BACKGROUND. ANYTHING I do in the FOREGROUND (using keyboard to write letters, using the mouse in a paint program, etc...) are COMPLETELY unaware of this script work.

 

5. Have a certain MSG typed where it clicked (actually a form on the page)

I believe the two requirements of yours that I have quoted are mutually exclusive. In general, the TEXT TYPE command operates on the foreground window, i.e. the one with the focus, so I can't see how you could achieve what you want.

I thought that at first but there is an option in the TEXT TYPE called "Send text to Control" then you select the control variable.

Link to comment
Share on other sites

Macro Express was not specifically designed to run in the background. And neither are active Windows windows. Yes, you can do certain things with windows that are minimized or hidden, but these are not true background tasks. The biggest obstacle to what you are trying to do, however, is that your computer has just a single mouse and keyboard, which Windows assumes is being used in the window that currently has focus.

 

In an attempt to do simulated background tasks, Macro Express uses some API calls to send information to captured Window Controls. The Windows Control concept is very much dependant on how the target application is written. What works in one may not work in another. It has been my experience that Internet Explorer has very few, if any, useful Controls.

 

That being said, there are certain things that you can try. One feature is the ability to Text Type strings into a captured Control, which you are already familiar with. By the way, I was surprised at the limited number of navigation keys that Internet Explorer accepts in whatever Controls it has.

 

For your mouse activity you should be able to use the Mouse Click on Control command. The problem is that web pages have no Controls. You can, however, use offset coordinates to target your clicks. Look at the Advanced tab in the "Mouse Click on Control" dialog. Try to capture a known Control in Internet Explorer, determine the offset values to the coordinates you want to click, and then fill in the appropriate X and Y fields.

 

I am not sure how sending text and mouse clicks directly to background Controls will affect whatever it is you are doing in the focused window, or vice-versa. You may see intermingled text or strange mouse activity.

 

Can someone PLEASE give me the EXACT SCRIPT to do this
It is not possible to give you an exact script. It is your project and only you can create the exact script needed. You already know what your macro needs to do becuase you made a list of the steps. And the list certainly seems reasonable.

 

Even you Joe, (The author of the program? who would know his own program inside and out)
Not I. I did not write Macro Express and neither do I work for them, although I can certainly understand why a person would think so. I wrote the Macro Express Explained book, published the PGM Functions Library (along with Paul Thornett, my co-conspirator), and my company sponsors this forum.

 

I posted the msg again that way cause It appeared those who were replying were not entirely understanding my exact question
This sometimes happens within forums to be sure. However, after re-reading the posts in this topic, I think everyone understood from the beginning what you were attempting.

 

What you are attempting may or may not work. All we can do in this forum is point out the commands and concepts to try.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...