Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,200
  • Joined

  • Last visited

  • Days Won

    61

rberq last won the day on March 4

rberq had the most liked content!

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

rberq's Achievements

  1. I am at ME 6.6.4.1. Both Explorer and Editor now open at the size and location I last adjusted them to. Running one monitor.
  2. Is the scanned data recorded in a file on the PC -- ideally, a txt file log? If so, a macro triggered by the order screen could read the last record of the file and check its contents. Does the scanned-data pop up screen have a title that could trigger a macro?
  3. Can the macro highlight the entire screen (Ctrl-a) or part of it, copy it into the clipboard and then into a variable, and parse out the information from there? It looks a little sloppy to the user but I have been able to use the technique successfully a number of times. Generally I click in an unused but relevant part of the screen, type Ctrl-a to highlight, copy to clipboard, and click a second time to clear the highlighting.
  4. I know these aren't real lengths, but: If for example the window title is ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 and you are concerned with 56789 but Macro Express will only activate on the first 20 characters ABCDEFGHIJKLMNOPQRST then specify those 20 characters to activate it. Then as the first few lines of the macro say something like IF WINDOW ABCDEFGHIJKLMNOPQRST IS FOCUSED AND IF WINDOW 56789 IS FOCUSED ELSE MACRO RETURN END IF In other words, the macro will be activated on any window title containing ABCDEFGHIJKLMNOPQRST but the logic of the macro will immediately terminate it except in the cases where you want it to continue. I don't know if this will work for your windows, but it's easy to try with a test macro.
  5. Can you give an example of a window title that is not working, and show where the character limit falls within the title?
  6. Here's a variation on acantor's idea: Insert a "Label" statement just before or after the Text Box Display, and include the label name in the header and/or text of the box. No matter how much macro code is added or removed, you can find the label using the Script Editor. // :abc // Label abc Text Box Display: abc //
  7. Repeat Start (Repeat 10 times) Text Type (Simulate Keystrokes): <ARROW DOWN> Delay: 10 milliseconds End Repeat Has the advantage that you don't have to count how many you have put in the command. And easy to change just by modifying the Repeat command. Delay may or may not be needed depending on the application you are interacting with.
  8. Repeat Start (Repeat 2000 times) Variable Set Integer %in% to a random value between 1000 and 19999 Variable Modify Integer %in%: Convert to Decimal (%indecimal%) Variable Modify Decimal: %individed% = %indecimal% / 100 Variable Modify Decimal %individed%: Convert to Text String (%instring%) Variable Modify String: Append %instring% to text file, "c:\temp\numbers.csv" Text Box Display: Values End Repeat Macro Return
  9. I cheated, because I wanted to use real-world values. I was surprised that my real numbers had the same tiny discrepancy as your Monte Carlo simulation.
  10. If the macro chooses random values, and if the random function works properly, then by definition statistical theory says you will get a very small percentage difference. So to more closely match real finance, I downloaded six hundred credit card charge amounts from my bank -- the most that I could access online. The percentage difference was -- wait for it -- 0.020499%. I thought the result might be skewed because so many items are priced as x dollars and 99 cents. But scanning the numbers, there were few charges like that, because most purchases were not single items but a roll-up for many items.
  11. Macro command Variable Modify String has options that would allow you to take form data, concatenate multiple data items, and write the concatenated string to a file. For example, with values a, b, and c from the form: // Variable Set String %line% to "" // set line null Variable Modify String %line%: Append Text (") // line contains double-quote Variable Modify String %line%: Append Text String Variable (%form_data_1%) // line contains "a Variable Modify String %line%: Append Text (",") // line contains "a"," Variable Modify String %line%: Append Text String Variable (%form_data_2%) // line contains "a","b Variable Modify String %line%: Append Text (",") // line contains "a","b"," Variable Modify String %line%: Append Text String Variable (%form_data_3%) // line contains "a","b","c Variable Modify String %line%: Append Text (") // line contains "a","b","c" Variable Modify String: Append %line% to text file, "c:\test|filaname.csv" // write line to file // Even though the last command writes to a "text" file, the fact that you use the .csv extension on the file name will make Windows, Excel, etc. consider it to be the csv file type.
  12. If your data is in a CSV file, it is especially easy. (If the data is in an Excel sheet, you can save it as a CSV file, manually or as the first step of your macro.) The instructions ASCII File Begin Process and ASCII File End Process constitute a repeating loop that read the CSV file one line at a time and place that line's data into an indexed array. For example, call your array "ARY". If the first line of the CSV file is "a","b","c","d" then ARY(1)=a, ARY(2)=b, ARY(3)=c, ARY(4)=d Then you type or paste the array entries into the form, and continue with the next line of the CSV file. There is no visible jumping back and forth between the file and the form, unlike between a spreadsheet and the form, because the CSV file is not visible on the computer screen. Macro logic is something like this: Open data-entry form if it is not already open [Beginning of loop] ASCII File Begin Process (file name and array dimensions are defined within this command) (data from one CSV line is automatically placed into array) Paste ARY(1) into form Paste ARY(2) into form Paste ARY(3) into form Paste ARY(4) into form ASCII File End Process (control automatically returns to do the next CSV line) [End of loop, falls through to next instruction after entire CSV file has been processed] Macro Exit
  13. "A foolish consistency is the hobgoblin of little minds" (Emerson) "But it has its comforts" (me)
  14. I am running MX Pro 6.6.2.1, Windows 10. Both the Macro Explorer window and the Script Editor open as you describe. As I recall, this behavior appeared when I updated to 6.6.2.1. Like you, I wrote little macros to size and position them to my preferences -- in my case, full screen for both. Previously, the windows always opened full-screen, probably because that was the size and position I had last used.
  15. Often there is text in a button that you can search for, that gives focus to the button. This code finds the Log Out button on a particular page and "presses" the button by typing ENTER. Text Type (Simulate Keystrokes): <CTRLD>f<CTRLU>log out<ESC> Delay: 250 milliseconds Text Type (Simulate Keystrokes): <ENTER> Sometimes you can search for text that reliably precedes or follows the button, then tab forward or backwards to the button similar to what Cory described.
×
×
  • Create New...