Jump to content
Macro Express Forums

UAMike

Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by UAMike

  1. I use macros to remove lines of text from a larger block of text. I am using the Variable Modify String command to replace unwanted text with a blank. The problem of course is that I then end up with blank lines when I wanted was to remove the text and carriage return. Here is an example: The list contains: -A -B -C -D -E End of list. What I will end up with after using Variable Modify String is something like this: The list contains: -B -C -E End of list. What I wanted was it to be formatted like this: The list contains: -B -C -E End of list. How can I accomplish this? I tried using Trim CR/LF, but then I am removing all the carriage returns.
  2. I will try. I also tried using F3 to search and that may have led to some marginal improvement in the search behavior.
  3. I believe the Wait for Web Page only works in IE, whereas I am using Chrome. In any case, it's not always the first thing that I search for on a page that the macro gets tripped up on... sometimes it's the 2nd, 3rd, etc, by which time the page has definitely loaded completely.
  4. I've tried slowing down the macro and still get the same results, only slower lol. Unfortunately I don't have the option to use Firefox (this is my work machine and they only want us using Chrome). It's always frustrating when something used to work just fine and all of the sudden doesn't 😤 I will try using Ctrl+F instead of Ctrl+f. Will also try F3 and report back.
  5. I have been incorporating the Ctrl+F function in a Chrome browser to allow my macros to interact with various parts of a page (or series of pages). A given macro will TextType Ctrl+F to search for a specific phrase that I know will only appear once on a given page. In Chrome, the text found gets highlighted in orange, then when you hit esc, it will turn blue. I use the blue highlighted text to tab to a specific text box, to click buttons, to gather information that then gets stored into variables, etc. This has worked perfectly until very recently. Now, after a string is found and highlighted orange, it doesn't always highlight blue when I hit esc. Sometimes it will, sometimes it won't. As a temporary fix, I have the macro perform the same search twice... and on the second attempt the text will undoubtedly highlight orange, then blue when I hit esc. I thought perhaps there was a window focus issue or a timing issue, but that hasn't led me anywhere. I can't even reproduce this behavior if I manually search for something in my browser. Any ideas? What other steps can I take to debug this issue? Since I rely on the Ctrl+F function so much, it really slows down my workflow to have the macro repeat the search a second time.
  6. My apologies! It was around this time in November that I was dealing with various family issues. It is only this week that I have returned back to work and so I actually forgot that I posed this question to begin with. I do sincerely appreciate the effort that you put forth in helping members of this community. Terry, your script is very similar to what I ended up doing with Notepad. Corey, this app looks great! I will give it a try tomorrow
  7. I've started to incorporate the ASCII functions more frequently when building my macros. I'm wondering whether it is possible to utilize this (or related) function to work with larger blocks of formatted text. For example, my work periodically sends out excel spreadsheets with standardized texts that they expect us to copy and paste from. What I have always done is pre-program macros with variable set string to contain the corresponding text that I otherwise would have had to copy and paste from the spreadsheet. I am wondering if there is a way for me to have my macros reference a corresponding cell in the spreadsheet and copy the contents of the cell to either the clipboard or a string variable. This way, I would save myself time whenever a new version of the spreadsheet becomes available (which usually have simple changes like paragraph formatting, grammar, etc).
  8. I am trying to figure out a way to modify a long string variable (a paragraph or two of text) while the macro is running and then use the updated variable downstream in the macro. I want to be able to delete phrases, words, adjust spacing, etc, so any of the 'Variable Modify String' functions will not do the trick. I think I can get this done by having the macro paste the string into a notepad document, then I would do my manual edits, then copy the text to the clipboard and set the variable to the clipboard contents. Ideally I wouldn't have to fiddle around with this clipboard/notepad method, but I am not sure if there is an easier/better way. Any suggestions?
  9. Sort of... What it is is a "box" (looks like two columns in a spreadsheet) with several phrases from which you can pick one or more options. When you click on one of these phrases, it has a downstream effect on what else gets displayed on the page. I'm not sure if that constitutes a button, but is certainly an element of the page that I can interact with as opposed to a plain string of text. From what I can tell, the box itself can have focus, but not the individual phrases within the box. Here is a short sample of the source code, which is about 90% foreign to me. id='sidebar-region-one' class='screen-layout-region screen-layout-region-main screen-layout-region-main-sidebar1 screen-layout-region-resize' aria-label='Left Panel' role='complementary'><div class='screen-layout-region-content'><div class='sectionDivStyle' id='RULE_KEY' node_type='MAIN_RULE' node_name='PrismPortalNav' data-node-id='PrismPortalNav' version='1' objclass='Rule-HTML-Section' pyclassname='Data-Portal' readonly='false' NAME='BASE_REF' BASE_REF='' expandRL='' uniqueID='SID1510616504615' ><span class='inspector-span' ><div class='layout layout-noheader layout-noheader-section_divider'><div section_index='1' class='layout-body clearfix' ><div class='sectionDivStyle' id='RULE_KEY' node_type='MAIN_RULE' node_name='PrismActionItemLinks' data-node-id='PrismActionItemLinks' version='1' objclass='Rule-HTML-Section' pyclassname='Data-Portal' readonly='false' NAME='BASE_REF' BASE_REF='' expandRL='' uniqueID='SID1510616504616' ><div class='layout layout-outline layout-outline' id='EXPAND-OUTERFRAME' PARAM_NAME="EXPANDEDSubSectionPrismActionItemLinksB"><div class='collapsible Expanded ' id='EXPAND-PLUSMINUS' name='' aria-live='polite' ><div class='header header-bar clearfix' tabindex=0 role='heading' aria-expanded='true' aria-label='Hide Action' id='RULE_KEY' node_type='HEADER' onkeydown='expandHeader(this,event,null,true);' onclick="setUserStart(id);expandHeader(this,event);"><div class='header-left' title='Hide Action'><i class='icon icon-openclose'></i></div><div class='header-content'><h2 class='header-title' aria-level='2' id=''>Action</h2><nobr></nobr><span class='header-element header-title-table'><table cellspacing='0' cellpadding='0'><tr><td nowrap='nowrap' class='tdRightStyle'><table cellpadding='0' cellspacing='0' align='right'><tr><span style="display:none;"> <input type=hidden id=SpellChecker value= "Spell Checker" /> <input type=hidden id=More value= "More" /> <input type=hidden id=Edit value= "Edit" /> <input type=hidden id=Revert value="Revert " /> <input type=hidden id=RevertTo value= "Revert to" /> <input type=hidden id=IgnoreAll value= "Ignore all" /> <input type=hidden id=AddToDictionary value= "Add to Dictionary" /> <input type=hidden id=ChangeAll value= "Change All" /> <input type=hidden id=SpellChecking value= "Spell Checking" /> <input type=hidden id=NoSpellChecker value= "No SpellChecker Available" /> <input type=hidden id=NoSuggestions value= "No Suggestions" /> </span> <script language="javascript"> var haveActionChoices = false; function initActionChoices () { gStrSpellChecker = document.getElementById("SpellChecker").value; gStrMore = document.getElementById("More").value; gStrEdit = document.getElementById("Edit").value; gStrRevert = document.getElementById("Revert").value; gStrRevertTo = document.getElementById("RevertTo").value; gStrIgnoreAll = document.getElementById("IgnoreAll").value; gStrAddToDictionary = document.getElementById("AddToDictionary").value; gStrChangeAll = document.getElementById("ChangeAll").value; gStrSpellChecking = document.getElementById("SpellChecking").value; gStrNoSpellChecker = document.getElementById("NoSpellChecker").value; gStrNoSuggestions = document.getElementById("NoSuggestions").value; } var gStrSpellChecker = null; var gStrMore = null; var gStrEdit = null; var gStrRevert = null; var gStrRevertTo = null; var gStrIgnoreAll = null; var gStrAddToDictionary = null; var gStrChangeAll = null; var gStrSpellChecking = null; var gStrNoSpellChecker = null; var gStrNoSuggestions = null; </script> <td id='HeaderButtonIconsTDId'><script>try {var gHeaderButtonHTML=document.getElementById("HEADER_BUTTON_HTML");if(!pega.u.d.bModalDialogOpen){document.getElementById('HeaderButtonIconsTDId').innerHTML = gHeaderButtonHTML.innerHTML;}} catch(e) {}</script></td><td><input type="hidden" id="HeaderButtonSectionIndicator" value="SubSectionPrismActionItemLinksB" /></td></tr></table></td></tr></table></span></div><div class='header-right'></div></div></div><div section_index='1' id='EXPAND-INNERDIV' class='layout-body clearfix' ><div bSimpleLayout='true' class='content layout-content-simple_list content-simple_list ' ><div style='' class='content-item content-field item-1 ' STRING_TYPE='field' RESERVE_SPACE='false'><div class='content-inner '><div class='field-item dataValueWrite'><script type="text/javascript">/**/</script><div id='div-menu-1510616504617' style='display:none;'></div><script
  10. Indeed Chrome does work in the same fashion as Firefox and your notes proved to be very helpful for navigating a web page. Following your instructions will allow me to search for a button and then press on it using the Enter or Space key. There are a few instances where I haven't gotten this to work... if there is an element on the screen that is clickable, but not really a button per se, then pressing Enter or Space will not do the trick. I cannot figure this one out. Am I missing something really obvious?
  11. I'm trying to revisit some of the ideas from this post so that I can make my macros run with greater reliability. This post mentions "searching for text on the screen" followed by a way to get to that text using tabs or pixel colors. I like this idea, but I cannot figure out how to implement it. My macros primarily run in Chrome and I could perform a search for specific text using Ctrl+F, but how would I then get to that word? The only method I can think of is to have the mouse move a few pixels at a time until it finds the right color, but I can see this being a pain because of 1) false positives and 2) potentially having to look all over the screen for the right color. To address the former problem, I imagine that there's some extension available to change the highlighted text from orange/yellow (default in chrome) to a more unique color. Any advice is appreciated.
  12. Thank you for the feedback. I was recently reminiscing about playing games on my old Tandy 2000 and how you would have to calibrate the joystick every time you use it. I used this idea to set specific anchor points from which my mouse will move relative to that point. My thought is that when the elements deviate slightly from where they used to be, I will just have a script (haven't go that this part yet) to quickly change the coordinates of 4-5 anchor points. I would have liked to incorporate more tabbing into my macros, but it was not working as I had hoped and this new solution seems fine for the moment. I appreciate all the input.
  13. I use MEP to automate tasks at work. One of the primary apps that my macros run in is a Java program in IE. For some reason, whoever is in charge of maintaining this application periodically makes slight, seemingly useless modifications to the layout of the program and as a result, all of my macros that require a click will be off by a few pixels. Sometimes this makes no difference, but other times it's the difference between clicking on a button or not clicking on a button. Needless to say, it is infuriating because it renders most of macros useless. I've tried to use the 'Get Control' function, but the utility is not able to recognize any buttons in the application that I am using. In addition, sometimes I am not wanting to click on a button at all. Is there anything that you might suggest I think about when addressing this problem?
  14. This method worked perfectly! It took me a while to get the hang of using it and truth be told, I am not even that well versed in using arrays either, but I was amazed at how a few lines of code combined with a tab delimited document made this whole thing really easy. I was also worried about the ASCII file process taking too long to and slowing down the macro, but that wasn't an issue either. Thanks Cory and others for valuable suggestions. I can see myself using this method for other applications as well.
  15. I am trying to build some logic into my macro that would select a string of text, copy it to the clipboard, and then run a specific macro based on what is stored in the clipboard (or a variable that was set to the clipboard content). So far, I have created a bunch of code like this: If Clipboard contains "brown" Variable Set String %macroname% to "brown" End If Macro Run: %macroname% This definitely works, but as I have a few thousand macros that could potentially be run, I am hesitant to continue doing it this way. Any ideas on an alternate approach to accomplish the same thing?
  16. One thing that I think is weird is that the background application predictably takes focus or brings itself to the front. For example, when a certain box pops up to prompt the user to enter a value, I will input the value and press enter, but the background window will predictably bring itself to the front, forcing me to alt+tab and the press enter on the pop up box in order to continue the macro process. While I initially thought that this issue was caused by the background Java app randomly (random to me anyway) wanting focus, now I am thinking that there is something else at the root of the issue... still not sure what that would be, but I feel as though it is fixable somehow.
  17. I read through these posts and am not sure if it helps with my situation... my work recently switched from using a stand-alone application to a similar one that runs as a Java application in IE. I hate it. My macros require a lot of text box displays and user prompts to enter variable values, and even though I have the "always on top" and "keep focus" focus checked, it's like the Java app DEMANDS attention and retakes focus. I should note that the prompt does stay on top, it's just that it loses focus. Very annoying... any ideas on how to change this behavior?
  18. I am trying to use a multiple choice menu where multiple answers can be selected. I would then like to use these answers to output a phrase that has correct grammar. For example, if the multiple choice options are A, B, C, X, Y, Z... the output could be something like: "The answer is A, B, and C" "The answer is Z" "The answer is B, X, Y, and Z" I can't seem to wrap my head around this problem. Any guidance is much appreciated.
  19. Wow. I had a vague idea of how I was going to extract the string values, but the parts where you tweaked the values to align with the default value would have completely escaped me. Many thanks, Cory!
  20. I am copying for example a date of 01/01/2016. The dates I will be using will not vary from this MM/DD/YYYY format.
  21. I am encountering difficulty using my clipboard contents to set a date value. It will not allow me to do this because my clipboard value is recognized as text.
  22. I do not have much experience using dates with MEP. I was a bit confused when looking over the documentation today. I am trying to create a macro that alerts me if a certain date is within the last 90 days. To accomplish this, I need to highlight some text inside a program (ex: 12/01/2015) and compare it to today's date. I'm not exactly sure what combination of date function(s), variables, clipboard functions I need to get this to work. Any advice? Thanks in advance.
×
×
  • Create New...