Jump to content
Macro Express Forums

Help With Some Utilities


Messer
 Share

Recommended Posts

Here are some of my problems

 

1. The mouse is lagging. It moves slower than I moved it when I recorded. Even when I tested it on my desktop, it moved way slower. I have discovered that if I delete all the delays between it then move as it should, but the program is puting delays after each mouse position, what do I do so the mouse will move real-time, like it moved when I recorded?

 

2. I want a loop to be exactely 150 seconds. The thing is that by adding up all the delays to result 150 seconds dosent work, as it seems that even a click is somehow taking up time. How can I use such a delay variable, that change in such way that the total loop will result in exactely 150 seconds. Right now the loop is allways delayed by about 0.5 - 1 second per loop, and my only hunch is that the mouse click, and drop plus the only 2 mouse positions that I got in the loop are making this extra delay.

 

3. How can I alt-tab between programs of the same type. What I mean is, when the macro needs to be done, it will alt tab from my current window to the window it must do the macro. This I have succeded by using the Activate or Lunch, but I have 2 clients of the same thing, so they are having the exact name. What I have observed is that it allways pick the last client I was in. How do I make it pick only 1 specific client? (My clients are named for example "client" and "client" and because the name are the same it just pick up the last one I was in".

Also what variable I must use so that after the program is activate and macro is running, when the macro is finished, it will alt-tab again to the last window I was in (for example internet explorer if I was there before the macro switched to "client")

 

If anyone can help I would be highly gratefull.

Thanks

Link to comment
Share on other sites

Hi,

1. You may be able to speed it up ; there is a command; paste some code to sort out the problem?

Macro Control, macro playback speed/ mouse playback speed etc on that command.

2. That might be possible to calculate once you have (1) sorted, or it may be better to speed it up, then wait till a preset time - schedule it to run every 150 secs? (or timer macro on ME3 examples on Web site? - or in this forum)

3. If the 2 programs have different "control" index, you might be able to use "get Control" on each one, and "set focus to control" for C1 or C2, say, for using each one.

4. As you start the macro, "Set String variable" to name of current window title; then at the end, "window activate" T1, or whatever string you used.

Let me know; post some code.

best, Randall

Link to comment
Share on other sites

2. I want a loop to be exactely 150 seconds. The thing is that by adding up all the delays to result 150 seconds dosent work, as it seems that even a click is somehow taking up time. How can I use such a delay variable, that change in such way that the total loop will result in exactely 150 seconds. Right now the loop is allways delayed by about 0.5 - 1 second per loop, and my only hunch is that the mouse click, and drop plus the only 2 mouse positions that I got in the loop are making this extra delay.

It's pretty well impossible to guarantee a period of exactly anything if you'tre working in milliseconds! As you don't have control over other processes that happen to be running on your machine, you cannot guarantee the accuracy of whatever timing mechanism you're using; for example, you cannot possibly determine when a garbage collect operation is about to occur. That's why a given process can take different times to run from one invocation to the next.

 

My best suggestion for you is to store the time at the beginning of a loop, then have your macro check that it's not later than that original time plus 150 seconds, then have your macro wait one second, then loop. If you use the timed delay feature, you're restricted to working in seconds, but you're not taking up any CPU; otherwise you can set a delay in milliseconds - and the CPU will remain fully utilized (but my earlier observations on timing accuracy still hold true).

 

3. How can I alt-tab between programs of the same type. What I mean is, when the macro needs to be done, it will alt tab from my current window to the window it must do the macro. This I have succeded by using the Activate or Lunch, but I have 2 clients of the same thing, so they are having the exact name. What I have observed is that it allways pick the last client I was in. How do I make it pick only 1 specific client? (My clients are named for example "client" and "client" and because the name are the same it just pick up the last one I was in".

Also what variable I must use so that after the program is activate and macro is running, when the macro is finished, it will alt-tab again to the last window I was in (for example internet explorer if I was there before the macro switched to "client")

You'll need to work with window handles in order to achieve this. ME doesn't offer this level of granularity - you'd have to write something external (not difficult) to do this.

Link to comment
Share on other sites

1. The mouse is lagging. It moves slower than I moved it when I recorded. Even when I tested it on my desktop, it moved way slower. I have discovered that if I delete all the delays between it then move as it should, but the program is puting delays after each mouse position, what do I do so the mouse will move real-time, like it moved when I recorded?
I don't know why it would be running slower than when you recorded it. However, as Randall pointed out, there is a command to speed things up. Try the Macro Playback Speed. According to the help if you enter 0.5 in the 'Playback Factor' field the macro will run twice as fast. This causes the delays to be half as long. 0.25 will cause the delays to be one fourth as long.
2. I want a loop to be exactely 150 seconds.
You may be able to use a scheduled macro. Perhaps something like this will work:

Create a second macro that contains the commands that you want to perform after the 150 second delay. Make it a Scheduled Macro. Choose Other for the schedule and enter 150 seconds. Then disable the macro. Inside the main macro run up to the point where you want to begin the 150 second 'loop' and then add a Macro Enable command to enable the second macro.

 

A scheduled macro will be more accurate than a macro loop but it too will not be exact.

3. How can I alt-tab between programs of the same type.
I agree with Randall: you should try the Windows Controls commands. The Windows Controls use the handles that Paul mentions.

 

This is what I would try: I would launch the first instance of the program (or the first dialog within the same program) and then use the Capture Control command to get a control for that window. Then I would launch the second instance of the program and use the Capture Control command to get the control for that window. Be sure to use different control variables. Once you have these two control variables, you can do Alt+Tabs or maybe use the Window Activate command and then use the If Control Focused to see if the window you want has been focused.

Link to comment
Share on other sites

Thank you kindly for the replys, but I realy don't quite understand.

I mean I am very new to this and I can barely understand what should I do.

 

I yet didn't got it how do handle the delays at point 1.

 

For point 2, it looks very complicated and I see how to work with the scheduled macro.

I will eventualy try it as I best think.

 

As for 3 I don't realy know what is this control index or what should I do, or understanding exactely what focused do.

At activate window it says window title, but the title actualy is the same so I realy doubt the macro can realy know witch window to pick.

(But the programs have different root .exe folders, it can be lunched from the same .exe but I have a copy of the second program in another folder, and it is even on another partition)

 

For a point 4, I was liked something that after the macro finished what i have done it return to the previous window it was.

I use windows XP if it helps. Thing is, how do I make the macro activate the "last window" I worked when the macro activated and it switched to the "work window". I was not talking specificaly of Windows explorer window. but any other, either a game, winamp, etc.

 

Sory if some things I don't quite understand. I am quite new to this

Also some example would be great if you can

 

Cheers

Link to comment
Share on other sites

Capturing a macro will create a macro that will record the keystrokes, mouse movements and mouse clicks you performed as you recorded the macro. This works great for many macros. However, for some tasks you need to adjust the macro after it has been recorded. Use the Scripting Editor to make these adjustments.

 

I can barely understand what should I do.
I recommend that you start by reading the Quick Start Guide and the tutorials. Click Help and then Quick Start Guide. Then Click Help, Macro Express Help, and read the tutorial section.

 

As for 3 I don't realy know what is this control index...
There are several topics in the help that discuss Windows Controls. You can search the help for 'Control' and read the resulting topics. Another, perhaps easier approach, would be to use the 'help topic organizer' at the top of the help. Look for this section of the help:MacExpHelpTopicOrganizer.jpg

Use the drop-down to choose Controls and then click and read each section.

 

At activate window it says window title, but the title actualy is the same so I realy doubt the macro can realy know witch window to pick.
That is why we are suggesting that you use the Windows Control commands. Each window, dialog, and component (buttons, edit boxes, etc.) on your screen are assigned a number or 'handle' by Windows'. The Windows Control commands find the handle to identify the Windows Control.

 

The Windows Controls work in many, but not all, tricky situations like you are describing. From your description, it sounds like this is the best thing to try.

Link to comment
Share on other sites

  • 4 years later...

Sorry this is probably too late to help the original poster, but...

 

Background:

Recently I've been working a bit with Winamp (my default player), MEP and Admiresoft's Super MP3 Recorder. I fairly consistantly ran into a prblem... how to "minimize" (or "maximize") Winamp (so I would have a more 'absolute' reference as to where critical mouse points were. Winamp is miserable in that it doesn't seem to offer any menu controls to min/max the application. Just the window controls (buttons) themselves. If they're offscreen, for whatever reason then you have to deal with that. PITA. My other problem was that if I named my MEP macro something like "Winamp Controller" or whatever... anything with "Winamp" in the name, and then told MEP to activate the window with "winamp" (partial match) in it, sometimes Winamp the application would come up and sometimes "Winamp Controller" (MEP) would come up. Grrrrr... I couldn't specifically activate Winamp the application since it might have a different name everytime it comes up -- Winamp puts the last track played in the window title... Grrrrrrr.

 

But I digress... to help others:

 

To the point:

Soooo... there's a handy dandy VERY SIMPLE, VERY SMALL little app called "CLAMP" which really whips the Llama's @$$ (you'd have to be a Winamp fan for that one!). You can get Clamp here:http://membres.multimania.fr/clamp/ . Clamp is a simple EXE. No installer, etc. It executes from wherever you've parked it. Very plain vanilla, but useful! Nice. I can't tell you how easy Clamp is to use! It's rather simple. In fact the 'manual' is on on one page at the above link... I just copied it into a Word doc for my reference (wom web sites come & go and disappear when you need them most!). And, of course, Clamp can be controlled via MEP! Sweet.

 

My only vetches with Clamp are:

1) AFAIK, there's not a slickj way to open Winamp to a specific bookmark, so I have to use a URL.

2) Clamp DOES support a MINIMIZE command but does not support a MAXIMIZE (odd, no?!).

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...
 Share

×
×
  • Create New...