Jump to content
Macro Express Forums

Yehnfikm8Gq

Members
  • Posts

    397
  • Joined

  • Last visited

Everything posted by Yehnfikm8Gq

  1. I cannot see a way to do it, but I may be wrong. I assume you must have some obscure reason for this scope like telling all windows have minimized by previous events rather than wanting to do something on the Desktop. Desktop is not really a window and it's never on top. In the scope there is no way to tell all other windows are minimized. There are plenty of ways to do the same thing in the actual macro but that requires the macro to start and cancel itself depending on what it does/finds. Normally, one would Win+D with some delay or window check and proceed with what needed to be done on the Desktop.
  2. You will find the same advice many times in the forum - instead of recording the macro, enter the program commands manually. It produces better results and you can use many more functions. Commands like Mouse Move, Mouse Left-Click, Variable Set String (for logins, mask input to hide if you wish for security in multiuser situation), Text Type (eg Ctrl+V to Paste), Clipboard Paste, Text Type (type out the variable), Program Launch, Window Activate. You can often use Text Type and a number of Tabs to get to from where you are when the window opens to a button. A login may be, as an example: Text Type Tab (to get to 1st entry) Text Type T1 (saved login name) Text Type Tab (to get to 2nd entry) Text Type T2 (saved password name) Text Type Tab (to get to button - may not be necessary if OK button is default) Text Type Enter (hit OK button) Mouse Move is OK if the window is the same every time. If you want to Record the macro as a framework to edit manually, look at Options/Preferences/General/Capture for settings. You can edit out the garbage after recording.
  3. Thanks, so it's by command list order. It's so difficult to follow large amounts of logic. I had four blocks, each consisting of a number of If, And, Or. Trying to follow the logic was impossible through all four blocks. I just wanted to put each block in brackets so each was executed as an entity. I ended up setting a variable from each block and then adding logic to handle those. Ultimately unnecessary but made visualizing and troubleshooting easier.
  4. There are a few issue on the web page. It's assumed you know how to get to the list on the page. Here are the basics: In Excel Text Type Ctrl+G Text Type Enter Text Type D6 Text Type Ctrl+C or Clipboard Copy (for some reason comes with CR/LF (carriage return+line feed) Variable Set String T1 from Clipboard Variable Modify String Strip CR/LF (may not be required but does no harm) Variable Modify String T1 to Integer N1 Activate web page, navigate to list, using Text Type Tab if possible To ensure at top of list:* Text Type Home (if that does not work, Text Type at least 10 Up arrows in case list is remembered from last access) Text Type N1 down arrows (Repeat loop?) Navigate to list action button on webpage (Text Type Tab?) - may not be necessary if next command works Text Type Enter *at this point sometimes typing the first letter will get the correct item but you have 2 As and 2 Es so stick with the arrow procedure The number of arrows may depend on list behaviour. May have to do one more or less down arrows than N1. This sort of procedure cannot be predicted entirely from a brief description. One needs to have the page for testing. Expect to do other workarounds.
  5. The title says it, which are executed first in complex If loops, AND or OR? Or are they executed in command list order?
  6. I'm currently running some timer tests in the background. Here's a crude method that is as accurate as the PC clock + ME activation delay. I have a hotkey macro for ME Explorer for setting Schedule Activations. I select the Scheduled macro to be set in the listing. Run the setting macro with the hotkey. It goes through the steps via Properties that you would take to do it manually. Once the macro gets to the dialog I set the schedule time manually. You could write a macro that is called to run at the end of your main macro. It would: Calculate next run time. If last schedule was 10am, calculate next time as 11.30am Note: 12am, 12pm transitions have to be handled with logic. If hour = 13, put hour = 1, toggle AM/PM Bring ME Explorer to the front Select your main macro in the list (may need some logic to do that) Run through to the Set Schedule, Daily* dialog Set the new Schedule time Close dialogs *Daily is easiest with every day selected because you don't have to bother about setting date. Once Daily is selected for a given macro, next run through, Daily will be remembered (or it could be the last used - check). I don't know of a neater method. For this sort of thing that may occur during normal activities I would precede the ME Explorer appearance by 5 audio dings at 1 sec intervals with a 5sec delay after that before the macro acts (to allow user to get hands off). If your main macro gives sufficient visual warning an audio notification may be unnecessary. (Edit) I ran an ME3 macro that consisted of a 60sec timer, scheduled to run every 10mins. Each time it ran it wrote the time to a text file. The schedule was losing about a second an hour. That's not huge but the macro was the only activity on the PC. (Edit2) I ran the same ME3 macro using another software timer. The time loss was about 1/2 that for ME Scheduled repeat. The software timer was direct timing 10mins, not on a schedule. Another method that will remove long-term drift to the accuracy of the PC clock involves adding some code to the main macro: Set schedule to 90mins but start it about 1min early (by enabling macro for the first time at say 9.59am) When macro runs 1 minute early - Macro starts Repeat and puts time into hr:min:sec variable every second Count number of repeats When time equals or exceeds desired local PC time (calculated per my previous post) Continue with rest of main macro If repeat count < 10, >90 give alarm Schedule has drifted to within 10secs or 90secs away from desired time (but is still actually running on time - new start required) Needless to say, for most purposes regular scheduled repeat timing is fine!
  7. I was looking at MEPro's settings which has a settable start time. To start at a particular point in an hour in ME3 you would have to start at that point. If the macro is enabled, you would set the time interval before the exact start time and hit OK before time. A save dialog appears which you hit at the exact time. If the macro is disabled and then enabled at the exact time, the 90mins will run from there. This is a more convenient method. I did not find the timer very accurate for short test times - the 5secs was often closer to 10 but that may vary from PC to PC. The lateness seemed to get worse over time on a 5min schedule. You will have to run tests to see how accurate yours are. If you don't want to hang around or want to monitor long-term, have the macro write the time to a text file every time it runs (start of macro). Perhaps the Windows Scheduled Tasks may be better. If ME's schedule starts when the macro finishes running then the Scheduled Task method would be more accurate. I can't spend time right now looking at other solutions to reset time. Hopefully someone else will.
  8. Is the problem simply that the timing is poor? 1. It's out by a few seconds each time (see Time Interval in Options/Preferences/Activations 10sec default) 2. It runs every 90 minutes but at an odd time say 10.02 (when setting activation, set calculating next runtime to the next hour exactly or whatever is required). 3. The 90 minutes starts from when the macro finishes running. That would be a problem. It's always seemed strange that one thing you cannot do is set the schedule time with a variable. Then you could correct any timing errors or reschedule macros based on other events (ie dynamic macro).
  9. Something I implied in another thread on web page search was to put webpage methods in one place. I think it may have been Kevin who said he'd done something in the past but could not spend the time retrieving. This subject, together with methodology for storing information (registry/text/ini/enviro vars) and any other faves could be put into Pinned posts. It's pointless regurgitating the same stuff over and over unless there is a specific issue. A responder could just refer the poster to the Pinned post.
  10. I'm sure VM runs fines. I've kept a couple of versions archived should I ever need to run one of the early Windows versions. Never bothered to load. When you refer to different machines hardware-wise, are they all running the same OS in VM? If you have a single OS installed twice, I would imagine you may have problems with Windows Update if you plan to update both. That would be the definitive method of assessing MS policy. If they don't care, you don't care!
  11. ISS may be the least of the worries. You have to install an OS on the VM. What is MS' view on using your Windows twice. I have no idea of the context that VM was referred to. Using it as a parallel PC seems rather silly. The whole purpose of VM is to isolate from Windows so you can run any other OS or Window rev without compromise to Windows. It's geared to being isolated, not working in tandem. You have one hardware PC with one processor that is now trying to run two Windows OS and doing other stuff on top. Sounds a pig's ear to me. Perhaps suitable ME macro programming is a better solution in 1/50th the time!
  12. I cannot envisage circumstances where you cannot use a playlist. It doesn't have to be an m3u, it can be a simple text file with the required content. Whatever instructions each macro uses, you use one macro with a Repeat that pulls the URL or whatever from the text file sequentially, waiting for the current file to finish running, then getting the next. My full repertoire of TV listings is about 250 web pages, all done with my browser because I have to use cookies. It runs for hours during the night. It's a tiny macro that pulls each URL or search string from text files one at a time. In the old days I would have to use a query form which required numerous text and mouse actions. That worked exactly the same way.
  13. A cruder method than rberg's is to pepper the potential area with mouse clicks. You could use several parameters to determine success; change in pixel colour at a particular coordinate, different mouse cursor, new webpage URL/title. Rberg's method is very neat and can be extended by right-click, Copy Link Location (shortcut may depend on browser). Compare to expected partial if predictable. That will add a time delay but more certainty. Depending on layout variation and code you can click the mouse in a pop-up free area near the button and tab or back-tab from there. You can also click and drag the mouse (right or down), copy text and see how it compares with expected text. That will indicate you are in the ballpark.
  14. Not seeing the webpage makes it very hard to suggest the right approach. Buttons on webpages may or may not be Controls. I assume you already tried. A few recent contributions have noted the use of search for pixel where there is a unique colour. It was discussed in this thread I don't use pixel search although I wrote a script for ME using AutoIt which works fine. If you want details beyond what I wrote in that post let me know. I haven't got round to making it more generic (standalone exe or data stored under username). Very quick, even faster if you can narrow the search area down. The technique may be less applicable to a widely changing page. What came out of the discussion in that thread for me, and applies to many ME applications, is that the PC doesn't care about what it does. If it works, that's all we care about. Don't dismiss your suggestion just because it's ugly to you. You did not comment as to whether the popups can be terminated. They may have titles/part titles that can be used or the fact they are not the URL/page title you addressed, or they are on top etc etc.
  15. I don't know of any ME functions that would do it. I've tried Wizmo which is pretty good. You put the exe anywhere convenient (the author suggests Windows folder - I used a folder in Program Files). Use Program Launch to run wizmo.exe with the parameter "monoff" no quotes. Any mouse or key will awaken the monitor. It has not been updated since 2008 so may not work with W7.
  16. Storing variables seems to be a subject for discussion every time it comes up. Here's my read on it. Unless you are aware of all implications, you should steer clear of the registry. It's a central part of Windows and should not be used as a general dumping ground. In ME it's easy to use. Fine for specific items of data (as in your macro) and if you know what you are doing. The ME Help is excellent on Registry operations and includes a warning highlighted in red. You can use ini or text files for storing data, both are simple text files. Ini are more organized allowing you to pick out specific items easier. You can create both in advance or if you type the path in the (Variable Modify String) Save to Text File or Save to Ini dialogs, ME will create the file for you. Ini and txt files can be opened at any time with any text editor. By default that would be Notepad. For one item I would use a text file (either way not going to save huge kB). You will have to convert the text to an integer and vice versa. The other aspect I like about txt files is that if you are running a long macro that writes/appends to file, you can open the text file at any time and read the content as it accumulates.
  17. Did you set the password on a macro or a macro file? You should have a backup for every macro file (unless you unchecked all options). You can always delete the locked mex and restore an earlier version. If a macro is locked, delete and restore earlier version from saved backup. If you cannot delete, export all other macros to a new macro file and delete the mex file. Never tried although I've restored from backup. Take a look at "Password" in Help. 2 items are related to macro passwords, 1 item to Category passwords. I was going to comment in your other thread that going into the programming business introduces liability issues and this gaff could be disastrous.
  18. Re Paul Open a macro - sorry, I abbreviated a few times, Open/Close refers to Macro File. Where I referred to Run it was running a macro (except in one case where I was referring to a Macro File being open/active) "multiple copies of those macros try to run" - if you put a copy of a macro in every Macro File and hit the hotkey for the macro, the macro will run out of every open Macro File. Two Macro Files open will run the macro twice etc. I have a hotkey macro that types %T[0]% (context sensitive) which is in all Macro Files. If I have two Macro Files open, it will type %T[0]%%T%]0[ or other variants %%TT[[00]]%%. Re Kevin If you have a number of Macro Files open at the same time, you have to be very careful about hotkeys. You cannot use the same hotkeys otherwise multiple copies run (see above). If you make the hotkeys different for the same macro in each Macro File it defeats the idea of having universal macros. I mentioned that I normally have just one Macro File open at a time (to avoid confusion with hotkeys). The content of each Macro File is based on that assumption. I don't use Categories at all. I may have more than one Macro File open but then I'm very careful about what I do. I normally have the option "Close all other files before opening this file" active. I use the dropdown list from the Open File icon (but you would not know that cos you don't have the toolbar visible!). That would close the Macro File containing the universal macros. As I noted previously you can get round that with extra keystrokes but it's an annoyance. If you are opening and closing Macro Files manually, Load and Close commands within macros are not in the picture.
  19. Adding some lines to write to a log is probably the only method. If you anticipate more changes at the start of all macros you could add a "marker" line for future use. A piece of useless code - a comment would do if it works with the Replace function. Then to add some lines to the start in the future, you Replace the marker line with itself and the extra commands. Some Replace procedures may have to be done in the Direct Editor. A few of us have written macros that will run the Replace function on all macros in a Macro File (or across all Macro Files). It's the sort of thing you need to customize yourself. There's a current glitch in MEPro, closing the Script Editor stops all running scripts. If you have a macro to edit all macros, every time you close the Editor the macro stops. You have to open all the macros simultaneously in Script Editor, do the Replace on each in turn (going from tab to tab) saving and closing each one. The last closure will close the Script Editor and stop the macro.
  20. You didn't say what the macros were doing other than participating in the Keypress. I'm sure I could start lots of macros but it's a question of how they interact as you push the CPU limits. That is the point at which Window-on-Top macros are likely to have problems. For example, if you are rendering video, the CPU could be pegged at 100% for a long time and then progs have to take turns. Funny enough I had problems recently with key presses. What seems to be missing from ME is an "If Key Press" command (not a "Wait for" command). If you were going round a loop, at any time when the key(s) were pressed, they would be registered and the relevant action taken (such as breaking out of the Repeat, printing results so far etc). That's not too difficult to do in the Windows environment. Right now I usually initiate such actions by getting the mouse position and make the screen bottom right corner the "key press". There are other crude methods. Were that in place it could perform a multitude of functions. Is that similar to the KeyPress macro?
  21. I've had mixed experience with simultaneous macros. There are limitations like being able to run only one Window-on-Top (WoT) macro unless there is some intentional synchronisation. Several non-Window (Background) macros should be able to run simultaneously, limited by the processor queue. I've found that Background macros run well together, although I've not tried much other than some basic testing. Where I've run into problems is with a WoT macro and busy Background macro. In particular I wrote a macro to log CPU% for a given process. Two methods; one used a modified VB script, the other used AutoIt to read the data from a Task Manager application. I was trying to log Firefox's CPU usage with one of my web page downloading macros running. I found that the disruption caused by the External Scripts running every second or so interfered with Firefox running. The logging works fine with manual web page operation. The problem may disappear with faster or multi-core CPU. I was wondering what experience others had: What sort of tasks run well together? Effect of Background macros on WoT macros? Effect of other applications on WoT macros? How well do macros run with simultaneous use of time delays? How well do macros in general work when one or more are running an External Script (internally or using Program Launch)?
×
×
  • Create New...