Jump to content
Macro Express Forums

terrypin

Members
  • Posts

    2,232
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by terrypin

  1. 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.
  2. 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.
  3. 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
  4. 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.
  5. 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.
  6. 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.
  7. Script: // BEFORE RUNNING: Read the opening comment lines to ensure I've interpreted your requirement accurately. // BEFORE RUNNING: Assign the required variables. (Quickest method is to open each command by double clicking it and respond Yes to the program's requests.) // I've used longish delays to be on the safe side. // I've used meaningful variable names as @samrae advised you. I prefix them to indicate their type, avoiding ambiguity in complex macros. // STARTING STATE BEFORE MACRO IS ACTIVATED A single file is selected in an active (focused) File Explorer folder. // PURPOSE OF MACRO Copy the seleced file to another existing user-selectable folder. Clipboard Empty Text Type (Simulate Keystrokes): <F2> // Edit mode. Delay: 0.2 seconds // Select all. (Iincluding extension, which I found necessary in Win 10.) Or use @acantor's equally effective method. Text Type (Simulate Keystrokes): <CONTROL>a Delay: 0.2 seconds Clipboard Copy Delay: 0.2 seconds Variable Set String %tFilename% from the clipboard contents Text Type (Simulate Keystrokes): <ESC> // Close edit mode Delay: 0.1 seconds // Select address of current folder. Text Type (Simulate Keystrokes): <ALT>d Delay: 0.1 seconds Clipboard Copy Delay: 0.1 seconds Variable Set String %tFolder% from the clipboard contents Text Type (Simulate Keystrokes): <ESC> // Close edit mode Delay: 0.1 seconds // Now re-assemble the original full filename and path. Variable Modify String %tFullFilename%: Append Text String Variable (%tFolder%) Variable Modify String %tFullFilename%: Append Text (\) Variable Modify String %tFullFilename%: Append Text String Variable (%tFilename%) Variable Modify String: Save %tFullFilename% to the clipboard Delay: 0.1 seconds // When testing or trouble-shooting it's helpful to show results at key stages, as in the following example. (Disable or delete this command when satisfied.) Text Box Display: Result so far // Now allow user to choose the destination folder. Text Box Display: Choose destination folder Text Type (Simulate Keystrokes): <ALT>d Clipboard Copy Delay: 0.1 seconds Variable Set String %tDestination% from the clipboard contents Text Type (Simulate Keystrokes): <ESC> // Deselect folder box Delay: 0.2 seconds Copy File/Files: "%tFullFilename%" to "%tDestination%" // You could now add commands to return focus to the original folder if you wish. Or whatever. Such ad including the above in a Repeat loop to copy a SUCCESSION of files. Code: <COMMENT Value="BEFORE RUNNING: Read the opening comment lines to ensure I've interpreted your requirement accurately." _BACK="0080FFFF"/> <COMMENT Value="BEFORE RUNNING: Assign the required variables. (Quickest method is to open each command by double clicking it and respond Yes to the program's requests.)" _BACK="0080FFFF"/> <COMMENT/> <COMMENT Value="I've used longish delays to be on the safe side."/> <COMMENT Value="I've used meaningful variable names as @samrae advised you. I prefix them to indicate their type, avoiding ambiguity in complex macros."/> <COMMENT/> <COMMENT Value="STARTING STATE BEFORE MACRO IS ACTIVATED\r\nA single file is selected in an active (focused) File Explorer folder."/> <COMMENT Value="PURPOSE OF MACRO\r\nCopy the seleced file to another existing user-selectable folder."/> <COMMENT/> <CLIPBOARD EMPTY/> <TEXT TYPE Action="0" Text="<F2>" _COMMENT="Edit mode."/> <DELAY Flags="\x01" Time="0.2"/> <COMMENT Value="Select all. (Iincluding extension, which I found necessary in Win 10.) Or use @acantor's equally effective method."/> <TEXT TYPE Action="0" Text="<CONTROL>a"/> <DELAY Flags="\x01" Time="0.2"/> <CLIPBOARD COPY/> <DELAY Flags="\x01" Time="0.2"/> <VARIABLE SET STRING Option="\x02" Destination="%tFilename%" NoEmbeddedVars="FALSE"/> <TEXT TYPE Action="0" Text="<ESC>" _COMMENT="Close edit mode"/> <DELAY Flags="\x01" Time="0.1"/> <COMMENT Value="Select address of current folder."/> <TEXT TYPE Action="0" Text="<ALT>d"/> <DELAY Flags="\x01" Time="0.1"/> <CLIPBOARD COPY/> <DELAY Flags="\x01" Time="0.1"/> <COMMENT/> <VARIABLE SET STRING Option="\x02" Destination="%tFolder%" NoEmbeddedVars="FALSE"/> <TEXT TYPE Action="0" Text="<ESC>" _COMMENT="Close edit mode"/> <DELAY Flags="\x01" Time="0.1"/> <COMMENT Value="Now re-assemble the original full filename and path."/> <VARIABLE MODIFY STRING Option="\x07" Destination="%tFullFilename%" Variable="%tFolder%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x06" Destination="%tFullFilename%" Value="\\" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%tFullFilename%" Variable="%tFilename%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x10" Destination="%tFullFilename%" NoEmbeddedVars="FALSE"/> <DELAY Flags="\x01" Time="0.1"/> <COMMENT Value="When testing or trouble-shooting it's helpful to show results at key stages, as in the following example. (Disable or delete this command when satisfied.)"/> <TEXT BOX DISPLAY Title="Result so far" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 tFilename = %tFilename%\r\n\\par \r\n\\par tFullFilename = %tFullFilename%\r\n\\par \r\n\\par \\f1 tFolder\\f0 = \\f1 %tFolder%\r\n\\par \r\n\\par }\r\n" Left="541" Top="485" Width="638" Height="188" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <COMMENT Value="Now allow user to choose the destination folder."/> <TEXT BOX DISPLAY Title="Choose destination folder" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n{\\colortbl ;\\red255\\green0\\blue0;}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 Navigate to your destination folder by whatever means you prer and leave it active.\r\n\\par \r\n\\par \\cf1 Then\\cf0 click OK to close this message and continue.\\f1 \r\n\\par }\r\n" Left="677" Top="776" Width="435" Height="171" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <TEXT TYPE Action="0" Text="<ALT>d"/> <CLIPBOARD COPY/> <DELAY Flags="\x01" Time="0.1"/> <VARIABLE SET STRING Option="\x02" Destination="%tDestination%" NoEmbeddedVars="FALSE"/> <TEXT TYPE Action="0" Text="<ESC>" _COMMENT="Deselect folder box"/> <DELAY Flags="\x01" Time="0.2"/> <COPY FILE/FILES Source="%tFullFilename%" Dest="%tDestination%" Progress="FALSE" Recurse="FALSE"/> <COMMENT Value="You could now add commands to return focus to the original folder if you wish. Or whatever. Such ad including the above in a Repeat loop to copy a SUCCESSION of files."/> Exported macro: Attached. Terry CopySelectedFileToAnotherFolder.mex
  8. Hi, I'd like to help but I frankly don't understand your problem description. And obviously it's impossible to test your macro without the appropriate files and folders. Can you explain again but in plainer terms. I'm guessing here, but something like this: "I want to build a text file called 'Music Sorting Log.txt'. Each line will contain the full path and filename of...etc, etc". IOW, what is your objective expressed in conversational terms? There are several points I find vague or unclear. What exactly is the status at activation? IOW, what is selected? A file in an Explorer folder? A filename, already in Edit mode (F2)? What type of files? (I'm guessing audio: MP3/WMA/WAV/etc? You say: 1. The Macro will display a list of predefined Target Directories. But your macro doesn't appear to display a list. 2. On clicking on one of the them it will move the file/files (details of which will be in the clipboard) to the selected Directory. But your macro doesn't prompt for any user clicking. And how can multiple 'details' (do you mean names?) all be in the clipboard? As always, the devil is in the details!
  9. Alan, Yes, absorbing! On the downside, I can't immediately recall why I wrote that 🙂
  10. Hi Alan, Saw this just before dashing out so have not yet tried your script. I expect this old one of mine will be much slower, designed for relatively short strings. Note that the Variable Restore is disabled. This was intended as a submacro. Later... Terry EDIT: Back home and tested both. Indistinguishable difference in performance until I got to 5,000 random characters when mine seemed very slightly faster. Variable Restore: Restore Text Variables // Restore Input from a previous macro // Disable the next TBD if you want silent running. Variable Set String %Input%: Prompt Variable Set Integer %Length% to the length of variable %Input% Repeat Start (Repeat %Length% times) Variable Modify String: Copy part of text in %Input% starting at %Index% and 1 characters long to %Char% Variable Modify String %Output%: Append Text String Variable (%Char%) End Repeat // Disable the next TBD if you want silent running. Text Box Display: Full Input string reversed <VARIABLE RESTORE Option="\x01" _ENABLED="FALSE" _COMMENT="Restore Input from a previous macro"/> <COMMENT Value="Disable the next TBD if you want silent running."/> <VARIABLE SET STRING Option="\x01" Destination="%Input%" Prompt="Please input a string of characters" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0"/> <VARIABLE SET INTEGER Option="\x0D" Destination="%Length%" Text_Variable="%Input%"/> <REPEAT START Start="%Length%" Step="-1" Count="%Length%" Save="TRUE" Variable="%Index%"/> <VARIABLE MODIFY STRING Option="\x09" Destination="%Char%" Variable="%Input%" Start="%Index%" Count="1" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%Output%" Variable="%Char%" NoEmbeddedVars="FALSE"/> <END REPEAT/> <COMMENT Value="Disable the next TBD if you want silent running."/> <TEXT BOX DISPLAY Title="Full Input string reversed" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 %Output%\\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"/>
  11. Unless an ME3 user steps in I'd suggest you continue the discussion in the ME3 forum, where you posted recently. I no longer have ME 3 installed, so cannot test it, but it looks to me as if you've not opened the activation properties properly. How long is it since you used the program before working on this particular task? Have you started afresh and written a simple macro that delivers keystrokes - to other apps? - to this WP app? ...and (in that new macro) explored changing activations, to ensure that you are following the correct steps. Also check that your version is up to date. And try re-installing ME3. Or, if your usage justifies it, upgrade to ME Pro. Good luck.
  12. @Cliff S This is hard work! When replying please either use the Quote facility or distinguish quoted material in some way. Such as by using italics etc as I'm doing here. My reply below is now arguably academic, because your latest post finally makes your question clear with the screenshot requested six days earlier. But FWIW here are my replies to your post of 24th Sep replying to my explanation of 20th. Me: By "...simply click on the first tab before further navigation" I mean do so with your macro, not manually! IOW, use Mouse Move and Mouse Left Click commands. You: Not quite sure that I understand this. Are you saying that the macro being created, the first line should be instructions to point the mouse to the first tabs coordinates. Then have the macro perform a left click? That sounds like a good work around. Yes. But that's typically used with web browser tabs. Me: EDIT: It's usually more productive to confine a discussion to a single thread. I see you've also posted on essentially the same topic here. I'll confine my replies to this thread. You've identified the application as Open Office Writer. So I loaded up a very old copy from my XP days and wrote the following one line macro which does what you say MEP cannot do, namely select all text. As @samrae said, use lower case 'a'. You: My apologies if I had previously made a similar post. It must have been a long time ago. I don't recall that the old post was related to getting to a tab that contained the select all command. Me: And returning to your tabbing query, in the main Open Office application here, simple commands to access each tab do what they should correctly. It was not a long time ago, but very recent, 19th Sep. You: The screen shot resembles no screen I have ever encountered before. It did not come from me. I don''t recall a @samrae. That's why we asked you for your screenshot. And I told you the source of my screenshot. @samrae answered your recent post, whose link I gave you. You did not reply but presumably you do now appreciate the distinction he (and later I) made. Here's the link again: https://pgmacros.invisionzone.com/topic/8506-me39-types-characters-will-not-perform-commands-in-word-processor/
  13. Seems to be covering similar ground to here. See my reply in that thread.
  14. When we see the screenshot of your starting point, maybe we’ll be able to help you further. And your current macro too. I don’t understand what you mean by “a ME3 macro does not do that.” Are you saying that a command in your macro to simulate typing Home for example does not do so? Are you sure that the application is in exactly that state and has focus when the macro runs? By "...simply click on the first tab before further navigation" I mean do so with your macro, not manually! IOW, use Mouse Move and Mouse Left Click commands. Also, although I'm guessing (as you haven't yet told us the app or shown us a screenshot), sometimes simply using Backspace repeatedly will halt at the left most tab. From which you can then navigate with tab. (That's Backspace with the macro!) The devil is in the details! EDIT: It's usually more productive to confine a discussion to a single thread. I see you've also posted on essentially the same topic here. I'll confine my replies to this thread. You've identified the application as Open Office Writer. So I loaded up a very old copy from my XP days and wrote the following one line macro which does what you say MEP cannot do, namely select all text. As @samrae said, use lower case 'a'. And returning to your tabbing query, in the main Open Office application here, simple commands to access each tab do what they should correctly. Text Type (Simulate Keystrokes): <CONTROL>a // Select all text Here's the code: <TEXT TYPE Action="0" Text="<CONTROL>a" _COMMENT="Select all text"/>
  15. And have you tried other keys? Sometimes a simple Home or Ctrl+Home will get you to a fixed tab from which you can then confidently navigate. While you're at it, try Ctrl+Tab, Ctrl+PgDown, Esc, etc. Or, if your starting screen is consistent in its layout, simply click on the first tab before further navigation.
  16. Hi Joe, It would be useful to know what OS you're running, as pixel hunting with MEP has become significantly slower for me under Windows 10, although I still end up resorting to it quite frequently. I'd echo @acantor's approach, with a couple of other points. Assuming that your screenshot occupies about half the screen height, I'm guessing your green band has a depth of say 50 pixels. So you could first search for its presence very quickly in say 40 px increments. Any value a few px fewer than its depth. Having next found its precise top (using 1 px jumps) as @acantor outlined, you should be able to jump straight to the blue icon clickable region, by calculation alone I think. BTW, when posting a screenshot in a topic about pixel colours and positions it's better to use say a BMP or PNG file type. Yours looks like a JPG, the colours of which are never faithful due to artifacts caused by compression. Try the mouse locator over your image in this thread to see the many different colours in your green band.
  17. @rberg: For Firefox and its derivatives like Waterfox there's Add URL to Window Title (Advanced KeePass Usage) https://addons.mozilla.org/en-US/firefox/addon/add-url-to-window-title/ @Service Center: There's also the direct option of triggering the entire activity by running a macro instead of a bookmark. It would open the page and then do your work on it. A pop-up menu containing all such 'web work' macros would be a convenient access method. Or, if there are only a few, memorable hotkeys. Alan: Me too; many nerdy hours of pixel and text forensics!
  18. Thanks, yes, I hadn't tried re-opening. Although before doing so, if you remove focus from the command by clicking elsewhere (outside the main script section), then the command is not highlighted with the assigned colour.
  19. It seems that if a macro has only one command then it cannot be given a background colour. Only spotted it while I was highlighting commands containing a certain text string, and some of these are in macros containing just a single command (usually Program Launch.). Trivial to fix by adding a redundant Comment. Can others reproduce please?
  20. No I would not remove it. Apart from its CPU usage being negligible, I believe its purpose is to allow MacExp.exe and MacEdit.exe (both 32-bit programs) to work properly with 64-bit programs.
  21. Did you explore the earlier suggestions such as using Controls or pixel recognition? What tests have you done with those? We really need to see an actual example we can try. A web page or a free program download link. Or alternatively, a few much higher resolution screenshots. As I understand it, what you do have to work with is a known dialog containing named text boxes. Just the one you showed, or are there others? What does the entire screen look like at the time you want to activate your macro, and exactly what do you want it to do? I assume the text boxes into which you want to click are always all in the same relative positions, although actual screen pixel locations will vary for the reasons you gave. So as @acantor suggested, clever/complex use of pixel identification might work. Another approach might be OCR followed by string tests. It would need a third party OCR tool and extra logic in your macro to ensure reliability. One other long shot. Open a typical screen containing the text boxes and then run a macro which includes at minimum a Window Activate command or similar. Does MEP include the dialog as a window in its list (Visible or Hidden)? Unlikely, but if so you could use the Variable Set Integer options to establish its location and dimensions, and therefore where to click a specific text box. The devil is in the details!
  22. That's what the Mouse Locator tool is for. I recommend you read the excellent Help offered in the program.
  23. What happens if you do use the mouse commands? In some applications I find that's the only reliable way to get the job done. For example, Mouse Move: 123, 456 Relative to Current Window Mouse Left Click // Click at end of Name box Text Type (Simulate Keystrokes): <SHIFT><HOME> // Select existing text etc
  24. Not sure. Haven’t heard from him for years. See also this thread: https://pgmacros.invisionzone.com/topic/7762-where-is-joe/?tab=comments#comment-26020
  25. Thanks. I've reported my issue to Insight. Anyone else able to reproduce please?
×
×
  • Create New...