Jump to content
Macro Express Forums

terrypin

Members
  • Posts

    2,230
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by terrypin

  1. Excellent posts, thanks! I’ve plainly neglected error logging for far too long and those will be a great help. But the last recommendation gets the seegar, thanks so much @rberq. Of course, embarrassingly obvious once you see it suggested! And, thanks to Cory, I already I have his brilliant macro ‘Search and report on macro text’ which will do the job nicely.
  2. Hi Alan, Yep, you’re right on the mark there. I may return to it but meanwhile so much other stuff to do. Not least drastically culling my 2,300 macros! A key obstacle to that is avoiding removal of sub macros. MX Pro has no reliable way to identify which of these gets used in ‘main’ macros.
  3. Thanks Alan, much appreciate your nice work on this. But your macro means abandoning my existing familiar one, which I'd not want to do. At present it achieves the task of adding the 'unpercented name', in the logical place, namely within each such TBD, at the time they are inserted, where the variables can be reliably entered. If I've understood correctly your approach requires searching for them later, to add the 'unpercented name' and also do the sizing work, yes? On a specific, how and when do you expect the clipboard to capture the name of each variable? As I'm having some trouble testing it, would you mind sending me whatever files make up your own test environment please. If indeed it's possible at all I'd want any sizing to be either done in an add-on to my macro, or to follow it immediately in a fresh macro. The only ideas I had were to somehow (!) use either the complex Run macro in variable command, or the registry to manage the variable data. In practice, I guess the width and height and then change it after the first run. So I'm ready to conclude that this is one of those 'nice-to-have' macros that are not really worth the effort, apart admittedly for the intellectual satisfaction! Terry
  4. Morning Alan, 1. The latter. 2. I think a fixed width of say 120 chars would be OK (including 'xxx...xxx = ', with word wrap if then necessary. Terry
  5. Hi Alan, Still yet to get to my PC (tomorrow) but reading your three posts more carefully in bed now on my iPad, with a glass of Chardonnay for inspiration. I don’t see anything that automatically changes the size of the TBD? With several variables listed, varying in width, I’m wondering if there’s some way to resize it appropriately based on the length of the longest one? Of course, it’s easy enough to do manually, but.... Terry
  6. Many thanks Alan, those look very interesting. Garden chores all day today so will try them tomorrow morning.
  7. As well as following Cory's suggestions you could also sort the MX Pro Explorer list on the Modified column, showing the most recent at the top. BTW, I assume you included a prefix or suffix with 'pn' to activate your shortkey macro, (set with Options | Preferences | Activations | Shortkeys) as 'pn' alone obviously risks starting the macro whenever you (or a macro) types words like 'pneumonia', etc.
  8. This simple macro , written years ago, has proved very useful. When writing macros I use many Text Display commands, temporarily showing variable values. The macro makes their identification unambiguous. One day I'll get around to trying to improve it in a few ways, such as by automatically sizing the TBD. (But if anyone feels like tackling that for me...! ) <DELAY Flags="\x02" Time="100"/> <COMMENT Value="Assumes a Text Box Display command dialog window is open."/> <COMMENT Value="Assumes text cursor is at RH end of target line.\r\nActivation is l-click in small area to left of entries."/> <KEYSTROKE SPEED Delay="50"/> <TEXT TYPE Action="0" Text="<ARROW LEFT>" _COMMENT="Prepare to select all but the last percent sign."/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<SHIFT><HOME>" _COMMENT="Select"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<CONTROL>c" _COMMENT="Copy to clipboard"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<HOME>"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<CONTROL>v" _COMMENT="Paste"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<SPACE>=<SPACE>"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<HOME>"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<DELETE>"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<END>"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="Move to next line."/> <DELAY Flags="\x02" Time="100"/>
  9. I don’t understand what you mean. Your screenshot shows all the expected information. And are you using MXPro in elevated mode or not? If not, why not? I have not tested it, but I’m not sure whether elevated mode is necessary for the Mouse Locator to work correctly. Perhaps someone working in normal mode can confirm please? Edit: Just seen your additional comments. I have no file of that name. The present program executable for MXPro 6.1.3.1 is called MSLocate.exe and has a size of 810 KB. The only file with a name like that you give on my PC is MSLocate_v6.1.1.1.exe dated April 2019, size 786 KB. I would re-install 6.1.3.1.
  10. With MX Pro 6.1.3.1 I'm using Win 10 Version 1909 (OS Build 18363.900) and the Mouse Locator is displaying the colour code OK. MacEdit.exe and MacExp.exe are currently shown as 'Elevated' in Task Mgr. If the issue remains in any application, and after rebooting, I think my next step would be to type SFC /scannow into the Run box or at an elevated command prompt, in case any key DLLs have somehow become corrupted. If your Win 10 version has had a more recent update then perhaps that too is another possible cause. Failing any success I reckon I'd then re-install MX Pro. Terry, UK
  11. That correctly draws a rough circle here. Are you sure you have Brush tool selected before drawing? And that Colour 1 is not white? What was the result of running the macro I sent you? If all of that is OK after careful checking, then look for other factors that may differ. Single monitor here. Win 10 Version 1909 (OS Build 18363.900). No virtual systems etc.
  12. I assume you have removed those spurious lines from start and end of the current macro? I'm guessing they were also probably the reason you couldn't use the code box. After removing about 2,300 redundant lines from your macro, albeit hastily, and inserting a delay where described, it paints something vaguely like a face here: <MACRO PLAYBACK SPEED Speed="1"/> <WINDOW RESIZE Option="\x00" Partial="FALSE" Wildcards="FALSE" Method="\x00" Width="1624" Height="974"/> <DELAY Flags="\x03" Time="320"/> <MOUSE MOVE Option="\x02" X="1071" Y="129" _PROMPT="0x000A"/> <DELAY Flags="\x03" Time="23"/> <MOUSE LEFT BUTTON DOWN/> <DELAY Flags="\x01" Time="0.1"/> <MOUSE LEFT BUTTON UP/> <DELAY Flags="\x03" Time="262"/> <MOUSE MOVE Option="\x02" X="669" Y="408" _PROMPT="0x000A"/> <MOUSE LEFT BUTTON DOWN/> <DELAY Flags="\x01" Time="0.1"/> <MOUSE LEFT BUTTON UP/> <MOUSE MOVE Option="\x02" X="657" Y="465" _PROMPT="0x000A"/> <DELAY Flags="\x03" Time="337"/> <MOUSE LEFT BUTTON DOWN/> <DELAY Flags="\x03" Time="52"/> <MOUSE MOVE Option="\x02" X="660" Y="466" _PROMPT="0x000A"/> <MOUSE LEFT BUTTON UP/> <MOUSE MOVE Option="\x02" X="776" Y="472" _PROMPT="0x000A"/> <DELAY Flags="\x03" Time="398"/> <MOUSE LEFT BUTTON DOWN/> <DELAY Flags="\x03" Time="52"/> <MOUSE MOVE Option="\x02" X="776" Y="470" _PROMPT="0x000A"/> <MOUSE LEFT BUTTON UP/> <MOUSE MOVE Option="\x02" X="716" Y="507" _PROMPT="0x000A"/> <DELAY Flags="\x03" Time="113"/> <MOUSE LEFT BUTTON DOWN/> <DELAY Flags="\x03" Time="8"/> <MOUSE MOVE Option="\x02" X="727" Y="541" _PROMPT="0x000A"/> <MOUSE LEFT BUTTON UP/> <MOUSE MOVE Option="\x02" X="629" Y="552" _PROMPT="0x000A"/> <DELAY Flags="\x03" Time="157"/> <MOUSE LEFT BUTTON DOWN/> <MOUSE MOVE Option="\x02" X="793" Y="552" _PROMPT="0x000A"/> <MOUSE LEFT BUTTON UP/>
  13. Not here! With the Brush tool selected I simply move the mouse cursor. No need to hold the mouse key down. CORRECTION: Just tried it again and this time I did have to hold the mouse down. I think that previously while testing your macro a Mouse Left Down command had not been followed by a Mouse Left Up. Your comments on those weird chars? At least once, there is no delay between your mouse down and mouse up, which might cause a problem. <DELAY Flags="\x03" Time="254"/> <MOUSE MOVE Option="\x02" X="1071" Y="129" _PROMPT="0x000A"/> <DELAY Flags="\x03" Time="23"/> <MOUSE LEFT BUTTON DOWN/> <MOUSE LEFT BUTTON UP/> <DELAY Flags="\x03" Time="262"/> <MOUSE MOVE Option="\x02" X="1071" Y="130" _PROMPT="0x000A"/>
  14. Firstly, Script.txt contains weird characters at the start and end. -------------------- ​ <MACRO PLAYBACK SPEED Speed="1"/> <WINDOW RESIZE Option="\x00" Partial="FALSE" Wildcards="FALSE" Method="\x00" Width="1624" Height="974"/> . . Total 2,375 lines . . . <MOUSE MOVE Option="\x02" X="949" Y="626" _PROMPT="0x000A"/>  ​ -------------------- When pasted into MX Pro they become Text Type commands, such as: Text Type (Simulate Keystrokes): ​ Secondly, my typo sorry. I meant Left Mouse. not Ctrl key. IOW, why are you drawing with the mouse key depressed? I'll take a look at the 2,300 odd lines of code after lunch!
  15. Hello Mike. I'm not a regular Chrome user but I just tried it with the shortcuts @rberq mentioned. Strangely Ctrl+1, Ctrl+3, Ctrl+4, etc all worked OK. But Ctrl+2 consistently did nothing. So in case you'd already been using that, avoid it by using Ctrl+1 followed by Ctrl+Tab. And brief research shows that similar Chrome shortcut problems are not rare. The following macro worked consistently here: // Assumes Chrome is open. // Any of Chrome's tabs could currently be selected. But the window tiltle of all of them will include the string ' - Google Chrome'. // Assumes Excel is open and active, with a cell in the Parts column selected. // This macro will copy the selected part number and paste it into a text field of the page open in Tab#2 of Chrome. Clipboard Copy Window Activate: - Google Chrome Wait for Window Title: - Google Chrome // Select tab #2 by using Ctrl+1 folowed by Ctrl+Tab (to avoid the issue I described, if it's present for you too). Text Type (Simulate Keystrokes): <CONTROL>1 Delay: 0.1 seconds Text Type (Simulate Keystrokes): <CONTROL><TAB> Delay: 0.1 seconds // Navigate with tabs or mouse clicks to the text target location. Mouse Move: 434, 643 Relative to Current Window Mouse Left Click // Paste from clipboard. Clipboard Paste CODE (for pasting to Direct Editor): <COMMENT Value="Assumes Chrome is open."/> <COMMENT Value="Any of Chrome's tabs could currently be selected. But the window tiltle of all of them will include the string ' - Google Chrome'."/> <COMMENT Value="Assumes Excel is open and active, with a cell in the Parts column selected."/> <COMMENT Value="This macro will copy the selected part number and paste it into a text field of the page open in Tab#2 of Chrome."/> <CLIPBOARD COPY/> <WINDOW ACTIVATE Title="- Google Chrome" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <WAIT FOR WINDOW TITLE Title="- Google Chrome" Partial="TRUE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <COMMENT Value="Select tab #2 by using Ctrl+1 folowed by Ctrl+Tab (to avoid the issue I described, if it's present for you too)."/> <TEXT TYPE Action="0" Text="<CONTROL>1"/> <DELAY Flags="\x01" Time="0.1"/> <TEXT TYPE Action="0" Text="<CONTROL><TAB>"/> <DELAY Flags="\x01" Time="0.1"/> <COMMENT Value="Navigate with tabs or mouse clicks to the text target location."/> <MOUSE MOVE Option="\x02" X="434" Y="643" _PROMPT="0x000A"/> <MOUSE LEFT CLICK/> <COMMENT Value="Paste from clipboard."/> <CLIPBOARD PASTE/> Otherwise, can you post your commands and code (using the code tool <>) which should help us look closer at your issue. Terry
  16. Hello Hannes, Sorry to hear about that discouraging start, but it’s almost certainly something very basic. The simplest way we might help is for you to upload your failed macro details. Use the Code icon <> and post the commands and then (after a gap) the actual macro code. But, although it's tempting when you start out, I'd recommend you generally avoid capturing as a macro creation method. It typically generates so much redundant code that - if it doesn't work immediately - troubleshooting can be hard work. EDIT: BTW, why are you holding down the Ctrl key? Terry
  17. I’m not sure exactly what you mean by structured programming? If not simply using ‘sub macros’ widely, as I expect most experienced users do, then could you give an example please? One downside in MX Pro is managing variables reliably across the constituent sub macros. I’m not a programmer but I assume that’s not an issue with modern programming languages.
  18. So there is no data anywhere directly showing the total number of pages, as there usually is in a regular PDF? Could you show us an example of the PDF? And your macro, or the relevant part of it.
  19. It was an interesting question and it would have been nice to get some feedback on the outcome.
×
×
  • Create New...