Jump to content
Macro Express Forums

acantor

Members
  • Content count

    625
  • 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

155 profile views
  1. 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%
  2. 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.
  3. Shortcuts extremely slow

    Could you show us the script that is executing slowly?
  4. Been there, done that! I think this is a mistake all macro scripters have made. A "repair macro" to update all of your scripts is certainly doable. I use dozens of Macro Express macros that run only in Macro Express, so there is nothing to prevent you from trying to automate the task. But be aware that you may reach the point of diminishing returns if the time it takes to automate the process takes longer than manually fixing the scripts. But if it were me, I would try! I totally agree with rberq: don't try to do everything in one go. Start modestly, maybe 10 or 20 scripts at a time; and if you discover your repair macro is working reliably, then up the number of repetitions. You can increase the reliability a bit by pressing Esc to close the Replace dialog instead of clicking on the Close icon. Adding delays between steps, even 100 or 200 ms, might help. Longer delays will likely be helpful when windows and/or dialog boxes are opening and closing, maybe 300 ms or 500 ms. This might be the perfect moment to rewrite your script in ways that would simplify the task of updating the scripts in the future!
  5. Macro Express Pro v 4.8.0.1

    I have been using the latest version since the day of its release. Maybe it's my imagination, but MEP feels more stable. Macro Express Pro does not crash often, but it happens occasionally. I think some freezes and crashes have to do with delays, and especially timed delays, e.g., Delay: 100 milliseconds Delay: 100 milliseconds, without ability to halt Since installing the upgrade two weeks ago, I have not experienced a single MEP crash. Thank you!
  6. Integer seconds to yyyymmdd-hhmmss ?

    I don't have a ready made solution, but when dealing with these kinds of scripting projects, I have found the "Date/Time" dialog tremendously and surprisingly useful. For example, I managed to make a script that calculates the date six months from now and outputs it. But if the future date is a Friday, the script changes the date to the previous Thursday. If the date happens to be a Saturday, Sunday or Monday, the script changes the date to the next Tuesday. My script looks something like this. Hope it inspires a simple solution. // Extract the day of the week, six months from today Date/Time: Set %DayofWeek% to an adjusted date/time using "dddd" as the format // Text Variable // Adjust target date (I don't book appointments on Mondays or Fridays) Delay: 100 milliseconds // A delay is needed somewhere… Not sure why. Switch( %DayofWeek% ) Case: Friday // Friday --> Previous Thursday Variable Set Integer %NumberofDays% to -1 End Case Case: Monday // Monday --> Next Tuesday Variable Set Integer %NumberofDays% to 1 End Case Case: Saturday Variable Set Integer %NumberofDays% to 3 End Case Case: Sunday Variable Set Integer %NumberofDays% to 2 End Case Default Case Variable Set Integer %NumberofDays% to 0 End Case End Switch // Insert new date Date/Time: Type out an adjusted date/time using "dd-MMM-YYYY" as the format
  7. I figured it out... and only three lines of code for the folder names, and three more lines for the file names. <REPEAT WITH FOLDER Path="C:\\Users\\Alan\\Documents\\Test" OnlyFiles="FALSE" Destination="%x%" FullPath="FALSE" ProcSubfolders="FALSE"/> <TEXT TYPE Action="0" Text="%x%<ENTER>"/> <END REPEAT/> Repeat with Folder C:\Users\Alan\Documents\Test Text Type (Simulate Keystrokes): %x%<ENTER> End Repeat Another example of the versatility of Macro Express Pro!
  8. I want to generate a file that contains the names of every folder and every file in a particular folder. I am trying to avoid a clunky solution like this: Repeat the number of objects in the folder Press F2 // Rename the item, which causes the object to be selected Clipboard Copy Press Esc // Escape from rename Switch to an open file Clipboard Paste Switch to the list of folders and files Press Down Arrow // Navigate to the next item Repeat End I should be able to do this from the command line using this: dir > list.txt But I do not have administrative rights to access the folder from the command prompt. Looking forward to seeing your cool MEP ideas!
  9. Announcement: Macro Express v 3.11a

    Although I prefer Macro Express Pro, I have recommended Macro Express Version 3 to a lot of people over the years, and most of them continue to use it.
  10. Larger Region To Look For Color

    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"/>
  11. Larger Region To Look For Color

    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.
  12. 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?
  13. This may be the easiest way to undo: Text Type (Simulate Keystrokes): <CONTROL>z
  14. Sluggish Mouse Move?

    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.
  15. Sluggish Mouse Move?

    If moving the mouse cursor is unavoidable, try testing every other pixel; or every five, ten or even 100 pixels.
×