Jump to content
Macro Express Forums

All Activity

This stream auto-updates     

  1. Last week
  2. Editing the contents of a string

    Interesting, thanks. I installed it and customised the path to the EXE. But on running the macro I get both the initial window and the Result. FWIW that didn't happen the very first time I ran it, when I did have an opportunity to edit the WinForm. Probably trivial but don't have opportunity to resolve it right now.
  3. Yes, I often use the Direct Editor. BTW, it seemed mandatory when I was using the Run Macro in Variable command some months ago.
  4. Editing the contents of a string

    Here's a little present for you. It's a simple WinForm that is designed to be a multi-line editor that works with MEP. When you launch the program you can start typing straight away. Then when you're done, click Clip & Close button or, if your'e keyboard-centric like me, tab t hen enter. MEP can be set to wait for the program to close and grab the clipboard contents. There's a demo macro too. Just change the first line to be the path of the executable on your system. I.E. wherever you saved it. I was too lazy to get the relative path in the macro. I had a subroutine for that once, but I've lost it. TextBoxEditor.zip
  5. See my post earlier in this thread. I should have highlighted the phrase Direct Editor so it would stand out. The approach worked for me, but I haven't used it extensively.
  6. Has anyone tried to edit macros in the Direct Editor instead of the Script Editor? I haven't had the need to do this yet but it seems like one approach that may work. A Ctrl+R brings up a Find and Replace dialog in the Direct Editor. If you need more powerful editing tools you could open a macro in the Direct Editor, copy it to the clipboard, paste into a text editor, make changes, and then copy from the text editor and paste it back into the direct editor. This is not a substitute for a global Find/Replace.
  7. Sorry I'm late to contribute. Like acantor, despite my apprehension about screwing it up I usually forge ahead and write Find/Replace macros for macros. Typically this is after a major file restructuring. With the sort of care that has been suggested, it can be a big time saver IMO. (And, anyway, it's usually a challenge I find hard to resist.) In rare cases I've been able to use a hex editor on all my macros in one operation, which is very satisfying. But those were limited to replacing one string with another of exactly the same length. Too much to hope that this applies to your old and new database names? One extremely handy tool I sometimes use is based closely on a macro Cory developed years ago called Search and report on macro text. It only Finds specified strings, not replace them, but its output in my text editor lists all in convenient form. I've even occasionally written temporary macros that then operate on that list, opening the target macro and then making the required replacement. But I loudly echo Cory's desire for a built-in, global Find/Replace! Terry, East Grinstead, UK
  8. Editing the contents of a string

    I too think Notepad is the best approach, given that the editing you anticipate might require manual intervention. I've no doubt Cory's probably right that using Controls would improve performance but intuitivenes usually trumps that for me! ( That's also why I haven't pursued the more compex alternative of using Run Macro in Variable .) Here's my hasty demo: // This example assumes text is on clipboard. Variable Set String %tExample% from the clipboard contents Activate or Launch: Window "Notepad", Program "notepad.exe", Parameters "" Clipboard Paste Text Box Display: Edit if necessary // Macro will also save a temporary copy of the edited text. Text Type (Simulate Keystrokes): <ALT>f // File Delay: 0.1 seconds Text Type (Simulate Keystrokes): a // Save As... Delay: 0.1 seconds Text Type (Simulate Keystrokes): C:\users\terry\TEMP-UAMike // Save As > specific temporary file Delay: 0.1 seconds Text Type (Simulate Keystrokes): <ALT>s // Save Delay: 0.1 seconds Text Type (Simulate Keystrokes): y // Say YES if asked to overwrite an existing file of this name. (No adverse effect if this is redundant.) Delay: 0.1 seconds Text Type (Simulate Keystrokes): <ALT>fx // Close Notepad. Delay: 0.1 seconds Variable Set String %tExampleEdited% from the clipboard contents // Continuing with rest of macro. Text Box Display: Edited version // Continuing with rest of macro. <COMMENT Value="This example assumes text is on clipboard."/> <VARIABLE SET STRING Option="\x02" Destination="%tExample%" NoEmbeddedVars="FALSE"/> <ACTIVATE OR LAUNCH Title="Notepad" Exact_Match="FALSE" Wildcards="FALSE" Path="C:\\Windows\\notepad.exe" Mode="\x00" Default_Path="TRUE" Wait="1" Wait_For_Program="12"/> <CLIPBOARD PASTE/> <TEXT BOX DISPLAY Title="Edit if necessary" 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 If necessary, edit the text now pasted into Notepad.\r\n\\par \r\n\\par Apart from Notepad's own tools, other documents, web pages, copy/pasting, coffee, etc is at your diisposal during this.\r\n\\par \r\n\\par \\cf1 Then\\cf0 close this to continue.\r\n\\par \r\n\\par (Macro will copy the text to clipboard as its next step and also save it as a temporary file.)\\f1 \r\n\\par }\r\n" Left="709" Top="578" Width="463" Height="235" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <COMMENT Value="Macro will also save a temporary copy of the edited text."/> <TEXT TYPE Action="0" Text="<ALT>f" _COMMENT="File"/> <DELAY Flags="\x01" Time="0.1"/> <TEXT TYPE Action="0" Text="a" _COMMENT="Save As..."/> <DELAY Flags="\x01" Time="0.1"/> <COMMENT/> <TEXT TYPE Action="0" Text="C:\\users\\terry\\TEMP-UAMike" _COMMENT="Save As > specific temporary file"/> <DELAY Flags="\x01" Time="0.1"/> <COMMENT/> <TEXT TYPE Action="0" Text="<ALT>s" _COMMENT="Save"/> <DELAY Flags="\x01" Time="0.1"/> <TEXT TYPE Action="0" Text="y" _COMMENT="Say YES if asked to overwrite an existing file of this name. (No adverse effect if this is redundant.)"/> <DELAY Flags="\x01" Time="0.1"/> <TEXT TYPE Action="0" Text="<ALT>fx" _COMMENT="Close Notepad."/> <DELAY Flags="\x01" Time="0.1"/> <VARIABLE SET STRING Option="\x02" Destination="%tExampleEdited%" NoEmbeddedVars="FALSE"/> <COMMENT Value="Continuing with rest of macro."/> <TEXT BOX DISPLAY Title="Edited version" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 Here is the edited text, \\b\\f1 tExampleEdited\\b0\\f0 :\r\n\\par \r\n\\par \\f1 %tExampleEdited%\r\n\\par \r\n\\par }\r\n" Left="503" Top="485" Width="1095" Height="536" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <COMMENT Value="Continuing with rest of macro."/> Terry, East Grinstead, UK UAMikeInSituEditing.mex
  9. Editing the contents of a string

    I use Variable Modify String commands a lot to revise texts. For example: Text Type (Simulate Keystrokes): <CONTROL>a // Select all Clipboard Copy Variable Set String %Clip% from the clipboard contents Variable Modify String %Clip%: Strip CR/LF // Delete all new lines Variable Modify String: Replace " " in %Clip% with " " // Replace double spaces for single spaces Variable Modify String %Clip%: Lowercase // Lowercase everything Variable Modify String: Replace "color" in %Clip% with "colour" // Change the spelling of words that contain "color" and "labor" Variable Modify String: Replace "labor" in %Clip% with "labour" Text Type (Simulate Keystrokes): %Clip% // Replace the selection with the revised text
  10. Editing the contents of a string

    It's hard to say without knowing specifically what edits are required -- but Variable Modify String commands can accomplish a lot, so that would be my first choice. Without some examples, I don't know why you feel it won't work. As a second choice, paste the data into Notepad as you propose, but have your macro run as many of the edit commands as possible, rather than do them manually. That's a lot faster than you can type, and a lot less drudgery, as long as the same rote commands can be used every time. If there's some THINKING involved for special situations, handle those situations manually after the macro has done its work.
  11. Editing the contents of a string

    I've used Variable Set String like this in the past but this is too much. I think Notepad is your best bet. I wouldn't paste however. I'd use Windows Controls commands.
  12. 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?
  13. Hello Kevin -- Thank you for your explanations. I thought it odd and uncharacteristic of your website form not to work. 31-hour outage for an entire city ... nice handiwork. Must have been quite a party (or bottle). My issue was solved with your response list #1 and #3. Thanks! I am a longtime MEX user, so was a bit panicky for the past 48-hours. Feel better now. Think I'll go have a drink. (Just kidding). Karl
  14. These are the things that drove me bonkers. I decided to write simple programs that send HTTP requests and receive HTTP Responses. IE no web browser. Most forms use the POST method for forms so all I do is copy the POST data and modify it myself. In most browsers hit F12 and you can see the requests and responses. Right after you click you will likely see a POST request. Look at the POST (form) data. Usually it's something like this: "name=Fed&email=Fred@SlateRockAndGravel.com&message=Yabba%20Dabba%20Dooo". This returns the source HTML of the resulting web page. And super fast. Typically 3 per second. Then I get what i need from there. One can navigate many pages and never actually render a page in a browser. If anyone is interested i could create a helper app for MEP to do this method. Or if they would like to learn to do it my way.
  15. Although the code is (mostly) unintelligible to me, I did have a few concerns that might account for the inability to interact with the screen elements via keyboard: Interaction via keyboard is improved by relying on "onfocus" instead of "onclick" events. A modal dialog is a secondary window that opens in front of the main window. For example, when you close a word processing document without having saved it, the program pops up a window asking you if you want to save the document. You must interact with the dialog box before you return to main window. In Windows, standard dialog boxes are keyboard accessible by default. In web apps, dialog boxes can be keyboard accessible, but it's up to the developer to ensure keyboard interactivity. There are no accesskey attributes in the code sample. Developers can provide mechanisms for interacting via keyboard by incorporating access keys. In the above example, a user would be able to go to the home page by pressing Alt + h (in Internet Explorer and Chrome) or Shift + Alt + h (in Firefox). In Chrome, the access key is either Alt + h or Shift+ Alt + h, depending on the circumstances.
  16. 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
  17. Can you navigate to these "buttons" by tabbing to them? Is it clear the buttons have focus? If it's clear these non-responsive buttons have keyboard input focus, and if pressing Enter or spacebar have no effect, you may be dealing with a scripted control that does not obey standard interaction rules. If you post a sample of the source code for the control (which you can expose in Chrome by pressing Ctrl + U), there may be hints on ways to activate the control via keyboard (and therefore via keystrokes sent via Macro Express). Or it may be obvious the developers have broken keyboard interaction! If the developers have designed the page for mouse-only interaction, I would encourage you to write them and report a bug -- and an area of non conformance with WCAG 2.0, the de facto international standard for web content accessibility. https://www.w3.org/TR/UNDERSTANDING-WCAG20/keyboard-operation-keyboard-operable.html
  18. 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?
  19. As you observed, when Macro Express is unable locate the macro file it should display a dialog allowing you to load the correct file. Our developers say that it is likely caused because of the "File access denied" message. This is different than "File not found". Make sure that you have full access to the folder where the macro file you are trying to load is located. Also, since your macro file is on a network drive it is possible that the file is accessible when Macro Express starts. When a macro file is stored on a network drive it is possible that Windows will try to start Macro Express before the drive mapping is established. If this is the case use the "Wait for " option found in Options, Preferences, Startup to tell Macro Express to wait a while before trying to load the macro file. Here are some other suggestions if that does not help: 1. Restore the macro file in the previous location. Launch Macro Express and click File, Open Macro file to load the macro file from the new location. 2. Make sure Macro Express is not running. In the folder where Macro Express is installed click on the MacDef.exe program. This will reset the preferences including the path to the macro file to load. After resetting the preferences start Macro Express and then click File, Open Macro file to load the macro file from the new location. 3. Uninstall and reinstall Macro Express. Then click File, Open Macro file to load the macro file from the new location. Note: It is not a good idea to move the macro file without loading the file in the new location first.
  20. Due to a drunk driver, the power was out in the city where our data center is housed for 31 hours over the weekend. The Support Request form is back up and running. Don't drink and drive!
  21. I have learned a lot of your posts over the years, so I am glad to be able to reciprocate! The technique is not 100% reliable, but considering the range of macro scripting techniques that involve interacting with the user interface, it's pretty good. Inserting short delays may make the technique less apt to fail when web traffic, downloads, and low resources slow down a system.
  22. Thanks for the tip. I just found that will work for me on a web page that changes frequently. It's also considerably faster than the technique I have been using.
  23. Just downloaded 3.11 and when attempting to run it after installation I receive two errors (see attached screen shots). The errors are: 1. File not found. 2. Could not save file / access denied Both errors cycle in a loop, which I am unable to break. It's necessary to use task manager to close MacroExpress. I had previously moved macex.mex version (3.10) to another drive on my (inside the router) network. When version 3.10 couldn't find the file, a window popped up allowing me to point to the macex file on the net, and then everything was fine. I don't receive that pop-up with 3.11. Also, I am unable to file a support request through https://www.macros.com/supportrequest.htm When I attempt to send the form the send to https://www.isssvr.net/cgi-bin/ttcgi.exe times out. This happens on both Firefox and Edge. So something appears to be amiss with the request form. Thanks for your assistance.
  24. Earlier
  25. 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.
  1. Load more activity