Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,532
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. Try something like this... Text Box Display: Start Variable Set String %T1% to "" Wait for Window Title: %T1% Text Box Display: End
  2. 8. In some (but not all) web-based apps, the URL changes to reflect where you are. For example, for a webmail program, you might see URLs like these: Inbox folder: https:// xxxxxxxxx?id=123&page=1&inbox Sent messages: https:// xxxxxxxxx?id=123&page=1&sent Junk folder: https:// xxxxxxxxx?id=123&page=1&junk So rather than script a macro that clicks on the Inbox link, achieve the same thing by typing the URL in the address bar: Text Type: <ALT>d // Move to the address field of the browser Text Type: https://www.xxxxxxxxx?id=123&page=1&inbox Text Type: <ENTER>
  3. Macro-powered workarounds for navigating poorly-coded web pages are often possible; but it takes effort to figure them out. Here are some methods I have used: 1. Check the code to see if the developers included accesskey attributes. For example, view the HTML for this site: http://directory.utoronto.ca/phonebook/pages/admin/main.xhtml ...and you will discover "1" and "2" are access keys for two fields. To navigate to the "Last Name" field in IE, press Alt + 1, or in Firefox, press Shift + Alt + 1. 2. Through trial and error experimentation, see if there are areas of the screen that, when clicked on, reliably move keyboard focus to a nearby screen object. In other words, click at (x, y), and then press Tab to move to certain fields. These "neutral areas" can sometimes be found in the margins of a page, e.g., pixel (1,1) as measured from the top left corner of the viewport. These actions can be translated into MEP scripts. 3. See if you can navigate to the target field by pressing Tab (or Shift + Tab) enough times. Something like this might work: Repeat 44 Type <Tab> ...or maybe Repeat 44 times Type <Tab> Wait 20 milliseconds (a delay may help with reliablity) 4. Press F6 (or Shift + F6) to move from frame to frame. 5. Combinations of the above... for example... Move mouse relative to the text cursor position (which in some browsers, is the upper left corner of the viewport). Move mouse (1, 1) relative to the last position (to get to a "neutral area") Mouse Click Type <F6><F6> (to move to the third frame) Type <Tab> 40 times (to reach the desired field)
  4. I can see no fault in the logic of your script. My guess is that there is an error of some kind, but it's subtle. So try recreating the macro entirely from scratch, using a different name, different variable names, etc.
  5. It's not easy to debug remotely, but the first things I would check are: Is there a problem with the IF statement? Is the Macro Run statement doing anything? Consider displaying a message box after the IF statement to confirm it is being evaluated as expected. I seem to recall that the "contains" option is case sensitive. "Hello there" contains "Hello" but not "hello".
  6. When you say the macro stops, what is happening? Does the macro complete? Get stuck at a step? Could you give us a code sample?
  7. Maybe something like this? Variable Set String %T1% to "Macro" Variable Set String %T2% to topmost window title If Variable %T2% Contains "%T1%" Text Box Display: YES Else Text Box Display: NO End If
  8. A simpler approach may be to search for text near the link or field you are trying to get to. Then tab or shift+tab to your target. Maybe something like this (in pseudo code) Text Type "<CONTROL>f" ' initiate search Text Type "Personal Info" ' search for this text Text Type "<ESC>" ' cancel the search Repeat 10 Times ' navigate to the 10th screen object Text Type "<TAB>" Repeat End
  9. <F2> does the same thing as <ALTD>f<ALTU>m ...and is less likely to misfire. Do you also want to lowercase the file extension? Because if you do, you may need to do something like this... Text Type <F2> ' select the name TextType <SHIFT><END> ' extend selection to include the extension Clipboard Copy ' the selected name Set String %T1% from clipboard Variable Modify String: Lowercase %T1% Text Type %T1% ' type over the selected name Text Type <ENTER> If you want the macro to be ready to do the same thing to the next file, add this line: Text Type <DOWN>
  10. I think rberq's solution, or something like it, is what you are going to have to do. I don't know of a way to edit a message box (or other ME-generated window) on-the-fly.
  11. It takes time, effort, and creativity to get the technique to work reliably. Choosing an appropriate search string is as much art as science. I aim to discover the shortest sequence of keystrokes for the greatest number of situations. Usually a compromise must be struck. Although ME cannot directly search for web controls, there are workarounds. Searching for links instead of other content can help get close. Then Tab (or Shift + Tab) one or more times to navigate to the control. Hunting for pixel colours can be made to work, as well. If a page is marked up with frames, you can use F6 or Shift + F6 to get you the desired frame. Another method is to click on a particular spot on the screen, and then send a series of Tabs, Shift + Tabs, F6, etc. I have a number of macros that use all of the techniques listed above. In some cases, it takes hundreds or thousands of iterations to zero in on a target in a web app: e.g., a repeat loop that check every pixel along a path the width or height of a window. Interestingly, there is little or no speed penalty for a macro going through so many steps; it's math, and computers excel at math. Most of my complex scripts execute in a fraction of a second. However, these complex tasks are much easier to implement in Macro Express Pro because of the possibility of assigning meaningful variable names: %PixelColour% instead of %N[22]%
  12. It can be done; I've written many macros that use browser find commands to activate links. (It works best of all in Firefox, but Chrome is not bad.) Basic technique: Type CONTROL+f [to initiate fiind] Type your search term [whatever it is you are searching for] Type ESC [to cancel out of the find] If you are searching for a link, it should now have focus. Type ENTER to activate it. If you are searching for text to bring you close to a control, Type TAB or SHIFT+TAB to take you to your target. To find the next instance of the search term, Type CONTROL+g To find the previous instance, Type SHIFT+CONTROL+g
  13. Good idea! Alternative ways to trigger scripts, and more comprehensive ways to specify scope, are two of the reasons I am drawn to the Pro version.
  14. Thank you for continuing to support Macro Express 3! I'm looking forward to testing the new vesion.
  15. <SHIFT><F10> is supposed to invoke the context menu for the focused object. For Macro Express scripts, this usually works; but occasionally, only the Application key does the trick. Custom built programs are a different matter. Simulated right-clicks may be the only way to do what you want to do!
  16. I tried it and replicate the same problem in several applications. The upper limit for Firefox appears to be 7. In Word 2007, it's about 10.
  17. I know how to set the width of window border... Windows Sizing Border: 3 pixels ... But I cannot find a way to assign the value to an integer variable. Any ideas?
  18. When I am testing pixel colours and want to include a time-out, I try to choose a value that makes some logical sense. For example, if I am checking horizontally one pixel at a time, I use the window width. If I am checking horizontally every ten pixels, I use the window width divided by ten. Set Variable %x% = 0 ' Start checking pixels at (0, %y%) Set Variable %y% = 100 ' Constant distance as measured from top of the window Set Variable %WindowWidth% = width of window Repeat %WindowWidth% times Set Variable %PixelColour% at %x%, %y% If %PixelColour% = 123456 Then Exit Repeat Else Increment %x% End if Repeat End I start by including delays, but once the macro is working, I try to get rid of them. There are circumstances when a short delay (5 ms? 100 ms?) at each iteration is essential.
  19. Hi rberq, Curious. Try changing the display theme from whatever it is (probably one of the "Aero" themes) to "Classic..." Control Panel\All Control Panel Items\Personalization ...and test whether you can detect pixels in the scroll bars.
  20. Variable Set Integer %DesktopWidth%: Set to the Desktop Width Variable Set Integer %DesktopHeight%: Set to the Desktop Height Variable Modify Integer: %DesktopHalfHeight% = %DesktopHeight% / 2 Text Box Display: Ready to move mouse pointer to left side of screen Mouse Move: 0, %DesktopHalfHeight% Relative to Current Window Text Box Display: Ready to move mouse pointer to right side of screen Mouse Move: %DesktopWidth%, %DesktopHalfHeight% Relative to Current Window <VARIABLE SET INTEGER Option="\x1D" Destination="%DesktopWidth%"/> <VARIABLE SET INTEGER Option="\x1E" Destination="%DesktopHeight%"/> <VARIABLE MODIFY INTEGER Option="\x03" Destination="%DesktopHalfHeight%" Value1="%DesktopHeight%" Value2="2"/> <TEXT BOX DISPLAY Title="Ready to move mouse pointer to left side of screen" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang4105{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 0, %DesktopHalfHeight%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <MOUSE MOVE Option="\x02" X="0" Y="%DesktopHalfHeight%" _PROMPT="0x000A"/> <TEXT BOX DISPLAY Title="Ready to move mouse pointer to right side of screen" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang4105{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 %DesktopWidth%, %DesktopHalfHeight%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <MOUSE MOVE Option="\x02" X="%DesktopWidth%" Y="%DesktopHalfHeight%" _PROMPT="0x000A"/> Try running this test macro. It moves the mouse cursor to the left edge of the screen (x = 0); and then to the right edge of the screen (x = ScreenWidth) The macro uses y = half the screen height. In other words, from (0, y) to (ScreenWidth, y)
×
×
  • Create New...