Jump to content
Macro Express Forums

terrypin

Members
  • Content Count

    1,950
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by terrypin

  1. Thanks Alan. Yes, that’s nice. And it might have reduced the problems I had with my text editor, TextPad, at one stage of development, warning me that “Another program has modified your file; do want to reload?” I was admittedly in a hurry - this was a digression from the VBA macro that’s preoccupying me - so my edit was a bit rough. I’ve learnt something from your approach, thanks for investing the time.
  2. Thanks Alan, that is a tidier one, although I'm happy enough with your original. After making the various mods I described I've used it several times since my last post, in conjunction with the other three macros I added. // Alan's macro plus my edits // This macro checks each window. // If its title bar contains :\ we assume the window is an instance of the File Explorer // We extract the path and store it in a file: Variable Set String %ResultsFile% to "C:\Users\terry\Dropbox\Misc\All Results.txt" // Clear previous list of folders from text file Program Launch: "All Results.txt" (Normal) Parameters: Wait for Window Title: C:\Users\terry\Dropbox\Misc\All Results.txt] Text Type (Simulate Keystrokes): <CONTROL><HOME> // Go to start Delay: 0.1 seconds Text Type (Simulate Keystrokes): <CONTROL><SHIFT><END> // Select all text Delay: 0.1 seconds Text Type (Simulate Keystrokes): <DELETE> // Delete all text Delay: 0.1 seconds Text Type (Simulate Keystrokes): <CONTROL>s // Save the file // FOR THIS MACRO TO WORK... // 1. Set File Explorer options to display the full path in the title bar // LIMITATIONS // Testing for :\ may not be a foolproof way to determine if the window is an instance of File Explorer Variable Set Integer %Count% to 0 Repeat with Windows: Visible Windows: Store in variable %Title% If Variable %Title% Contains "Latest -" Continue End If If Variable %Title% Contains ":\" Variable Modify Integer %Count%: Increment Variable Set String %Result[%Count%]% to "%Title%" End If End Repeat Switch( %Count% ) Case: 0 // There are zero instances open MessageBox: Sorry! End Case Default Case // There is at least one instance Variable Set Integer %x% to 1 Repeat Start (Repeat %Count% times) Variable Modify String: Append %Result[%x%]% to text file, "%ResultsFile%" Variable Modify Integer %x%: Increment End Repeat End Case // Save 'All Results.txt' End Switch Text Type (Simulate Keystrokes): <CONTROL>s // Save finished file
  3. Thanks both, much appreciated. Will explore your helpful ideas later, Cory. Meanwhile, Alan, I've just tested the macro you prepared while I slept! Looked solid to me. I duly set titles to show full path - that will need automating later if I go ahead with this little project - and created an empty file. My only edit was to line 5: Variable Set String %ResultsFile% to "C:\Users\terry\Dropbox\Misc\All Results.txt" But running it (from F9) gave a very interesting result here, which was consistent on repeating. It promptly closed ME Pro! Well, not quite; Script Editor and Explorer and the tray icon vanished but (on being unable to promptly restart) I found in Task Mgr that MacExp.exe was still loaded. One other exception I would be able to filter out easily: my text editor, TextPad, displays tiltles containing its 'child' windows, e.g: Latest - TextPad - [C:\Users\terry\Dropbox\Electronics\Arduino\WORKFLOW.txt] As you warn, there may be others. I'm going out soon but will pick it up again late today. -------------------- EDIT: Tuesday 14 January 2020, 0936 Alan: I should have postponed my testing until after breakfast, or at least my first coffee; your macro now works a treat! 🙂 When defining each of your variables after pasting, I'd failed to set %Result% as an array. I've added an IF to skip that TextPad folder and I'd also probably clear the text before each run. That would still leave steps to toggle the full folder title. But after sleeping on it I'm hesitating about proceeding. Background is that an Excel VBA macro I'm developing does not work properly under Win 10 due to some obscure bug in the latter's API (above my know how level), if there are any File Explorer folders open. Hence my thought of toggling them on and off. But I've since thought of a way of accomplishing that part of the VBA macro's objective by using an MEP macro instead. I've been trying hard to rise above my 'copy-paste-edit' mode of working with VBA. But it's a struggle for someone who has never learnt an object-orientated programming language. MEP macro writing is so much more intuitive ... although I do love the speed of VBA. Neat work Alan, thank you! EDIT: 14:00 Back home earlier than expected and went ahead after all. Even if not used for the originally intended purpose this could be useful for other work occasionally. So I now have macros to toggle the folder full title on, close all folders except TextPad, create All results.txt, restore folders, and toggle folder full title off. Thanks again for giving me a kick start.
  4. Closing all Win 10 File Explorer folders at once is straightforward with this macro which simply uses the fixed position of the FE icon in the taskbar: Mouse Move: 164, 1182 Relative to Screen Delay: 0.1 seconds Mouse Right Click Delay: 0.3 seconds Mouse Move: 0, -38 Relative to Last Position Delay: 0.1 seconds Mouse Left Click Code: <MOUSE MOVE Option="\x01" X="164" Y="1182" _PROMPT="0x000A"/> <DELAY Flags="\x01" Time="0.1"/> <MOUSE RIGHT CLICK/> <DELAY Flags="\x01" Time="0.3"/> <MOUSE MOVE Option="\x03" X="0" Y="-38" _PROMPT="0x000A"/> <DELAY Flags="\x01" Time="0.1"/> <MOUSE LEFT CLICK/> But does anyone have any ideas on how to re-open them please? Presumably a matter of recording their full paths before they are closed, which eludes me right now. Half an hour searching the registry with targets like 'folders' and 'closed' found nothing relevant. Negative result from brief googling.
  5. Hi Alan, I just found it easier to keep track by splitting into those two sub-keys. I've never tried other locations which instinctively seems risky!
  6. Yes, me too. I chose a similar location, with separate keys for Integer and Text, and made it a 'Favorite' for fast access.
  7. Yes to the compatibility question (although you may want to make some minor changes). You could also take advantage of the free 30 day trial. On a possible discount I’d check with Insight Support either by direct email or via their Support Request form if you don’t get a response from them here.
  8. Gerry, I'd echo @acantor's suggestion to update to a current version. As you've discovered, 3.10 did not support arrays in the form we have now but in fact its entire variable structure was based on arrays. For example T[1], a unique string variable, was treated as the first in an array of 99. So if you do decide to stay with 3.10 then you could still follow the approach suggested, but it would be a little clumsier. Start with @cantor's code and tell us when you have difficulty progressing. Terry
  9. Yes. There are several ways you could do it. For instance you could use an array variable set up to contain the group names and its index could match the count through the Repeat loop.
  10. IMO it seems a strange design if so, with no obvious benefit and the clear disadvantage of losing an important item of information about each macro.
  11. I created a sub-category and moved about 50 macros to it from the parent. All the entries in the Modified column were changed to today. That data is quite useful when housekeeping so I'm very sorry to lose it. I don't regard a move as a file modification. Reproducible by others? A bug?
  12. I use a macro 'Comment (empty) below current line' with two alternative activations: Ctrl + F12 Mouse right-click on the Comment tool icon
  13. @Samrae: Neat! @snekmeseht: Seconds or milliseconds at the end? Terry, East Grinstead, UK
  14. “Sorry, I didn't read every message in this thread.“ Not even the most recent one? 😊
  15. @steynak: it would help us to help you if you show us the macro you have tried and describe the results you get. @kunkel321: I’m assuming that by ‘scripts’ the OP means ME scripts, I.e. commands. If not then he/she will no doubt tell us what type of external scripts.
  16. No screenshot or link as requested so I'll assume that you want to capture the text in pop-up boxes that do not allow the usual 'select then copy' approach. If the text needs to be pasted elsewhere but does not necessarily have to be 100% accurate, investigate OCR using a third party tool. If the text is brief and for your personal guidance after closing the message, consider capturing its image and displaying it conveniently, or saving it in a reference folder.
  17. Well, if you do have a question we’re going to need more information than that if you want help. Do you mean that you want to capture a particular type of message that does not allow copying to the clipboard? If so, describe an example in detail or tell us exactly how we can reproduce it. Show us some screenshots. Also, what script have you tried so far and what is the result? You can show your script commands and the resulting code using the Code tool, <>. Terry
  18. First, have you studied the Help and experimented with successive selections? I still don’t really understand what your overall objective is? Why do you need a macro to move a selection of files to a different folder? Can’t you do it within File Explorer? And if you’re selecting from multiple folders then surely that’s the most time consuming part of the task anyway, I.e. finding and selecting each one? With the file selected just activate your macro with a click or a hot key and then proceed to find the next target.
  19. I too found mouse operations much slower when i made the (big) jump from XP to Win 10 pro a few years ago. If you can upload a non-confidential test macro I'll run it and report back on performance. I always use the co-ordinate method that Alan described whenever possible.
  20. Hi Alan, Possibly this? https://pgmacros.invisionzone.com/topic/7613-variable-value-from-external-script-to-mep/ Or these, containing advice on external scripts from others too: https://pgmacros.invisionzone.com/topic/248-how-to-multiple-field-input-form-example/ https://pgmacros.invisionzone.com/topic/4916-how-to-return-value-from-external-script-to-mep/ https://pgmacros.invisionzone.com/topic/3640-external-scripts-how-far-are-you-pushing-them/ Terry
  21. Yes, as I suggested in the last comment line of the macro, you simply include Repeat and End Repeat commands to surround the main macro. Read the Help and experiment.
  22. If you're asking the OP of a year ago, good luck! I didn't get a response to my request for a screenshot or page link, which I think would have been the only hope of offering a solution.
  23. Did you run my macro or your version of it? For example, mine has a delay between the two lines you’ve shown: Text Type (Simulate Keystrokes): <ALT>d Clipboard Copy If you don’t succeed in getting it working, in your next post show us all your script and code.
×
×
  • Create New...