Jump to content
Macro Express Forums

Cory

Members
  • Posts

    4,207
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by Cory

  1. Please tell us what the program is and what control you're trying to access. A screenshot woudl be helpful also.
  2. I first try to use the Windows Controls commands in MEP. This is by far the best way to interest with controls. However many newer UWP programs have different controls that are invisible to MEP. I typically start with the Get Control command. There's a control picker utility in there. If you hover the blue X over the control and it highlights it, then it will work. Next I will try hitting the Home (sometimes with Ctrl) button then tabbing though the controls counting. All windows programs should be able to tab to with the keyboard. As a last resort I will use the mouse. Mouse moves and clicks are problematic becasue the environment changes. Like a toolbar is enabled or a font size changes and then it fails and click in the wrong place . Aside: Windows controls commands are better for many other reasons. One big one is timing as there is a handy "Wait for control" command. Many people avoid Windows controls because it seems complicated and people get intimidated. They're not and should be one of the first things an MEP programmer learns as it will pay huge dividends into the future. If you don't know how, we can give you an edification.
  3. No controls. The whole "WebBrowser" that renders the page is one control. The controls in the rendered webpage are browser controls and not accessible to MEP. I've done much of MEP isn't suited well for it. One must tab though the controls and enter as needed. Avoid using mouse commands as it's troublesome. And in any case navigation is troublesome and timing can be a nightmare. There are browser extension apps that do this better becasue they run programmatically in the browser, but most have a programming language to learn and are not as easy as MEP. I do much automation of web pages like what you're doing for clients and long ago I gave up and learned .NET so I could write programs to do this sort of thing. There are a few ways but mostly I don't even use a browser or browser control and instead send HTTP requests and process responses like the browser does. It's much simpler, more robust, and hundred of times faster than MEP, but one must know a programming language to do it. If you have any interest, I'm available for hire or even to just give some free advice. Maybe even make you a simple app you could play with. But most can be done in MEP, it's just a pain. If you don't run big batches and just need to enter a couple pages of data, MEP could be viable with keyboard commands and some tricks I'll be happy to share. Maybe describe a little more and I can offer some ideas. Last thought... Many of the pages I automate connect to a Db like AWS. The scripts run in the web page but in the end they POST and receive data as one of the script driven requests and are often in JSON, XML, or other simple data format. Many of my programs just fire requests to the Db server directly and receive JSON data directly which I then parse and pump into my client's Db.
  4. Variable Modify > Trim. See the help for instruction and options for Variable Modify.
  5. Did you open your Macro file? It has an MEX extension. In Macro Explorer you will see all the open files on the left.
  6. I have done this in MEP but I find using Mail Merge with the email method in Outlook to be much simpler. No need of creating a macro for an extant function. Also mailing services like MailChip and Constant Contact will let you use their services for free up to a limit. For most people the limit is more than adequate.
  7. I think you will be happy to learn it if you work with any WinForm apps. There was in the sample MEX file or on the webpage an example of doing controls with Windows Calculator. However I think Calculator is UWP and will not work for controls. What you want to do is launch the Get Control command dialog and click the Launch Utility button. Take that blue X and drag it over your program and you will see what controls are available. If none of your apps are traditional WinForm apps, then it's not worth learning.
  8. You could probably do it with the External Script command and a little VBScript.
  9. I discovered a long time ago MEP does not support Unicode. I also discovered that one can work around this in cases of characters that are ASCII/ANSI, but it can never handle characters that are only in Unicode.
  10. Complex? 2 commands is much less complex that what you will end up with. And no need to know programming. Just point at the control you want with the utility. Having said that, I can see that the individual control is that whole resize box so it's not going to work in this case.
  11. I use Irfanview for batch resize and conversions. No need to write macros for what already exists in free programs.
  12. Get the control, create the variables. And then "Get Control from Text. These 3 commands will do. But this is with one of my programs so you need to change the Get Control for yours. <GET CONTROL Flags="1" Program_Name="HTML FOLDER SCANNER.EXE" Class="WindowsForms10.Window.8.app.0.141b42a_r7_ad1" Title="HTML Folder Scanner" Control="\"WindowsForms10.EDIT.app.0.141b42a_r7_ad1\",\"3\"" Variable="%Horizontal%" Caption="HTML Folder Scanner" Partial="FALSE" Wildcards="FALSE"/> <GET CONTROL TEXT TextVar="%strHorizontal%" ControlVar="%Horizontal%"/> <TEXT BOX DISPLAY Title="Result" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %strHorizontal%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
  13. I don't ever use the recorder. I recommend that no one does. Always learn to do it by manually entering the keystrokes. And learn things like when to use the control and when to use control up/down combination (almost never). Things like that.
  14. I spent years avoiding controls. Then once I did it I realized I had wasted hundreds of hours and made inferior macros all that time that caused all kinds of complexity that could have been avoided using controls, especially for timing. A huge regret. The biggest problem I had was why the "Get Control" command. But once I realized that all controls have a unique address that is unpredictably assigned and the command really should be somehting like "Get Control Address", then it clicked. No more delays for timing, no more flow control. No more issues with tab sequences getting out of whack.
  15. It woudl be much simpler, faster, and more reliable using Windows Controls.
  16. I haven't read all this but Macro Run command activates a macro.
  17. I would create a Windows Controls command to read the value in do the logic, and set the new value and click the OK button. If you don't want to use Windows Control you can simply use tabs and your clipboard.
  18. I don't understand. Why don't you think it's working? Please show your variable and delay commands again.
  19. Interesting. Maybe report that as a possible bug/suggestion. When doing an numeric delay like this one would want the default value overwritten. Though it is pretty obvious and easy to correct.
  20. Of course. For instance in the Text Type command one just clicks the Misc Keys button or you can manually type like "<F24>". BTW 13 - 24 Fn keys aren't a native key, they're mode-modified native key like using Ctrl or Alt with a number to get a special character. There were several versions but most never really adopted them back in the day, but Windows does support them. Just wanted to let you know that only the command for any physical key is sent and there is support for modifiers. It's a concept sometimes useful when using things like the Text Type command. and how one enters mode modifier keys. You might think you're typing typing the number 4, but really the keyboard is sending a shift modifier then the 4 key which is then interpreted as a dollar sign on a US keyboard. Most times in Text Type you can enter just a dollar sign, but in other cases it's helpful to know how the system actually receives input from the keyboard.
  21. Variable Set Integer > Set to Random Value. This woudl be a command before in which you would set the minimum and maximum.
  22. I do not. But if you have an example I can give some pointers and show a few simple examples. For instance one thing to look for are labels. HTML is made of of elements. "Table" is a type of element. They support attributes and one of them is an ID. A good web programmer will name all of these elements and they shoudl be unique on a page. So you might find a table element id="Annual Values" and that's a great way to set a start point. Or find anything that will be unique. Of course this only applies when the content of the web page before this changes. Otherwise you can go right to the prize. Also if it's structured well with each element of the form on separate lines, simply processing the HTML line by line works well. I haven't done this for years so I might be a little rusty. Long ago I learned RegEx and use it almost exclusively. In the early days of computing programmers often had to process unstructured text often and some smart guys designed this text processing engine and it's wonderful. Unfortunately it's hard to learn and one would need to use an external script to access it in MEP. But if anyone gets into something really big and wants to know more, feel free to contact me. So post some basic HTML samples and I'll give you some pointers for MEP.
×
×
  • Create New...