Jump to content
Macro Express Forums

rberq

Members
  • Content count

    666
  • Joined

  • Last visited

  • Days Won

    29

rberq last won the day on July 7

rberq had the most liked content!

Community Reputation

11 Good

About rberq

  • Rank
    Expert
  1. win+m says minimize all. win+d says show desktop. According to this link, there is a subtle but significant difference, because some minimized windows are still there, just not visible. https://superuser.com/questions/357226/whats-the-difference-between-the-win-d-and-win-m-shortcuts/357228
  2. Hmmmm. Sorry. That's an option in Macro Express Version 3. Apparently "focused" is the ME Pro equivalent.
  3. Set Scope to Global. Set the Activation property to Window Title "Program Manager". That should cause the macro to run whenever the Program Manager screen gets focus. When setting Window Title, if you click the Browse button, it should show you the names of available windows to select from. On my system (Win 7) Program Manager is always in the list because it is lurking in the background. Setting Scope "Global" ALLOWS the macro to run in a particular window, but does not MAKE it run. Setting the activation property is what triggers the macro to run when the window appears. Once you get it working, you could try setting scope in addition to activation -- in theory it shouldn't hurt anything. Edit: OOPS! Sorry! I re-read your last post and I see you already have an activation. So forget what I said about setting a Window Title activation. But DO try changing Scope to Global. If still no good, try "If Program Manager is On Top" rather than "If focused". If still no good, try a different activation, such as a hot key combination -- though I'm grasping at straws with this suggestion.
  4. In Windows 7 it is "Program Manager". I don't know about Windows 10, but you could try that ....
  5. Use of operators

    Variable Modify String: Convert %T1% to integer %N1% convert text variable to integer variable Variable Modify Integer: Dec (%N1%) decrement integer variable Variable Modify Integer: Convert %N1% to text string %T1% convert integer variable back to text variable
  6. Different screen resolutions

    Only solution I can think of is for the macro to check the screen resolution and apply a formula to the mouse coordinates. Write a separate macro to do the math, that you can call (run) from your main macro -- otherwise you will get tired coding the same logic over and over. Don't know if it will work, but it's easy to test. Variable Set Integer from Screen Height / Width
  7. See my post earlier in this thread. I should have highlighted the phrase Direct Editor so it would stand out. The approach worked for me, but I haven't used it extensively.
  8. Editing the contents of a string

    It's hard to say without knowing specifically what edits are required -- but Variable Modify String commands can accomplish a lot, so that would be my first choice. Without some examples, I don't know why you feel it won't work. As a second choice, paste the data into Notepad as you propose, but have your macro run as many of the edit commands as possible, rather than do them manually. That's a lot faster than you can type, and a lot less drudgery, as long as the same rote commands can be used every time. If there's some THINKING involved for special situations, handle those situations manually after the macro has done its work.
  9. Thanks for the tip. I just found that will work for me on a web page that changes frequently. It's also considerably faster than the technique I have been using.
  10. Regarding repeat loop

    You have a loop within a loop. The outer loop is ASCII File Begin Process. The inner loop is Repeat With Variable Using N1. So yes, get rid of the line “Variable Set String %T1% from File: Testdat.txt" because each time through ASCII File Begin Process the next line of your file will be loaded into T1, which is what you want. Regardless of which line of the ASCII file has just been read, I think “Variable Set String %T1% from File” picks up the FIRST line all over again. That would explain why it always repeats 4 times regardless of what the file contains in subsequent lines. Also, I would recommend converting from text to integer with command Variable Modify String: Convert %T1% to integer %N1% rather than Variable Set %N1% to ASCII value of %T1%. In case %T1% contains blanks or newline/carriage-return characters, trim it before doing the conversion to integer.
  11. Type text misses words

    I find that keystroke speed of 30ms is satisfactory for most screens: Keystroke Speed: 30 Milliseconds Also, in the Text Type command there is an option to "Use Clipboard to Paste Text". I don't know if you are using that option -- I avoid it because it seems to fail too often; don't know why.
  12. Shortcuts extremely slow

    How slow is slow? 1/4 second response, 4 second response, what? Also, when Macro Express is running, are there any long-running macros or resource-intensive macros that could be sucking up processor time? With ME running, if you go into Windows Task Manager, can you see any processes using a lot of resources -- CPU, disk, memory?
  13. I think you are on the right track, and I see no reason why your approach shouldn’t work. Your fixit macro should be able to do all the following with keystrokes (which are easier than figuring out where and when to click the mouse). Be sure to insert reasonable time delays between the Text Type functions, so your commands don’t outrun the Explorer and Editor functions. Set Keystroke Speed to a reasonable value. Arrow down (in Explorer) to next macro. Enter (to edit the macro). Alt-v followed by i to enter the Direct Editor. Ctrl-R followed by appropriate values to set the replacement, followed by Tabs to highlight the Replace All button, and ENTER to do the replacement. ESC a couple times to close the replace dialog box and the “not found” box if any. Alt-s followed by l to save/close/return to macro explorer. Like Cory said, don’t rely on magic numbers. No way would I start this macro and ask it to run 545 times. Too much can go wrong, mostly in terms of Windows timing, and once your macro is out of sync with ME Explorer, who knows what havoc you may wreak? I’d suggest making a good backup of your macro file, and letting the macro repeat ten or twenty times maximum, requiring you to restart it for additional iterations.
  14. Integer seconds to yyyymmdd-hhmmss ?

    Yes, I did include a sample script in the post. MsgBox(DateAdd("s",30,"31-Jan-10 08:50:00")) is a complete script. That one line is the entire text (script) file that my macro built. The display is NOT a Macro Express message box, it is a VBScript message box. A macro was used only to write that one line to a text file, to save the text file with the .vbs filetype, and to launch Windows WSCRIPT.EXE which runs the script file. You can simulate this manually by building and saving the one-line script file with Notepad, then typing "WSCRIPT.EXE filename.vbs" at a command prompt or the Windows "Start" command. For your purposes, a message box output is useless, so do some Googling and copy/paste file-building logic so that the (1) macro builds a bigger script, (2) the macro launches WSCRIPT to run the script, (3) the script writes the computed date result to a (second) text file, then (4) the macro retrieves the text file containing the result. It seems convoluted, but after you get it working you may come up with a simpler method. In my mind, the biggest advantage of using VBScript is that Microsoft has already written hundreds or thousands of lines of code to make DateAdd do accurate calculations that span day-end, month-end, year-end, etc. P.S. Getting familiar with Visual Basic and similar object-oriented languages IS painful for somebody used to step-by-step logic. I have suffered through it and have very far to go, probably will never get there at my advanced age. But it is worth it, so get going. Google is your friend.
  15. Integer seconds to yyyymmdd-hhmmss ?

    This isn't two lines, but it's not many: Macro builds a text file containing the VBScript command DateAdd, with the appropriate number of seconds added to the date/time that the macro provides. For example: MsgBox(DateAdd("s",30,"31-Jan-10 08:50:00")) adds 30 seconds to the starting date/time and displays it in a pop-up message box. That one line is the entire text file that the macro must build. Macro saves the text file as testscr.vbs Macro uses the Program Launch command to run wscript.exe, passing it “testscr.vbs” as its parameter. This can be done easily with ME. It has the advantage that Microsoft’s VB Script language does all the date calculations for you – no small matter when you consider leap years, leap centuries, additions that take you from one month or one year to the next, and so on. I have used MsgBox for my example, and you can use it for testing. But for your live macro you will probably want to find a different VBS function that sends the result to another text file where you can retrieve it further down in your macro – or sends the result to some other easy-to-access location. I don’t know what VBS function to suggest, but starting from abject ignorance (almost) I got this far in half an hour, so you can take it from here. Keep us posted.
×