Jump to content
Macro Express Forums

UAMike

Members
  • Posts

    57
  • Joined

  • Last visited

Posts posted by UAMike

  1. I'd like to be able to use the F1 Key as a program-specific hotkey to serve as the delete button so that I can delete a line in the Editor with my left hand. When I hit the key, it pops up the help menu, which I don't care to ever see using a hotkey. Is there a way to reclaim this reserved key?

     

    On my old machine, this worked without issue, but I am not sure if it's because of an older MEP version, the fact that I was using a virtual desktop, or because of some other tweaking I did.

     

  2. I work in the healthcare field and my job performance is based primarily on production metrics. I review medical information, make a clinical decision, and populate a document based on my findings. Over the course of the last 10 years, I have used MEP to automate virtually all aspects of my job (with the exception of having to make a clinical decision) to the point where I could, in theory, be twice as productive as the highest producer in my department. I say in theory because after being fired at my last job for being suspiciously too productive, I have made it a point to fly under the radar so as not to raise any eyebrows as to what I’m doing.

     

    But just as I’ve automated a lot of my work, so too has my employer, not unlike so many businesses worldwide, and now I find myself in a race to increase my efficiency in order to meet higher and higher production goals. I disagree so strongly with some of the things we’ve implemented that are meant to be time savers… they were designed either by people with no clinical background, or no knack for automation.

     

    What do I do? It would be hard share what I’ve done with members of my management, who aren’t themselves high-level decision makers or particularly tech savvy to know what they’re looking at. I would see this playing out any number of ways:

     

    • I could be fired for violating some policy (time wasting or something like that).
    • They wouldn’t see any value in what I’ve done or not really be in a position to do something about it other than give me a pat on the back.
    • In the best case scenario, I think they would see the value in it and want to implement these ideas… but as you all know, these macro often require maintenance, tweaking, workarounds, and do not have the polish of a professional program.

     

    All this to say that I feel sort of stuck. I know what MEP has done for me and how it has changed the way that I work and even the way that I think, but what do I do with this skill? Knowing how to use MEP doesn’t make me a software developer, but I think that the skills I’ve acquired could be applied to so many processes or for so many companies. How can I leverage these skills and present them to my employer, or a future employer?

  3. 16 hours ago, Bruce Thomson said:

    I'll ask a dumb question...
    Why don't you simply use Alt-Tab to see and click the window to be activated.
    I would have thought that that would be even faster than invoking a macro.

    I'm trying to hide and show several windows at the same time. Plus, alt-tabbing and picking the correct window would probably end up being more keystrokes even if I just needed to access one window.

     

    14 hours ago, acantor said:

     

    Consider making a feature request: add more functionality to the "If Window" dialog:

     

    Will do

  4. I have macros that display several text boxes simultaneously on the screen and use two separate hotkey macros to show and hide them. I'd like to be able to instead just use one hotkey that would determine whether the windows are visible and then hide them, or make them visible when they are hidden, but I cannot find a way to do this. The closest command I can find that would help with this task is "If Window is focused", but the text boxes that I am using aren't meant to grab focus unless I specifically click on them. Is there a way to achieve this 'toggle' macro that I am wanting to create?

  5. On 5/20/2021 at 2:22 PM, terrypin said:

    Is it possible to show us the web app? Otherwise mainly guesswork. If confidentiality precludes that, then can you find another accessible web site that gives you the same problem?

    Yes confidentiality is an issue... I wish I could show you so you'd have a better idea, but the best I could do right now is a few screenshots taken with my phone. I can't think off the top of my head of a web site that behaves like this... probably because it's not best practice to build sites this way.

     

    On 5/20/2021 at 5:50 PM, acantor said:

    In summary, sometimes a single, strategic click can get you close to your target, and then you can Tab or Shift + Tab the rest of the way to the target.

     

    Macros that ferret out neutral zones tend to be complex, clunky, and hard to maintain. I avoid them if there are alternatives. But sometimes there are no alternatives.

     

    Unfortunately, not every web app has neutral zones. And if that's the case, although automating a task with macros might be possible, it's probably not going to be easy!

     

    This is a good idea and I will try to experiment with neutral zones some more. In the attached screenshots, you'll see that I've clicked in such a way as to outline the outer border of this big box, which I now realize is embedded within a larger box that takes up the entire browser window. There is no clickable left margin outside of the outer box, and the slimmest of margins on the right side, although I think this is where the browser's scroll bar would be if the page was long enough. 

     

    One new discovery is that there are buttons on the top and bottom of the page that are findable and clickable using the ctrl+f method. Since they're only at the top and bottom, though, it's they're not all that useful for tabbing to somewhere in the middle of the page.

     

     

  6. 14 minutes ago, Cory said:

    Sorry. I clicked submit accidently.

    If there is a label to some kind of unique text near the TextBox you desire do a find for it. Ctrl+f > search for term > Escape > tab X times. When you hit excape the found term will be highlighted and the documents cursor position will remain there. So maybe you have a label left of the field you want named "Date of Hire". Find it, escape, it will now be highlighted, and tab once to get into your field. 

    Will that work?

    The Ctrl+f is the first thing I tried. That's my bread and butter for most things I try to do inside a web browser. It doesn't work because after I press ESC, pressing tab or shift-tab will bring me to the first or last field respectively. 

  7. My employer started using a new web-based app and I need help on how I can focus on specific text fields. My go-to method in the past was to use the search function in Chrome to find specific text and then tab to the correct place from there, but it doesn't seem that this method will work in this new app. The reason this is not working for me is that the webpage has a massive embedded field where all the individual text boxes are located (Not sure what the right term for this is... but it has it's own scroll bar if that helps explain). So, when I search for specific text, as soon as I try to tab somewhere, it shoots me back to the first text field within this larger embedded box. I've tried a few other things so far...

     

    • Just tabbing to the right field: I think this won't work because certain fields are sometimes greyed out and I can't predict when this will be the case. I might need to further explore this method to see if I can determine if this is possible.
    • Using controls in MEP: I've never actually done this before, but following the MEP help file, I don't think it's possible because MEP isn't recognizing individual text boxes when I used the crosshairs to set the control. In my first attempt, I thought I had it working because it jumped to the right field, but I wasn't able to recreate this when I picked a different field to click on... not really sure what to make of this.
    • Searching for pixel colors: I've used this in the past and it's pretty slow and unreliable. I know some people in this forum can attest to that. I wouldn't mind using this method if there just one or two fields I needed to get to, but that isn't the case here. Plus, I think the fact that there's a scrollbar involved would only further complicate things.

     

    Are there any other methods I should explore?

  8. On 2/21/2021 at 10:04 AM, terrypin said:

    I'm making more use of the handy Set Background color... option, and sometimes need lighter colours than those in the main grid of the Colour dialog. But after using Define Custom Colours to add my own, and returning to work on the macro later, these have disappeared. What is the expected lifetime of Custom Colours and what behaviour do other users see please?

     

     

     

    I saw a macro on this forum some time ago that when through the steps of selecting a background color and I used it as the starting place for a macro that sets all of my custom colors. Instead of picking one of the set colors, it tabs over to the RGB fields and fills them in from integer values that I have defined in an array. This has to be done every time MEP is restarted. It works, but I haven't yet decided whether it's worth the trouble.

     

    As I am writing this, it is occurring to me that instead of setting the RGB values, you could instead use Hue/Sat/Luma and perform a calculation (let's say... divide luma by 2 or whatever you think looks nice) to get perfectly offset text/background colors.

  9. 2 hours ago, rberq said:

    If I understand the question, if the target "Page x of y" is always at the end, try this:

     

    move clipboard data to variable %work%,

    set integer %length% to length of %work%,

    set %position% to %length% minus 100,

    copy %work% from %position% for length of 100 to %shortwork%,

    use your existing logic to scan %shortwork% rather than scanning the whole PDF. 

     

    100 bytes pulled off the end of the file should be plenty, if the paging is always at the very end.  If not, use 200 bytes, or whatever.  The point is, scanning 100 bytes should be much quicker than scanning the whole PDF. 

     

    If you want to speed it up even more, don't search specifically for "of 50", "of 49", etc.  Rather, find the positions of "page " and "of ", then extract the next few characters beyond "of " and that should be the number of pages. 

     

    Thank you, this is what I was hoping to accomplish. I never knew what I would do with the "set integer to the length of a variable"... but now I know and it's a valuable tool that I can add to my arsenal. I will also have to explore what I can do with "Set to position of text in a text variable"

  10. 3 hours ago, terrypin said:

    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.

     

    1 hour ago, Cory said:

    You might want to check out A-PDF or similar utilities. I use a few of them with my macros, especially the command line versions. I seem to remember one that would show the properties. Anyway it works great with MEP.

     

    I think I would do it a different way. I would open it in Acrobat and get the document properties (ctrl+d). You can use Get Control to get the number of pages. 2020-06-10_16-35-14.jpg.6f27542b7743e452c0de0d533fa59495.jpg 

     

    I think I over-complicated my ask when I mentioned the bit about PDFs. The main point was that I wanted to extract values from a long string, which I do quite frequently in a number of macros that I use, except I was hoping to speed up the process by jumping to the end of the string.

  11. Part of one of my macros is dedicated to counting the number of pages in an embedded PDF document. This is accomplished in a chrome browser by issuing a Ctrl+A, saving the clipboard text to a variable %clipboard%, then running a loop that counts down and searches for the text "of 50" "of 49" "of 48" (ie. Page 1 of 48) etc. The macro itself works just fine, but is quite slow. I assume this is because it has to check the contents of a rather large string.

     

    I was wondering if there was a way to shorten the string to make the process quicker. The text "Page 1 of XX" always comes at the end of the string but it is impossible to predict how many characters will lead up to it, so I can't use the function to delete or copy part of a string. Is there a smarter way of accomplishing this task? If only MEP allowed you to modify a string starting at the end...

  12. 19 minutes ago, Cory said:

    Extended ASCII charts like this all show 242 as that "O" with a feather in it's cap. It seems that most fonts abide by this instead of the original assignment. Perhaps it can't be done. I'll think more after lunch. 

     

    BTW Unicode is, with a little qualification, two bytes. So MEP will usually only see the first byte and interpret that as whatever it is in the ASCII scheme. So there will be a large number that will always appear as "=" or other random character. It's cutting the character's bits in half. 

     

    I've also tried using 242 and 243 without luck. Like you mentioned, it seems to end up as ò or ó

  13. Is MEP to handle "≥" and "≤" characters? 

     

    When I save a string variable containing one of these, they inevitably get turned into "=". In fact, it doesn't even seem like the editor can handle these characters... they always just turn into the "=" symbol. I would like MEP to recognize these characters and then convert them to their text form. My thought was to use the command "Variable set to ASCII Char", but I don't believe that there is a number that corresponds to these symbols. 

     

     

     

  14. 1 hour ago, rberq said:

    Play around with this.  I think it does what you want, or close to it.
    This is written in Macro Express 3; if you have the PRO version you can
    name the text and integer variables instead of using the standard "T" and "N" names.  

     

    // Set input string for testing
    Variable Set String %T1% "123"
    // Clear output string to null
    Variable Set String %T99% ""
    // set integer with length of input string
    Variable Set Integer %N1% from Length of Variable %T1%
    // Append input characters one at a time to output string, with comma and blank after each (except last)
    Variable Set Integer %N99% to 1
    Repeat Until %N99% > %N1%
      Variable Modify String: Copy Part of %T1% to %T89%
      If Variable %N99% = variable %N1%
        Variable Modify String: Append "AND " to %T99%
      End If
      Variable Modify String: Append %T89% to %T99%
      If Variable %N99% < variable %N1%
        Variable Modify String: Append ", " to %T99%
      End If
      // ....    bump pointer to next input digit
      Variable Modify Integer: Inc (%N99%)
    Repeat End
    //  
    // If input string only two digits, get rid of the comma before the AND
    If Variable %N1% = 2
      Replace ", AND" with " AND" in %T99%
    End If
    // If input string only one digit, get rid of the AND as well
    If Variable %N1% = 1
      Replace "AND " with "" in %T99%
    End If
    //  
    // Display result
    Text Box Display: Output string
    Macro Return
    // 

     

    This works really nicely! In order to bump the pointer to the next digit, I modified the command: Variable Modify String: Copy Part of %T1% starting at %N99% and 1 characters long to %T89%. 

     

    This only works using 1 digit numbers, but it will work for my purposes. Thank you!

  15. 19 minutes ago, Cory said:

    What if they need a 2 digit number? I think they would need to have some delimiter between each value in that case. It makes a difference on how I would approach it.

    I was trying to keep it simple for myself by only have 1 digit numbers, as this would work for my purposes 99% of the time. 

     

    My plan was to use statements like: If Variable %string% contains "1" and I realized that this would get misinterpreted if I used two digit numbers. But it sounds like you're suggesting I use a space delimiter... can you give me an example of how this would work?

  16. I am trying to create a macro that takes a string of digits (1-9) input by the user and outputs it as a list in a grammatically correct format (using an Oxford comma if applicable).

     

    For example, the user inputs "12345" and the output is is "1, 2, 3, 4, and 5"

    "45" => "4 and 5"

    "7" => "7"

    "389" => "3, 8, and 9"

     

    Let's assume that the user only inputs a digit a maximum of one time (ie: no "1123") and would only enter the digits in numerical order (ie: "123", not "321")

     

    This is a macro I've wanted to make for a long time and I'm trying to determine what the best approach for creating it would be. Any thoughts/ideas would be appreciated.

  17. 2 hours ago, terrypin said:

    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.

     

     

    I'm glad I'm not the only one who has experienced a slow down with regards to mouse operations in W10. Unfortunately I can't access this forum at work and have no good/acceptable way of sending a sample macro to myself. But as you pointed out, the coordinate method sounds like a better solution and I am going to test that out!

  18. 2 hours ago, acantor said:

    For the pixel search, consider whether it's feasible to decrease the number of pixels your script checks. For example, instead of testing every pixel, test every 50 or 100 pixels.

    If the pixel checking routine tests the colour beneath the mouse pointer, make the script run more quickly by rewriting the script to check pixels based on their X-Y coordinates. Something like this:

     

    
    Variable Set Integer %x% to 100 // Initial x coordinate relative to the window
    Variable Set Integer %y% to 100 // Initial y coordinate relative to the window
    Repeat Start (Repeat 1000 times)
      Get Pixel Color at (%x%, %y%) Relative to Current Window into %Colour%
      Variable Modify Integer %x%: Increment // Increment the x value to check the next pixel to the right
    End Repeat

    If it's feasible to check one in every 100 pixels along the horizontal line, substitute this line for the one that increments:

     

    
      Variable Modify Integer: %x% = %x% + 100 // Skip the next 100 pixels	
    	

     

     

    Thanks Alan! I am going to try implementing this method and see how it works out. It seems like it would be much more efficient and reliable... I'm embarrassed for not having thought of it and instead relying on mouse moves 🤣

  19. 3 hours ago, Cory said:

    I don't think I'll be much help, but I had one thought. What is the performance like of that macro on a real Windows 10 machine of the same version (E.G. 1903 (current))? This will help you determine if it's a VM/real issue.

    Another thought. Run it as an admin. I doubt it will make any difference, but it's quick to try. 

     

    2 hours ago, Cory said:

    Ensure the color depth didn't change. 

     

    I wish I could test this, but I don't have a W10 machine. Not only that, but there are so many work-related security barriers that there's no good way for me to get my macros off my work pc to post here short of transcribing them by hand. I can't even access this forum 😪. Checked the color depth but they are the same on both VMs. I can't run MEP as admin. Thanks for the input.

  20. I am using MEP 4.6.2.1 on my two virtual machines at work. They both share the same macro files. One of them was recently updated to Windows 10 (The other is a Windows 7 machine) and I am finding MEP to be extremely slow for some functions. The Script Editor is pretty much unusable and stops responding just as soon as it is opened. Another issue I am struggling with is with a macro that moves the mouse a few pixels at a time to find the right color. The macro uses a loop to move up, down, left, and right hundred of times or until it finds the right spot. This works just fine in Windows 7, but in Windows 10, there is tremendous lag. I've tried increasing the playback speed of the macro to no avail. 

     

    Is it just something with the version compatibility with the OS, or something else that I should be looking at?

  21. 1 hour ago, rberq said:

    This might work:

    Step 1: Replace all CR/LF with "!@#$%^&" or some other such visible (or non-printable) string that will never occur naturally. 

    Step 2: Instead of replacing "-A" with a blank, replace "-A!@#$%^&" with a blank.  In this way, only [what used to be] CR/LF attached to unwanted text will be eliminated, along with the unwanted text.

    Step 3: Replace all remaining "!@#$%^&" with CR/LF. 

     

    Thanks for the input. I agree that this would work... however, due to the fact that I am getting my data from a shared/synced OneNote document, I wouldn't be able to add the nonsense string as would be called for using this method.

  22. 5 hours ago, Cory said:

    When you do the replace, include a newline set. A newline in Window is two non-printing characters carriage return and line feed. 0x0d and 0x0a. That's what gives you the line break. Click here for my instruction on how to create them in MEP. You will want to add them to the end of the string you want to replace.

     

    Thanks for the info. I am trying this method but I am sure that I am misunderstanding something. I declared the variable as you suggested:

    Variable Set to ASCII Char 9 to %Tab%
    Variable Set to ASCII Char 10 to %LF%
    Variable Set to ASCII Char 13 to %CR%

     

    I am not getting the desired outcome. Where do you put the %LF% and %CR% variable within the Modify String command? I tried putting it in 'text to replace' ("-A%LF%%CR%") but then it ends up trying to replace %LF%%CR% as a string value.

×
×
  • Create New...