Jump to content
Macro Express Forums

acantor

Members
  • Content count

    647
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by acantor

  1. Saving to Excel in background

    A VBA macro might be the ticket. Try recording the procedure using Excel's macro recorder, and then modify the code to create a more general solution. The folks on various Excel VBA help forums might be able to provide assistance.
  2. This approach solved a dropped character problem when I was creating ME macros for an Java application: In the Control Panel, go to Keyboard Properties, and reduce the repeat rate. Setting the value to 25% or 30% was enough to prevent characters from dropping when I sent input via Text Type.
  3. Fill multiple choice menu with macro

    It sounds do-able with Macro Express, but it would be helpful if you would provide more details.
  4. Rename Folder Error

    Try adding a delay between the two rename commands. Start with three or five seconds. If that proves to be the source of the problem, then incrementally reduce the time until it fails again. Then bump up the delay slightly.
  5. If you created the macro by capturing your actions, the resulting script is likely extremely long. If it's sufficiently lengthy, the script will take time to execute. And while it's executing, you will be effectively prevented from doing anything else with your computer. There are many advantages of keyboard input over mouse input when automating repetitive tasks via macros: First, the number of keystrokes is significantly fewer than the number of mouse movements. Dozens, hundreds, or thousands of mouse movements can sometimes be replaced with one or two keypresses. For example, if you record yourself selecting an entire webpage by scrolling to the top, clicking in front of the first word, and dragging down to the end of the page, the capture can conceivably be a thousand lines long. But the same action can be accomplished by pressing a single keystroke: Ctrl + A. Second, a script consisting of keystrokes is more likely to work reliably. A recorded macro consisting of mouse actions may not work as expected if you change the zoom level in your browser or resize the window. Nor is your macro guaranteed to work if the web developers change a page's styles (e.g., typefaces, font sizes) or add or subtract content from the page. On the other hand, the hotkey for selecting an entire webpage will always work – at least, as long as a form element does not have keyboard input focus. Ultimately, if the macro is taking so long to execute that you are unable to do anything else, it's worthwhile rewriting the macro so that the task is performed via keyboard. If your computer is locked for a long time while your mouse-intensive macro is running, know that simulating the keystrokes won't prevent the macro from locking up your computer, but it will probably only do so for a fraction of a second.
  6. Could you describe in detail what are you trying to accomplish? If you are using Macro Express's capture feature, be aware that playing back a script may not give you the results you are looking for. A captured macro may not play back correctly when run in a different window. As a general macro scripting rule, I suggest avoiding mouse actions unless there are no alternatives. In browsers, there are ways to navigate, select, copy, and paste without the mouse. The ease of performing these actions sans mouse, however, depends on the browser and your browser settings. When dealing with web content, I find Firefox easier to work with than Internet Explorer or Chrome.
  7. Excel: macro fails consistently

    Hi Terry, I recently completed a project of automating aspects of Excel using a different scripting tool (i.e., not Macro Express). For the first part of the project, the client's PC was running Windows 7. For the second part, the PC was a Windows 10 machine. A handful of scripts that worked beautifully under Windows 7 failed under Windows 10. So it would appear Microsoft has thrown curveballs to those of us who use third-party scripting tools. In every case I found workarounds; but the workarounds were not always elegant. In your situation, the next thing to try is alternative ways to copy the field. For example, instead of sending Ctrl + C, try copying the text via the context menu. Or cut the email address, pause for half a second, and paste (which will allow you to see whether the clipboard operation was successful.) Or just cut it, and forget about pasting it back. Or substitute Macro Express's clipboard commands when copying and pasting instead of Ctrl + C and Ctrl + X; or vice versa. If none of these approaches are successful, I would delete the macro and re-create it from scratch. On second thought, I would do this next! And if you are still not successful, report the problem to the good people at Insight Software. This may be a Windows 10 compatibility issue.
  8. Excel: macro fails consistently

    I am using Windows 7, not 10, and Excel 2007, and not something newer. So things may be a little different on my computer. A few thoughts: 1. Try <Ctrl>k to open the hypertext link instead of opening it via the context menu. 2. I need to select the email address from the Edit Hypertext dialog box: <Ctrl>a should work, but so should <Home><Shift><End>. 3. Instead of opening the hypertext link, try editing the cell, something like this... <F2> <Home><Shift><End> <Ctrl>c 4. How about copying the cell directly, without editing it? <ARROW UP><ARROW RIGHT> // navigate to a cell <Ctrl>c
  9. I think the Windows desktop is overrated. It's visually busy, hard to keep organized, and challenging to navigate around sans mouse. At various times I have preferred instead to open the desktop as a folder in Windows Explorer: I find it easier to deal with files and folders when they are listed alphabetically, which is easy to do when viewing the desktop as a regular Windows folder:
  10. Terry, Win+M is a legacy hotkey leftover from Windows 95 or 98. Microsoft introduced Win+D (D for desktop) years ago, and I have generally found it a little more reliable than the old hotkey. The following key sequence, which has also been around since Windows 95, minimizes all windows; but in Windows 7 and beyond, I am not sure it reliably puts focus on the desktop. But it does lend itself to scripting... Ctrl + Esc ' Activate Start/Windows button Esc ' Cancel Start button, but leave it focused Alt + M ' Minimize all A related key sequence makes it possible to interact with items on the desktop without actually minimizing any windows. So interaction with desktop items is hidden behind the open windows. For example, to navigate to and activate a desktop icon called "Terry"... Ctrl + Esc ' Activate Start/Windows button Esc ' Cancel Start button, but leave it focused Shift + Tab ' Navigate to the desktop Terry <Enter> ' Incremental search to Terry, and press Enter to activate it.
  11. To expand on Bruce's excellent explanation... There is no (easy) way to move the mouse pointer to selected text. But experiment with Chrome to find out whether it supports standard Windows hotkeys for selecting text once you have zeroed in the text using the Find command, e.g.: Shift + right arrow (select one character to the right) Shift + Ctrl + right arrow (select one word to the right) Shift + Home (select to the start of the line) Shift + End (select to the end of the line) This is a partial list of hotkeys for selection within a webpage. There are others, pretty well all of which involve holding down the Shift key. With Chrome, you may need to press F7 to enable selection via keyboard. It's a toggle (it's either ON or OFF) so you may need to turn it off once you're done selecting text, e.g., F7, Shift + Ctrl + Right, F7. Overall, I find Firefox more versatile than Chrome -- and much more versatile than Internet Explorer -- when I am scripting macros that select text on a webpage.
  12. 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
  13. 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.
  14. 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
  15. 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.
  16. Reg: Assertions capability

    1. Is there a capability to search for a specific text and select or click on that particular text You can search for specific text after you copy it into a variable. Selecting text within an application can be done in some applications, but that has nothing to do with Macro Express. 2. Can i grab text from application and paste it in text file Yes, as long as you can select the text in the application. There may be ways to copy text without selecting when dealing with Window controls. 3. Can i compare text file data with application data Yes.
  17. Retrieve Sheetname from Excel

    Alexis, You might be happy to know that the accelerator keys for the English versions do not always make sense. For example, in Word, to navigate to commands related to columns, press "Alt + P" (for Page Layout), and then "J" (for Columns). "J" was a strange choice as an accelerator key, as "C" was available!! And then there are commands to insert symbols, which are accessed by pressing "Alt + N" (for Insert), followed by "U"! I did a quick Google translate, and not too many languages include the the letter "U" in their word for symbol, other than Basque (ikurra) and Corsican (simbulu)...
  18. Retrieve Sheetname from Excel

    Microsoft retains some, but not all, key sequences from the pre-ribbon releases of Office. The technique worked better in some programs than in others, with the best example being Word: the commands on the following menus could be accessed by pressing the old key sequences: "Edit," "Tools," "Format," "Table," and "Insert;" but not "Window" or "Help." Some commands from the old "File" menu were still available using the Alt + F key combination. The reason they kept these key sequences was to appease power users. At least, that's what a Microsoft employee told me when I asked at a conference we both attended. It's been more than 10 years since Microsoft got rid of the menus. Some key sequences continue to work, others not; and some work in Word, but not in Outlook. (In Office 2003 and earlier, the menus in Outlook and Word were somewhat analogous. I suppose the underlying idea was that if you knew how to format a Word document, you would be able to do the same in an Outlook email message. But the user interfaces of the two programs seem to have drifted apart.)
  19. Retrieve Sheetname from Excel

    Is it possible the ribbons behave differently in different languages?
  20. Retrieve Sheetname from Excel

    For many years I have referred to combinations like Alt + H, O, R as "key sequences," as they involve pressing a specific sequence of keys. I don't think key sequences are documented, as there are thousands, maybe tens of thousands of them. But they are not the kind of the thing that people tend to memorize. Instead, they are discovered by paying attention to the letters (or numbers) that appear after pressing the initial Alt, and then following the prompts. So the key sequences are not really hidden. I bet most people don't notice them, so in a sense they are kind of invisible. But once one knows about the letters and numbers that are exposed when you start accessing menus and ribbons via keyboard, one finds they are almost everywhere. In general, I find key sequences are easier to spot in programs that have menus rather than ribbons. With menus, you are looking for underlined letters rather than floating alpha numeric characters. For example, in Firefox, "Options" is Alt + T, O. It might be helpful to know something interesting about the initial Alt. You do NOT need to hold it down while pressing the subsequent key. So you could press, with one finger, the first key, then the second, then the third. In Firefox, "Options" is.. Alt T O Another useful trick for macro scripting is to know you can substitute F10 for the initial Alt. Alt and F10 are functionally identical: F10 T O
  21. Retrieve Sheetname from Excel

    I know of two ways to figure out key combinations: 1. Understanding the rules for interacting with Windows applications via keyboard. For example, one rule is that pressing Alt shifts keyboard input focus from the active part of the window to the Ribbon or Menu bar. Pressing Alt also exposes accelerator keys. For example, in Excel, when you press Alt, you can see that H is Home, N is Insert, etc. Pressing one of these keys will reveal the next layer of key presses available. It's way more cumbersome to navigate through Ribbons than through menus, but the underlying rule is the same. 2. The other method: Google it!
  22. Retrieve Sheetname from Excel

    Text Type (Simulate Keystrokes): <ALT>h // Activate "Home" Ribbon Text Type (Simulate Keystrokes): o // Format Text Type (Simulate Keystrokes): r // Rename Sheet Delay: 200 milliseconds Clipboard Copy Delay: 200 milliseconds Text Type (Simulate Keystrokes): <ESC> // Cancel Variable Set String %WorksheetName% from the clipboard contents Text Box Display: %WorksheetName%
  23. Shortcuts extremely slow

    1. Review all of your Macro Express scripts and see if any are triggered by Ctrl + K. You are looking for a conflict with the built in Outlook command. (I didn't know anybody else used Ctrl + K in the To and CC fields other than me! (K stands for "komplete" the address!) 2. Are you running any other macro scripting programs like AutoHotkey? 3. Try a total shutdown of Windows. Not a log off, but a shutdown.
  24. Shortcuts extremely slow

    Could you show us the script that is executing slowly?
×