All Activity

This stream auto-updates   

  1. Today
  2. Here's my script which is inspired by your kind comment. Thanks a lot. Text File Begin Process: "list-a.txt" Repeat Until %T2% = %T1% Clipboard Copy Variable Set String %T2% from Clipboard Variable Modify String: Trim %T2% If Variable %T2% <> variable %T1% Text Type: <ARROW RIGHT><DELETE><ARROW RIGHT><DELETE><ARROW RIGHT><DELETE><ARROW RIGHT><DELETE><HOME><ARROW DOWN> Else Text Type: <ARROW DOWN> End If Repeat End Text File End Process But There's 1 problem here. The last line of the "list-a.txt" is 2000-5592, and the last row of Excel is 2000-5599. This script ends at 2000-5592 and can't delete rows from 2000-5593 to 2000-5599. I need to delete data if the rows doens't match with the data in the list. I would appreciate it if you give me more help.
  3. Yesterday
  4. I think this approach will work: Use Text File Begin Process, once only, to load all entries from the file into a single text variable. That is, read the file one line at a time into T1, trim, and append its 9 characters to T2 (variable modify string/append), continue until the whole file has been loaded. When done, T2 will be an array of 9-character strings. (But you won’t need to process it as an array – see below.) Next, copy the first spreadsheet cell into the clipboard, store in text variable T3. Command If Variable %T2% contains "%T3%" tells you whether the array (file) contains that cell’s data, and you can type or delete into other cells in the row as desired. Text Type of arrow keys is good for moving from one spreadsheet cell to another. Get this working for a single row of the spreadsheet. Once you have it working for one row, add Repeat Start and Repeat End to handle all the rows one by one. Use Repeat Exit when you reach the end of the spreadsheet (that is, when copy to clipboard finds nothing).
  5. Last week
  6. Hello, I'm here to ask help to make a Macro script what I'm struggling. Here's my situation. I have a Excel sheet like this and "A column" is important. Each row of "A column" contains a text string(XXXX-XXXX) and the total number of rows is 600. A column B col C col D col E col 1000-1500 text1 text2 number1 number2 1000-1501 text1 text2 number1 number2 ~ 1000-1599 text1 text2 number1 number2 1000-1800 text1 text2 number1 number2 1000-1801 text1 text2 number1 number2 ~ 1000-1899 text1 text2 number1 number2 1000-3500 text1 text2 number1 number2 ~ 1000-3699 text1 text2 number1 number2 2000-5400 text1 text2 number1 number2 ~ 2000-5599 text1 text2 number1 number2 And I have a text file "list-a.txt" which consists of roughly 300 lines and each line has a text string(XXXX-XXXX). 1000-1504 1000-1507 1000-1810 2000-5411 2000-5599 What I need is to delete data in column (B:E) of a row in Excel if the text sting XXXX-XXXX is NOT in "list-a.txt". And I need to type/input data in column (B:E) if the text string XXXX-XXXX is IN "list-a.txt". For example, if "list-a.txt" file has only 5 lines as above. The Excel sheet has to be the same as the following. A column B col C col D col E col 1000-1500 1000-1501 1000-1502 1000-1503 1000-1504 newT1 newT2 newN1 newN2 1000-1505 1000-1507 newT1 newT2 newN1 newN2 1000-1508 ~ 2000-5410 2000-5411 newT1 newT2 newN1 newN2 ~ 2000-5598 2000-5599 newT1 newT2 newN1 newN2 I used "Text File Begin Process" command from file "list-a.txt" and Set Variable to %T1%. And tried with many more combinations like "Repeat Until" command but all failed. Please help me out. * Windows 7 and Macro Express v3.10.2.1
  7. Congratulations on getting so far! There are many ways to make the script more reliable and robust. For the next iteration, consider substituting "Window Activate" commands for Alt + Tab commands. Alt + Tabs work reliably when only two windows are open. But if you more than two open windows, you may end up in the wrong one. "Window Activate" is more likely to bring up the windows you actually want to act on
  8. Repeat Start (Repeat 20 times) Control Key Down Text Type: c Control Key Up ... ... ... Alt Key Down Text Type: <TAB> Alt Key Up Repeat End You might also try repeating indefinitely -- or repeat an extremely high number of times. Then after the copy-to-clipboard (Ctrl-c), if the clipboard contains nothing, exit from the repeat loop. That way your macro would deal automatically with a variable number of entries in a column, as long as the last cell in the spreadsheet column is followed by a null cell. Variable Set Integer %N1% to 1 Repeat Until %N1% <> 1 Control Key Down Text Type: c Control Key Up If Clipboard Text Equals "" Repeat Exit End If ... ... ... Alt Key Down Text Type: <TAB> Alt Key Up Repeat End
  9. UPDATE I have have finally succeded in setting up a script that does exactly what I want, Thank you very much for your help ! The last thing that is left to do is to set up a number of time that I want the script to be REPEATED. I have looked at the repeat command and I find it a bit confusing. So what would it need to be added to the following script if I want it to be repeated let's say 20 times ? Control Key Down Text Type: c Control Key Up Text Type: <ARROW DOWN> Delay 200 Milliseconds Alt Key Down Text Type: <TAB> Alt Key Up Delay 500 Milliseconds Control Key Down Text Type: v Control Key Up Text Type: <DOWN ARROW> Alt Key Down Text Type: <TAB> Alt Key Up
  10. Earlier
  11. You are probably on the right track by using program launch and window activate commands. 1. For now, forget about looping through multiple files. Simplify. Get it to work for one file. 2. Insert long pauses after each command. 1 or 1.5 seconds should be plenty. Commands that bring up windows and programs take time to work. Once you get the macro to work. use trial and error experimentation to figure out how short delays can be. Sometimes delays can be omitted. Sometimes they need to be longer than you might imagine. 3. Once you get the script functional, use it as often as possible for a day or two or three to ensure it's reliable. Then, make a copy of the macro, and start adding the code to loop through multiple files, which will add another layer of complexity.
  12. Hi Can anyone help me with this issue -- i am trying to automate this task for a work project. -Paul
  13. Thanks, acantor and Cory. In the end, I think my keyboard shortcut might have been the issue. I might have picked a keyboard shortcut that was already being used for something else. I changed it, and the macro is working now! Thanks again.
  14. Exactly what acantor said. If it's MDI you might have some issues. In some cases the 'documents' can exist outside the parent window. But technically they're still part of that parent window. Also if there are multiple windows with the same title it can get difficult. I had that problem with Outlook. But look and see what you see when you browse and we will take it from there.
  15. When inserting the Window Activate command, click the "Browse" and select the specific CintaNotes windows you want to activate. Then set the "window title" drop down to "Exact Match." Save the macro and test. If it works, edit the command to work more generally. For example, if the window title is "CintaNotes - Document001" but you want it to work for Document 001, 002, 003, etc., delete "001" and then change the drop down to "Partial Match."
  16. Hi Cory, I suspect it's a conventional app. Not sure. It's CintaNotes (very useful note-taking application). It has multiple windows you open, and maybe that's part of the problem. Orson
  17. Is the program a UWP app (Windows Store) or a conventional WinAPI program?
  18. Just tried something I thought would be simple: Using Activate Window to bring an already-open app window to the front. Not working. Any insights would be appreciated. Thanks. Orson
  19. You're welcome.
  20. That did it Cory..thanks very much.
  21. You have something wrong. You have %REPCOUNTER% used as an array variable (REPCOUNTER[1]%) and as a singular variable (%REPCOUNTER%). It can't be both. I think lines 5 and 6 should be using a different variable. Something like %Iterations%. Then you will repeat %Iterations% number of times and save the current iteration to something like %Index% in the repeat command. Then you would move to %XCOORD[%Index%]%, %YCOORD[%Index%]%.
  22. Text File End Process Variable Save: Save All Variables Mouse Move: 705, 641 Relative to Screen Mouse Left Button Down Variable Set Integer %REPCOUNTER[1]% to 750 Repeat Start (Repeat %REPCOUNTER[1]% times) Mouse Move: %XCOORD[%REPCOUNTER%]%, %YCOORD[%REPCOUNTER%]% Relative to Screen Delay: 0.1 seconds End Repeat Mouse Left Button Up Text Box Display: My mouse coordinates are now recording successfully. In the above code I'm seeing variable is the wrong type error on this line: Mouse Move: %XCOORD[%REPCOUNTER%]%, %YCOORD[%REPCOUNTER%]% Relative to Screen. They are all integer variables and they are defined. Is my syntax incorrect? XCOORD and YCOORD are array variables with 750 elements. Thanks.
  23. Elegant is not the word...it works!! Thanks.
  24. Usually, variable names bracketed by % can be substituted for literals. So instead of this: If Variable %LOOP[1]% Equals "2" Variable Modify Integer set %XCOORD[2]% to the contents of %TEMP[1]% try this: Variable Modify Integer set %XCOORD[%LOOP[1]%]% to the contents of %TEMP[1]% The script editor allows it, so it probably will work. I hope so -- gets rid of all the IFs -- way more elegant.
  25. Hi again. Thanks Cory and rberq for your leads .. in the end I gave up on length of string in favour of sampling the first character. This macro does work very well, but the use of "If variable %LOOP[1]%" in lines 23-27 seems rather inelegant. Is there a more efficient way of passing these values to a predefined array? STRIP VALUES_2.mex MouseRecorderPro2.txt
  26. And we're here to help you learn.
  27. Hi again. Of course I am learning all the time (as I'm sure we all are) but in my case evidently I'm a lot lower down the snakes and ladders board. I do have a working macro now, with some issues. I have used the length of the string to eliminate lines that do not contain x or y. I'll take a look at the split function suggested by Cory later when I get back from work.
  28. Using my split method it would not matter how many digits the numbers are.
  29. TO answer your question about passing variable you set them as you do any variable. If you read the "Variables" section of the help file it explains. If you want to access directly %you can access any element of the array directly using the %VariableName[X]% convention where X is the element number. The split command will set them directly. If you need them as integers you will need to cast them with Variable Modify String > Convert to Integer.
  1. Load more activity