acantor

Members
  • Content count

    616
  • Joined

  • Last visited

  • Days Won

    2

acantor last won the day on May 28 2016

acantor had the most liked content!

Community Reputation

3 Neutral

About acantor

  • Rank
    Expert

Contact Methods

  • ICQ
    0

Recent Profile Visitors

113 profile views
  1. If you don't understand what it means to call one macro from another, don't worry. Suffice to say it is a technique for recycling Macro Express scripts. For now, focus your energies on perfecting a script that searches a line of, say, 400 pixels, maybe something like this... Variable Set Integer %x% to 100 // Initial x coordinate Variable Set Integer %y% to 300 // Initial y coordinate Variable Set String %TargetColour% to "255" // Target pixel colour 255 = RED of the words "Macro Stop" in the MEP "Script Editor" Repeat Start (Repeat 400 times) Delay: 10 milliseconds // Slow down the macro so you can see what's happening Mouse Move: %x%, %y% Relative to Screen Get Pixel Color from Beneath the Mouse into %PixelColour% If Variable %PixelColour% Equals "%TargetColour%" Text Box Display: Pixel found! Macro Stop End If Variable Modify Integer %x%: Increment // Increase the value of x by 1 End Repeat Text Box Display: Pixel NOT found! ====== <VARIABLE SET INTEGER Option="\x00" Destination="%x%" Value="100" _COMMENT="Initial x coordinate"/> <VARIABLE SET INTEGER Option="\x00" Destination="%y%" Value="300" _COMMENT="Initial y coordinate"/> <VARIABLE SET STRING Option="\x00" Destination="%TargetColour%" Value="255" NoEmbeddedVars="FALSE" _COMMENT="Target pixel colour 255 = RED of the words \"Macro Stop\" in the MEP \"Script Editor\""/> <COMMENT/> <REPEAT START Start="1" Step="1" Count="400" Save="FALSE"/> <DELAY Flags="\x02" Time="10" _COMMENT="Slow down the macro so you can see what's happening"/> <MOUSE MOVE Option="\x01" X="%x%" Y="%y%" _PROMPT="0x000A"/> <GET PIXEL COLOR Option="\x00" Rel_To_Screen="TRUE" Destination="%PixelColour%"/> <IF VARIABLE Variable="%PixelColour%" Condition="\x00" Value="%TargetColour%" IgnoreCase="FALSE"/> <TEXT BOX DISPLAY Title="Pixel found!" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang4105{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <MACRO STOP/> <END IF/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%x%" _COMMENT="Increase the value of x by 1"/> <END REPEAT/> <TEXT BOX DISPLAY Title="Pixel NOT found!" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang4105{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
  2. I have written many scripts to search for a particular pixel colour within a region. There are several ways to approach the problem. Here are five methods I have tried: 1. Examine a single coordinate at regular intervals. 2. Check a vertical or horizontal line. 3. Check a rectangular region, one line at a time. 4. Check the entire screen or a specific window, one line at a time. 5. Check each pixel in a spiral pattern from a single coordinate. My experience is that only [1] and [2] execute quickly enough to be practical. [3] works fine if the rectangle isn't too large. [4] can take too long to execute: a 1366 x 768 screen would require 1,049,088 pixel colour tests! [5] is elegant and works nicely, but only if you have a rough idea of where to start the search. I have never found a practical application for [5], at least not yet. A series or combination of these methods is possible. I have, for example, searched a vertical line until I have found a pixel, and then hunted horizontally for a second pixel colour. I have done this for applications that have large rectangles consisting of only a few colours, e.g., a web app that has two or three frames. My most sophisticated macro of this ilk does four searches one after another: along a vertical line, then horizontal, then vertical and then horizontal again. During the last search, the macro counts the number of times a certain colour is found. It was challenging to make this macro work reliably. When I need to search large regions for a pixel colour, I sometimes opt for other scripting tools. Search rectangle for a pixel colour would be a dynamite feature to add to a future release of Macro Express! At one point I submitted a feature request to the good folks at Insight... I would encourage others to do the same.
  3. If you delete something while in the application, what happens if you immediately press Ctrl + z? Does "Undo delete" appear as a command in a menu or on a ribbon? If yes, which menu/ribbon?
  4. This may be the easiest way to undo: Text Type (Simulate Keystrokes): <CONTROL>z
  5. Hi Terry, Do you have a choice of operating systems? You may be able to workaround the problem by reverting back to Windows 7. Because of the kinds of problems you are encountering, I have assiduously avoided Windows 8 and 10. Using an older operating system is a temporary solution, as Microsoft will, in time, discontinue support for Windows 7. But for now it is supported, and in Windows 7, pixel colour checks run acceptably fast.
  6. If moving the mouse cursor is unavoidable, try testing every other pixel; or every five, ten or even 100 pixels.
  7. I wonder whether Windows 10 is making this worse. Moving the mouse cursor can be slow. To test, for example, 1000 pixels, you need to do two steps: move the cursor; and test the pixel under it. So that's 2000 steps to perform 1000 tests. Because computers are fast at performing mathematics, I try, as much as is practical, to avoid the step of moving the cursor, at least until the target pixel colour has been located: Repeat Start (Repeat %xLength% times) Get Pixel Color at (%xCurrent%, %yCurrent%) Relative to Current Window into %PixelColour% If Variable %PixelColour% Does not Equal "%PixelTarget%" // Increment x so we test next pixel to the right... Variable Modify Integer %xCurrent%: Increment Else // Pixel found... now it's OK to move the mouse cursor.... Mouse Move: %xCurrent%, %yCurrent% Relative to Current Window Text Box Display: Found! Macro Stop End If End Repeat
  8. Maybe this? If Variable %x% Contains "BQ" Or this? Text Type (Simulate Keystrokes): <CONTROL>c // Copy text to clipboard... If Clipboard Contains "BQ"
  9. If you sink enough time and effort into the problem, you may come up with a solution that almost always works. But you gotta love experimenting and tweaking, or you will likely find the experience a miserable drudge! I use a combination of techniques, including: - Clicking on a "neutral" part of the screen that resets the tab order. Then send tabs/shift tabs to the control. - Searching for a pixel colour on a control, or to something near the target, and then tabbing and/or clicking. - Searching for text on the screen. Then give the word or phrase focus, and then tab to the target. - Searching for text on the screen and then selecting it. Then search for the pixel colour of the selection,and click. Some of my Macro Express scripts perform thousands of actions to zero in on a target on a web app, and are almost 100% reliable. But they were labours of love. I was willing to put in the time to get them to work. And some of them are a bit brittle.
  10. Congratulations on getting so far! There are many ways to make the script more reliable and robust. For the next iteration, consider substituting "Window Activate" commands for Alt + Tab commands. Alt + Tabs work reliably when only two windows are open. But if you more than two open windows, you may end up in the wrong one. "Window Activate" is more likely to bring up the windows you actually want to act on
  11. You are probably on the right track by using program launch and window activate commands. 1. For now, forget about looping through multiple files. Simplify. Get it to work for one file. 2. Insert long pauses after each command. 1 or 1.5 seconds should be plenty. Commands that bring up windows and programs take time to work. Once you get the macro to work. use trial and error experimentation to figure out how short delays can be. Sometimes delays can be omitted. Sometimes they need to be longer than you might imagine. 3. Once you get the script functional, use it as often as possible for a day or two or three to ensure it's reliable. Then, make a copy of the macro, and start adding the code to loop through multiple files, which will add another layer of complexity.
  12. When inserting the Window Activate command, click the "Browse" and select the specific CintaNotes windows you want to activate. Then set the "window title" drop down to "Exact Match." Save the macro and test. If it works, edit the command to work more generally. For example, if the window title is "CintaNotes - Document001" but you want it to work for Document 001, 002, 003, etc., delete "001" and then change the drop down to "Partial Match."
  13. I run Macro Express remotely through a VPN. Macro Express is installed on both machines. If I am interacting with the remote desktop, the remote version of ME is running and I can use it from my local machine. If I am interacting with my local desktop, the local version of ME is recognized. Sometimes there are timing issues when running ME remotely. A script that works reliably may need additional "time shims" when accessed remotely due to internet bottlenecks.
  14. Hi Terry, I wonder if something got corrupted in your installation. Make sure your macro file or files have been backed up. Uninstall Macro Express Pro, reinstall it, and reload your macro files.
  15. The setting in Options > View has been a permanent solution. I checked Options > Preferences and found no settings for the sidebar. Odd that the Sidebar setting doesn't stick for you. Hope you sort it out!