Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,532
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. Instead of a delay, you might want to substiute a "wait for window title" command (Save As) for up to, say 3 seconds.
  2. I have never reported it as a bug, but it happens to me occasionally. Certain combinations of commands seem to be the trigger, something like this: Move Mouse Pointer to 100, 100 Repeat Start 10 times If Mouse Pointer = arrow Exit Repeat Else Delay 200 ms End if Repeat End
  3. You are experiencing the pain of scripting pixel-sniffing macros for Firefox. The User Interface changes from version to version. Short of discovering (or developing!) an add-on that provides more reliable feedback on page loading status, you may need to switch strategies. Perhaps the text that reports loading progress in the lower left corner of the screen? Waiting... Read...
  4. The "Use Clipboard and Paste Text" command places the specified text on the clipboard, and pastes it. You can still use the command, even if you want to preserve the clipboard, although there are limits! The following works if the clipboard contains unformatted text. If you have formatted text on the clipboard, the formatting will be lost, e.g., italics, underline etc. This code definitely doesn't work if you have an image in the clipboard. // Preserve the clipboard Variable Set String %Clip% from the clipboard contents // Output the domain name via the clipboard Text Type (Use Clipboard and Paste Text): %tDomain% // Empty and restore the clipboard Clipboard Empty Clipboard Start Copy Text Type (Simulate Keystrokes): %Clip% Clipboard End Copy
  5. Have you experimented with tabbing to the first field rather than clicking in it? That is often a more reliable approach. Sometimes I have done a combination of the two: click in the upper-left corner of the active window (to give it focus), and then tab to the first field.
  6. Try changing the activation to a key that doesn't use the Alt key. Menus are activated by pressing Alt + the underlined letter. The problem may relate to a timing issue caused by your fingers pressing and releasing the Alt key.
  7. There is a learning curve to getting the hang of macro scripting, but one of the good things about Macro Express is that it eases the process because you do not have to type the commands. The task you want to do would be more complex in, say, AutoHotkey. I cannot think of a reason why Alt Tab isn't working for you. It may be true that you cannot capture the keystroke (which if true I would say is a bug), but using the Scripting Editor to type <ALT><TAB> is straightforward. (And if it doesn't work, there may be an explanation. For example, make sure there is no space between <ALT> and <TAB>. <ALT><TAB> is not the same as <ALT> <TAB>.
  8. If I understand correctly, you have two macros activated by the same hotkey. The scope of one is global (let's call it A), and of the other is window or program specific (let's call it B, and assume its scope is window C). When window C is focused and you press the hotkey, do you want A to activate? If yes, then I would say everything is working as it should. To my way of thinking, a window or program specific macro should take precedent over a global macro.
  9. My macros that include <ALT><TAB> to switch between windows work.
  10. The wait for web page to load only works with IE, and even there, is not 100% reliable. Sometimes, a delay of a second (or two or three) must be added afterwards. (A guess: the command works as advertised with HTML pages, but not when JavaScript has been added to the mix.) You always have the option to use other browsers. However, you will have to create your own code to wait for pages to load. The easiest way is to add a delay. How long a delay? With the vagaries of the internet, it's impossible to know for sure. A 15 or 20 second delay will likely be enough to cover most circumstances, but would be total overkill on occasions when pages load in less than a second. There have been discussions on this forum about macros that monitor pixel colour changes to infer when a web page is completely loaded. I have used this technique with Firefox, and it is fairly reliable provided l don't mess with the appearance of the browser, e.g., adding toolbars, history panes, etc.; or change Window settings related to resolution, size and colours of UI components (menus, window borders, etc.). These macros may need to be updated when a new version of the browser is installed, as the appearance of the UI may have slightly changed.
  11. Selecting text via mouse actions is iffy when automating via macros. It is inherently unreliable. Perhaps this is the reason, or one of the reasons, your script isn't working. Try performing the selection process by keyboard. For example, in most word processors and text editors, this sequence of keystrokes selects the current paragraph. (This sequence may not work if the current paragraph consists only of a carriage return, but I find it reliable for paragraphs that consist of one or more printed characters.) <END> // Go to end of current line <CONTROL><UP ARROW> // Go to start of paragraph <SHIFT><CONTROL><DOWN ARROW> // Select to end of paragraph It's more reliable to select text in MS-Word than in any other program that I know. For example, this sequence selects the current word: <F8><F8> This selects the entire sentence: <F8><F8><F8> This selects the entire paragraph: <F8><F8><F8><F8>
  12. The only way I can think of that OK is greyed out is if you have NOT selected a window or program. As soon as you select an item on the list, the OK button is enabled.
  13. There is no "one-size-fits-all." I think it's a matter of how an individual uses ShortKeys. There are some contexts in which I prefer suffixes, but in the end, prefixes work best for me. I use the comma as my prefix. Words never begin with a comma, so it avoids conflicts. Therefore: ,d types 20 July 2012 (today's date) ,ac types Alan Cantor (my name) ,wwww types www.cantoraccess.com (my website) ,helene types Hélène ,min minimizes the window ### makes no sense to me as a prefix. Too many characters and too awkward to type.
  14. I have written many Macro Express scripts that do this, so I can offer a few caveats. 1. The approach is not 100% reliable, but can be reliable enough. 2. The method never works on images of text. However, it can be made to work by searching for nearby text, and then either tabbing or back tabbing to the target., something like this: <Ctrl><f> // Search on this page Sign in<Enter> // Text to search for <Esc> // Cancel search <Tab><Tab><Tab> // Navigate to Log off button <Enter> // Activate Log off button 3. You will have to settle on one browser. IE, Firefox, Chrome, Opera, etc. use slightly different strategies for selecting and activating links in this way. For example, in Firefox, there is a command that searches for links only. Your program settings, plug ins, add ins, etc. can radically alter how you search and select. 4. It is usually best to start searching at the top of a page. However, I know of no 100% reliable way to do this if you have already interacted with a page. I tend to click somewhere close to the left edge boundry (where there are no clickable objects), and then type <home> to move focus to the top of the page. Then Ctrl f.
  15. I haven't used it. But I have seen this behaviour in other programs that have child windows that Macro Express cannot detect. I have solved the problem in different ways: Give focus to the child window before sending Ctrl+F4. You may be able to do a mouse click. In some cases, give focus to the parent window, and then send keystrokes to move focus to the child window. Experiment with F6, Ctrl+F6, Tab, and Ctrl+Tab, with and without adding a Shift. Does MEP's "Capture Window Control" utility detect the window you want to close? If so, you may be able to give focus to the window and then sending Ctrl+F4; or act on the control to close it rather than the window. Find an alternative keystroke to close the window. Is there a menu command, perhaps something like "File" > "Close Window?" If so, you can use <ALT>fc Does the window you want to close have its own system menu? Normally the system menu is activated by pressing <ALT><SPACE>. <ALT>- (hyphen) sometimes works for child windows. In that case, you may be able to close the window by sending: <ALT>-c (Alt hyphen, C for close)
  16. It sometimes takes time for a variable to receive data from the clipboard. Add a delay after the clipboard copy. Add a delay after this line. Variable Set String %T[90]% from the clipboard contents // Test for Value When debugging macros, long delays are your friends. Add delays liberally; you can always remove them later.
  17. It sounds like you are using Macro Express, not Macro Express Pro! There is no Macro Express Pro 3.7...
  18. Maybe this script will give you an idea of how to do it. This script is activated when Firefox closes. It displays a message, and after you click OK, the macro causes Word to open. Make sure to examine the "Activations" tab! That's where you will find what is causing the macro to fire when Firefox closes. Test macro.mex
  19. If you are looking for a way to activate a macro when a window closes or a process ends, you will find these options in the Script Editor under the "Activations" tab rather than under the "Script" tab. You can cause a macro to run when a window opens, closes, gains focus, etc. Caveat: Some people have reported reliabilty or latency problems with macros triggered by window events. Activation when a window gains focus does seem to work well.
  20. You could use nested if-else statements, but these get complicated fast... If %X% contains "aaa" // Do this Else If %X% contains "bbb" // Do that Else If %X% contains "ccc" // Do something else End if End if End if // Do this always Not sure whether or not you need to use the Macro Return. I don't think I have ever used it. Experiment with and without it. But I have found that including a Macro Stop statement in a called macro halts the calling macro, so be careful!
  21. What do you want to happen when the program closes?
  22. If this is a process that you need to repeat many times, and speed is an issue, a better way is to to copy the contents of the clipboard to a variable, and perform the manipulations there rather than on the clipboard. Although doing the calculations in "variablespace" requires another step or two, macros run faster that way.
  23. The problem is probably in the "Window Activate" line. The line itself, under normal conditions, should be sufficient. Double check that the words "C:\Uty\Software\MacroExpressPro" appear in the title bar of the window you want to bring to the fore. Make sure you are using "Partial Match" or "Exact Match" appropriately. Avoid the wildcard option for now, as it complicates matters. Simplify for debugging purposes. Similarly, set the scope to "Global" for now. If it's set to Window or Program specific, it's harder to separate coding from scoping issues. Instead of using Window Activate, you might also try Program Activate. If all else fails, delete the macro and start from scratch. After monkeying around with a ME script over and over again, starting afresh can bring a new perspective.
  24. 1. Test whether Macro Express is seeing the hotkey by checking whether the "running man" icon appears when you run the macro. 2. How are you triggering the hotkey that sends the Pause key? If it's a hotkey that involves one or more modifier key (Shift, Ctrl, Alt, or Win-logo), it's possible that you are inadvertently sending the modifier key + Pause. For example, if the macro is activated by pressing Ctrl + Q, then you are not sending Pause; you are sending Ctrl + Pause. Solution: chose a hotkey without a modifer, e.g., F12, Insert, Esc, etc. 3. Check whether Pause is assigned as a Macro Express hotkey. If it is, you have a conflict, and you should change the ME hotkey.
  25. acantor

    OR

    OR is always part of a conditional statement, e.g., IF - ELSE. I am not sure this is the best explanation, but I hope this gives you a sense of how it works... IF X IS TRUE OR If Y is TRUE RESULT - "Either X is true or Y is true" ELSE RESULT - "Both X and Y must be false." END IF
×
×
  • Create New...