Jump to content
Macro Express Forums

Cory

Members
  • Posts

    4,191
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Cory

  1. I don't have much time but I'll try to give you a little understanding. I too found the name of the commands confusing, but after I learned how they work, the names make sense. Generally you're wanting to use Get Control. Controls are volatile. We see a control in an application and think "Oh, there's that control again." but to Windows it's different every time. In order to interact with a control you need it's address, called a handle. Every time you open Notepad all the controls including the form (program) are assigned a handle and it's different every time. And, in fact, you have have two instances of the program happening at the same time. The system distinguishes them and their controls with distinct handles. Here's where the Get Control made sense for me. We can't predict the handle the system will issue, so we need to wait for the controls to exist and then we need to tell MEP how to... Yup, Get the Control handle. So a control variable simply holds the address of the control. So this control address needs to be found before you can interact with said control. Bear in mind all the text boxes, buttons, and so forth are all controls in a traditional WinForm application. So MEP uses the title of the window to drill down and find the address of your text box for instance. Now that you have it, you can do things like sending a mouse click even to a button or setting it's text value if it's a text box. And they don't even need to be visible to do so. Also consider using the controls for flow control. I use Wait For Control often. It can make your macros Wikiwiki. I hope this helps. I'll follow this topic if you have more questions.
  2. Good suggestion. I couldn't figure out if he was talking about the TextType editor or not. It wouldn't have occurred to me that it was sized down. Cliff if that doesn't solve your problem I suggest sharing a screen shot of what you are referring to.
  3. Does that script work by itself? I thought one must execute macro code from within the app. I didn't think you could run them externally. For things like this I use Interop, but that needs to be executed in a .NET program. It's like a MEP for Office apps. Most of the commands are doing things as one might command a user to do them. It's not an MEP thing so if you're interested, PM me.
  4. In cases like this I find MEP control commands are easier to implement and more reliable.
  5. It's the same process. Just cast the sting to a date/time variable type instead of integer. Then add 20 to the year part of the Date/Time.
  6. See attached. There's no scope or activation defined. Add.mex
  7. rberg is right. Also when I open a new macro file I immediately delete the 4 standard variables. It's a holdover from ME3 and I feel one should meaningfully name their variables. Also only make them array variables when an array is needed.
  8. I don't know what VDI you use, but in most like Remote Desktop the Windows controls are all paused when not connected. This makes even having a VM often pointless. I've even had clients who have had racks of old PCs that ran macros for this reason. The way we would do it with them is to connect to the console session of a headless Windows machine, typically using VNC. By doing this one can disconnect from the machine but the console session doesn't pause like a RD session.
  9. I don't know as I use .NET, but I am guessing you can. You will need to create some objects and populate them. In .NET I have a WebBrowser object which I can navigate to an address. When it downloads the text of the HTML, it renders it into the DOM object. All elements become objects within the DOM object. WebBrowser Document. Then in there one can iterate though the element object or search for elements by ID. I'm guessing an equivalent could be found in JavaScript and you could command that from MEP. I'm sorry I don't know specifically and I'm not answering your question. I just thought I'd share how it works with other languages and that most languages have equivalent objects. https://www.w3schools.com/js/js_htmldom.asp
  10. Somehting like that is not simple and the interface is not simple. It would go in a direction of a proper programming language which is not the spirit of MEP. I moved to .NET becasue MEP is not the right tool for large batch automation of web pages. Mostly I don't even use a web browser but instead I send and receive HTTP requests/responses directly to the web server and process the data. It's fast and efficient and doesn't have the problem of trying to control another app. Also sometimes I'll create a WinForm program with a WebBrowser control. As such, all the elements are as you describe and can programmatically read from, written to, and controlled. It works slick as the DOM is an object with methods and properties and there are nice features like being able to find an element by an ID or is position in somehting like a Div or table. I believe if you want to start interacting with a DOM, you need to get into a proper programming language. I don't think a 'meant to be simple and easy' app can do that without making itself just as complicated as a programming language. And since they already exist, no need to reinvent the wheel. BTW I'm available for free consultations.
  11. MEP can not manipulate controls in a web browser control. The best solution is hitting the home button and tabbing around.
  12. You don't need a macro. Just drag and drop the message onto the Tasks icon in Outlook and it will do what you want.
  13. You don't need a macro, just set the file extension association to whatever app you want to open it with. Settings > Apps > Default Apps > Choose default apps by file type. Or you can double click the file, then select yoru app and check the box to "Always use this app..."
  14. Are you able to manually create a file in that location? You might try running MEP as an administrator.
  15. I do the same thing acantor does. It's sound advice. Don't forget to include reasonable delay in the loop also. For things like this I find 100 ms, 10 times a second, adequate. If a macro gets into an infinite or long running loop, don't forget you have a hotkey to abort macros. You can set it in preferences under the miscellaneous playback section. By default it's Win + End.
  16. You could also search your My Documents or whole hard drive for all files with the MEX extension. The newest should be the one you were using.
  17. I've tried explaining this. Macros are entities contained in an MEX file. You need that MEX file to be loaded. File > Open. Then they will appear on the left. Bear in mind you might have multiple files open at once so make sure when you create anew macro you are choosing the correct file to contain it. Just like Word, Excel, or whatever, you shoudl be mindful of which MEX files contain your macro and where they are. It's been a long time but I believe the default was a folder created by thin installed in your My Documents named "Insight Software\Macro Express 6". It's best you keep your macros in one place along with all your supporting files.
  18. Tools > Export Program Configuration... You can also export your settings. But I suggest that if you only have a few customizations, to manually set them. In my experience I sometimes make changes, forget to change them back, upgrades, or whatever. A new install with the basic configuration is a clean slate.
  19. I have no idea what you're talking about.
  20. I'm not sure what you mean. Macros are contained in a macro file with an MEX extension. To open one, File > Open File....
  21. It sounds like you didn't have a macro file loaded.
×
×
  • Create New...