Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,200
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by rberq

  1. If I understand you correctly, you can try this -- copy the cell content into clipboard, save clipboard in a string variable, use the string variable within the file name. Text Type (Simulate Keystrokes): <CTRLD>c<CTRLU> // copy spreadsheet cell into clipboard Variable Set String %cell% from the clipboard contents // save clipboard contents to string variable CLIPBOARD SAVE GRAPHIC Filename="c:\\temp2\\%Date_Time_as_text_Variable_%%cell%.jpg"
  2. Macro Return means exit from the macro, NOT start over at the beginning of the script. A bit confusing, yes.... I like the script you listed, because it allows for the possibility that the correct color will NEVER appear. The Repeat loop looking for color will eventually end whether it finds the color or not. So if it ends without finding the color, you would never know -- except that the macro AGAIN double-checks the color after exiting or finishing the Repeat, and only if it ended successfully does it go on with its normal functions. When I say the Repeat loop will "eventually" end even if the color is not found, you will have to be very patient. One million repeats, with 1/5 second delay each time, may keep you up beyond your bedtime. If you want it to wait 30 seconds, say, before giving up -- then change the Repeat command to 150 instead of 1,000,000.
  3. Hah! So it's not ready to replace us! At least for a few more months...
  4. Thanks, Cory, lots of good ideas there, but too much like work! These are not critical macros I am dealing with, so monitoring / cancelling is merely for my convenience. I was hoping for a feature that already exists, but that I had overlooked.
  5. I have several macros that may run for minutes or hours without terminating. But once I start them, I can't always remember which ones are running. Is there anything akin to "Repeat With Windows" and "Repeat With Processes" that can list them for me? Also, a way to selectively cancel macros? I can hover the mouse over the running man and see/cancel them that way, but I would prefer a keyboard-based approach from within another macro.
  6. I'm running ME 4.9.1.1 with Windows 10. ME allows me to assign F1 as a hotkey, and I have been using it that way for quite some time. When I assign it to activate the macro, it tells me there is another global macro already using it, and recommends I make it program specific -- but I can't find any other macro using F1. I have code within the macro that effectively makes it program specific, by exiting if I'm not in the expected window. If I hit F1 when Macro Explorer is active, the macro runs and exits, AND Macro Express Help opens up. Not sure any of that helps you, but there it is.
  7. The only partial solution I have found is to trigger the macro with the mouse. Instead of (or in addition to) a hot-key combination, a Mouse Event can activate a macro. (Look at the Activation tab for the macro.) You can specify some unused area of the screen which you click on to start your macro. Not the most convenient, but maybe it would work for you. A similar method would be having a macro that runs continuously, repeatedly checking mouse coordinates. When you move the mouse to some pre-determined area of the screen, this monitoring macro would then start the prompting macro. You would want a delay built into the Repeat loop of the monitor, so it wouldn't excessively hog processor time -- half-second delays should be adequate but still give quick response time.
  8. Like acantor said. Also, sometimes you can search for text within a button that can be either clicked or activated with the ENTER key. For example, the snippet below logs me out of several web sites: Text Type (Simulate Keystrokes): <HOME> Text Type (Simulate Keystrokes): <CTRLD>f<CTRLU>log out<ESC> Delay: 250 milliseconds Text Type (Simulate Keystrokes): <ENTER> It would be handy if there were a browser operation to find text AND automatically position the mouse over that text.
  9. When each record of the CSV file is accessed, I think that ALL elements of array T are cleared, then populated with values from the current record. Your macro saves inventory in T[99], but that will be cleared to null when processing of the next record begins because it is part of the same array. Therefore command "If Variable %T[1]% Does not Equal "%T[99]%"" will ALWAYS find T[1] unequal to T[99]. Try defining a new text variable in which you save inventory, and change the "If Variable" command to use that as well. Any single non-array variable should work -- call it TSAVE or something else meaningful. I'm not sure of the above, but it's easy for you to test.
  10. I could not get "wait for keystroke" to work consistently, so I gave up that method of detecting the second key press. (1) The first thing the macro does is find the previous date/time that it ran, which should have been stored in a text file. If the file doesn't exist, a dummy (very old) date/time is used instead. (Could have stored date/time in an environment variable, registry key, or whatever, but text files are easy.) (2) Current date/time of this execution is obtained, and stored in the text file (for next time). (3) If current date/time is more than 1/2 second after previous run time, macro types the close application sequence. If within 1/2 second, type "n" so changes won't be changed. // Get previous execution time of this macro from file if file exists // If file does not exist, make up a very old time for previous execution If File Exists: "C:\Temp\Date_Time_Macro_String.txt" Variable Set String set %PREVIOUS_STRING_DATETIME% to the contents of C:\Temp\Date_Time_Macro_String.txt Variable Modify String %PREVIOUS_STRING_DATETIME%: Convert to Decimal (%PREVIOUS_DECIMAL_DATETIME%) Else Variable Set String %PREVIOUS_STRING_DATETIME% to "111.111" Variable Modify String %PREVIOUS_STRING_DATETIME%: Convert to Decimal (%PREVIOUS_DECIMAL_DATETIME%) End If // Current date/time into file Date/Time: Set %DATETIME% to the current date/time Convert Date/Time to Decimal: %DATETIME% => %DECIMAL_DATETIME% Variable Modify Decimal %DECIMAL_DATETIME%: Convert to Text String (%STRING_DATETIME%) Variable Modify String: Save %STRING_DATETIME% to "C:\Temp\Date_Time_Macro_String.txt" // How long since previous execution of this macro Variable Modify Decimal: %TIME_DIFFERENCE% = %DECIMAL_DATETIME% - %PREVIOUS_DECIMAL_DATETIME% If Variable %TIME_DIFFERENCE% Is Less Than "0.000005787" // one-half second as a fraction of a day
  11. acantor, this isn’t as socially useful as your three-liner, but it was fun and helpful: A simple macro I wrote long ago, with one keystroke (Keypad minus) closes the current application, usually by Text Type (Simulate Keystrokes): <ALTD><SPACE>c<ALTU> In browsers and in the Adobe Reader it will close only the current browser tab or PDF if more than one is open, otherwise closes the whole thing. But a very useful change added recently involves closing without saving changes. For example, I plug some trial numbers into a spreadsheet to see their effect, but don’t want to save the changes. Or maybe I edit a Word document but decide to scrap the changes because they are not up to my usual Shakespearean standards. So when I trigger the “close” macro the application doesn’t close, but instead pops up a box asking if I want to save my changes. Then I have to move from keyboard to mouse to click “No”, or reposition my hands on the keyboard to type “n”. Seems trivial, but it’s a pain and I’m impatient. So I changed my “Close” macro so if it runs twice within 1/2 second, the second execution types “n” instead of <ALTD><SPACE>c<ALTU>. If I tap the hot key once, it is a normal close. If I tap it twice rapidly, it closes and types "n" to scrap the changes.
  12. Amazing how a "trivial" macro can accomplish so much.
  13. A learning experience. Glad it is working now.
  14. The macro logic looks correct to me. Whether it stops or continues depends on the values of T3 and T4 when the "IF" command. That's why I suggested inserting a Text Box Display before the "IF", to determine exactly what the variables contain at that point. How soon does the screen change after the macro types T1 and ENTER? Maybe you need a delay longer than 1000ms at that point, to make sure the application has had enough time to change the URL when the number is correct.
  15. I don't understand how it can work if you type <ALT>d< On my PC, typing <ALT>d highlights the URL, then typing the < character causes the entire highlighted URL to be replaced by < and the single character < is loaded into the clipboard. Should have the Sound Beep command before the Macro Stop. Other than that, I can't see where the problem is. For testing, try a Text Box Display just before the compare of T3 with T4. Put some kind of brackets around the displayed variables so you can tell if there are invisible blanks or nulls at beginning or end of the variables. That could make them appear unequal. For example, in the Text Box, display ***%T3%*** ***%T4%***
  16. I don't think you can use controls on a web page. There are no "standard" or "pre-set" variable names -- you make up your own. The following sequence of macro commands are approximately what should work. You may need some Delay commands as the web page changes, to keep the macro from outrunning the screen. Variable Set String %expected_URL% to 'xxxxxx' -- this is the number you expect (hope) to see in the new URL Text Type Alt-d to highlight the actual URL at the top of the browser page Text Type Ctrl-c to copy the highlighted URL text into clipboard Variable Set String [set value from clipboard] -- you can make up any variable name you want, for example %URL_Name% If Variable %URL_Name% Contains %expected_URL% . . . . . . . .
  17. Type Alt-d to highlight the URL at the top of the browser window. Then Ctrl-c to copy the highlighted URL text into the clipboard, and check to see if it has changed to the expected value.
  18. Suggestions: Contact Insight and report it as a bug, see what they have to say. The Macro Explorer menu has a Help selection, and under that is "Online Support" which allows you to report bugs. Worst case while waiting for an Insight response -- give your users a macro that runs the Restart Macro Express command, and tell them to use it whenever they change monitors. P.S. What version of ME are you using? Strange that acantor's macro works for him but not for you.
  19. I'm glad it works more reliably now. If you have not already done so, look at the "Keystroke Speed" command. Slowing the keystrokes a little might help with the TAB sequences. I routinely put this command at the beginning of macros, and the typing is still fast enough for most purposes. There is a similar Mouse Speed command. Keystroke Speed: 30 milliseconds
  20. In addition to the "Script Error" window that I mentioned above, most macro commands have an "On Error" tab. Look at the Help screens for "on error" or "catch error". In most cases, it's probably just as easy to play your sound when "Script Error" appears, because you only have to write the single macro triggered by the window title, rather than do special coding for every possible error.
  21. If there is logic in your script that determines the macro should stop for an error, then you could play a sound file at that point -- see screen shot below. Sometimes (always??) an unexpected error will pop up a "Script Error" window -- the one you don't want to watch for. So you could write a small macro activated by that window title, and play the sound file in that macro. Full disclosure: I have not tried either of the above ideas, but it seems as though they should work.
  22. What command are you using to check for the "hand point"? This one works for me: If Mouse Cursor: Internet Navigate
  23. Generally, yes, same logic. Except you will need to extract more than just one digit from the end of the URL. There may well be better ways to get at the URL, but I don't know them. I have had mixed success with WAIT FOR WEB PAGE. I seem to recall that it is intended to work only with Internet Explorer. I have one macro where it works very well in Firefox, but others where I have to check colors at key positions of the screen to decide whether the page has finished loading.
×
×
  • Create New...