Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,201
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by rberq

  1. Don't feel dumb. There are lots of neat things in ME that are easy to miss. For example, the Variable Modify String command has options to change an entire string to lower or upper case. That would be another way of doing your comparison. But I didn't remember the options were there until I looked for them a few minutes ago.
  2. When you code the command " If Variable %T1% contains "S-Shata" ", there is a checkbox option to ignore case.
  3. Try this: Use Text File Begin Process to get each line, sequentially, into a text variable. (One line on each pass through the loop defined by Text File Begin Process / Text File End Process). When the line is in the text variable (T1 for example), if variable T1 contains "S-Shata" then display the whole of T1 (the whole line) with the Text Box Display command. Text File Begin Process: "filename.txt" If Variable %T1% contains "S-Shata" Text Box Display: %T1% End If Text File End Process
  4. Yes, but you will still somehow have to copy and paste each cell separately. If the whole column of numbers is in the clipboard, then each time you paste you will be pasting the same thing, NOT subsequent cells on subsequent pastes. There are other techniques for what you want to do, such as saving the Excel spreadsheet to a CSV file and processing that with a macro; or storing multiple Excel cell values in multiple macro variables so they can be separately pasted. But get something really simple working to start.
  5. I take it you regularly have to manually transfer hundreds (thousands?) of individual numbers from Excel into the web form?? It certainly sounds like something Macro Express can do, by automating the same keystrokes that you would use manually. The macro(s) will be able to work much faster than you can. But you have a learning curve to get this working. I'd recommend you start very simply, just make a macro to copy one cell from Excel, Alt-Tab to the web form, paste the one number, Alt-Tab back to Excel. This can be done almost entirely with the Text Type command. When you are comfortable with that, start expanding your macro -- to arrow down to the next Excel cell for example instead of doing it manually, Keep expanding until you have something really useful -- though it sounds like the initial simple copy/switch window/paste/switch window may be helpful all by itself. Set Properties of the macro so you can initiate it with a hot key combination. Use the script editor to build your macro. For example: // // Copy from Excel cell where we are currently positioned (Ctrl-c) Text Type: <CTRLD>c<CTRLU> // Alt-Tab to web form Text Type: <ALTD><TAB><ALTU> // Delay briefly while Windows switches to the other window Delay 500 Milliseconds // Paste into web cell where currently positioned (Ctlr-v) Text Type: <CTRLD>v<CTRLU> // Tab a few times to get to the next web cell Text Type: <TAB><TAB><TAB> // Alt-Tab back to Excel Text Type: <ALTD><TAB><ALTU> // Delay briefly while Windows switches to the other window Delay 500 Milliseconds // Arrow down to next Excel cell that we will be copying Text Type: <ARROW DOWN> //
  6. Correct me if I am wrong, but I think you are saying (1) your macro gets mouse position, then (2) during the macro delay you move the mouse manually, then (3) the macro moves the mouse. If you coded step (3) to move the mouse "Relative to Last Position", that means "relative to wherever you manually moved it." If your intention is to ignore the manual movement, and move relative to the initial position, then you must calculate the position you want to move to; for example: Get Mouse Position [relative to] Screen: %N1%, %N2% Variable Modify Integer: %N1% = %N1% + 50 Variable Modify Integer: %N2% = %N2% + 80 Mouse Move [relative to] Screen %N1%, %N2%
  7. I use the Shift key with the arrow all the time to highlight for deletion. It's a lot easier to correct if you overshoot by a couple of characters. But I never realized I could do a whole word at a time with Shift-Control. Thanks.
  8. That was my first thought, to wonder if the Notepad file was very large. I guess I should have asked that to begin with, though that would have done no good -- obviously you didn't want an answer like "Use a smaller file." It seems very likely file size could be involved, though don't ask me why. Stick with Sam's solution, possibly with the addition of the Keystroke Speed command I suggested.
  9. Holding down the DEL key invokes what used to be called type-a-matic repetition. Like when you hold down the space bar to type many spaces in a row. Maybe Windows is feeding DEL keystrokes to Scrivener faster than Scrivener can handle them. Macro Express uses some system resources, so I'm guessing that is just enough time stolen from Scrivener to make the difference. Google "how to change keyboard speed in Windows". Out of curiosity, why do you delete by holding down the DEL key, rather than by highlighting text and hitting the DEL once?
  10. Sam's suggestions are very good. Text Type will likely be more reliable for you. You may want to set keystroke timing at the beginning of your macro. I generally include the following two default timing commands at the beginning of every macro: Keystroke Speed: 30 Milliseconds Mouse Speed: 30 Milliseconds Clipboard commands are notoriously sensitive to timing. I suspect that is because the Windows operating system is involved If Windows is busy doing something else a clipboard command may take much longer than usual to complete. The macro may work fine 95 times out of 100 but fail the other 5 times. Paste, or Ctlr-v, can also be unpredictable in some applications, though Notepad should not be a problem. However, I could not get your example macro to fail even though I have the Options for clipboard delay set to zero.
  11. Not sure what you mean by "pop a macro into" a file. Can you be more specific about what text you are pasting? Where does the text come from? Maybe show us the relevant macro commands that are failing?
  12. See Help screens for the CASE / END CASE commands. It's a bit neater than IF / END IF but still a lot of lines in a single macro. Cory's method has the advantage that you can maintain the list independently of Macro Express.
  13. I figured it was likely a Corel problem. Really strange though that you could draw manually but not with Macro Express. Glad you have it working.
  14. Weird. Did you then change it back to the original brush and see if it fails again? In other words, see if you can reproduce the error?
  15. Get all the source code into a Macro Express text variable. It looks like you can find the links you want by searching for the /t/ string. You can do that with command Variable Set Integer [Get Position of Text in a Text Variable]. Once you have the integer index pointing to /t/ within the source code, you can back up one character at a time looking for https: (the beginning of the link). That is, use a Repeat loop to decrement the index integer by one, copy 6 characters to another variable using command Variable Modify String [Copy Part of Text], and check whether the copied text is https: Exit from the Repeat loop when the match is found. At this point your integer (index) points to the beginning of the link. Find the end of the link with a similar Repeat loop incrementing the index until you find the double-quote. Now you know the beginning and ending positions of the link text, and you can use Variable Modify String [Copy Part of Text] to copy the whole link text to another variable, save it in a text file, or whatever. Use Variable Modify String [Replace Substring] to change /t/ to /z/. Use Variable Modify String [Delete Part of Text] to delete everything from the beginning of the source code to the end of the link you just extracted. Then repeat all the logic above to extract the next link, and so on until done.
  16. Thanks for pointing that out, Sam. I never did Text Type commands that way so I didn't realize the invisible ENTER could exist. Sure could create havoc!
  17. What version of Macro Express -- is it up to date? Show us the script. I bet it is programmer error, or some unexpected way the application is behaving.
  18. Ditto what Samrae said. I have always found <ALTD> followed by <ALTU> to be more reliable, whether used with an intervening key or not. It's worth a try in your case.
  19. Congratulations! Cory and Alan were right about using controls instead of my primitive copy-to-clipboard method. I bet it's fast enough, too.
  20. Perhaps. Computers are pretty fast. For example, using Alt-Tab to switch from one Windows application to another is practically instantaneous -- a macro can type that key combination in a millisecond where it would take you way longer just to position your fingers. Clicking on a data entry field whose location is known, or even tabbing to it, can be extremely fast when a macro is doing it. Just need to try it on the actual PC and applications. Could you maybe post screen shots of the two applications, indicating the fields to be typed into? Do you by chance have a dual monitor setup, where both applications can be visible at the same time, one on each monitor?
  21. You want it "fast and automatic ..." It is automatic. How fast is fast?
  22. Here's a possibility: 1. Type the string into the first window, but DON'T hit ENTER or click on a button or whatever needs to be done next. 2. Hit a hot key to start a macro. 3. Macro types Shift-down / Left-arrow(s) / Shift-up sequence to highlight the string you just typed, and copies highlighted string to clipboard. Macro then types ENTER or clicks the mouse or whatever the window (sending platform) expects you to do. 4. Macro activates the second window (receiving platform), tabs or mouse clicks or whatever to the target field, types or pastes from the clipboard. Sounds feasible, maybe very easy, maybe less easy. As Cory said, difficulty depends on just what applications you are dealing with.
  23. Increment an integer counter each time through the Repeat loop. Then test the counter value. For example, if your delay command specifies 1 second delay after checking pixel value, then when the counter reaches 120 the macro has been waiting about two minutes. If you use a half-second delay, check counter for 240 rather than 120; etc. When the counter reaches 120, click on the refresh button and reset the counter to zero to wait some more. You may be able to press the F5 key to refresh rather than using the mouse. Get pixel color Set counter = 0 Repeat until pixel color Wait 1 second Increment counter If counter >= 120 Click refresh Set counter = 0 End if Get pixel color Repeat End
×
×
  • Create New...