Jump to content
Macro Express Forums

joe

Members
  • Posts

    1,002
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by joe

  1. Can't think of anything more natural than capturing your mouse movements and clicks as you are making them. I suppose that you could speed up and slow down the macro execution at different points in the captured macro, but I am not sure that would help much. Most people want the opposite, which is a straight-line movement from point A to point B.
  2. Chan Lee - Looks nice. Looks intense. And from a programming-task point-of-view, not for the feint-of-heart. You are correct: "a bubble sort is better than no sort at all". Congratulations! We will be running some tests on it soon. Thanks for good documentation, too!
  3. Perfect! The one in our PGM Functions Library uses Decimals %Dxx% and extra step to extract just the whole number. The { Math - Mod } function was created before Macro Express had the ability to mix Integers and Decimals in a single calculation. Speaking of fun things, the { Math - Square Root } function was done with native Macro Express code using a "divide and average" method ... it must have been a day when I had a lot of time on my hands
  4. David - I lost count of the many times the same thing has happened to us. It must be a professional problem. Meaning that our beginner's luck ran out years ago You are in good company!
  5. David - It is just a matter of using Text Type in place of the Append command and then adding the code that does your tabbing, code typing, clearing, and waiting. Here ya go! // Initialize variables Variable Set %T13% to ASCII Char of 013 Variable Set %T1% to ASCII Char of 010 Variable Modify String: Append %T1% to %T13% // Set the main string variable Variable Set String %T10% "If you are reading this from an email system other than Lotus Notes, there are Lotus Notes document links that will not work on your email system. URL links (text that starts with "http") are provided instead." Variable Modify String: Trim %T10% Variable Set Integer %N10% from Length of Variable %T10% Variable Set String %T11% "" // Process the whole string Repeat Until %N10% <= 36 // Get the next 36 characters Variable Modify String: Copy Part of %T10% to %T1% Repeat Start (Repeat 36 times) // Find first "space" (right-to-left) Variable Modify String: Copy Part of %T1% to %T2% If Variable %T2% = " " Repeat Exit End If Variable Modify String: Delete Part of %T1% Repeat End // Strip value from main string and reset the length variable Variable Modify String: Trim %T1% Replace "%T1%" with "" in %T10% Variable Modify String: Trim %T10% Variable Set Integer %N10% from Length of Variable %T10% // Type the current string Text Type: %T1% // PLACE YOUR CODE TO <TAB> AND SO FORTH HERE Repeat End // Save the remainder Variable Modify String: Trim %T10% // Type the current string Text Type: %T10% // PLACE YOUR CODE TO <TAB> AND SO FORTH HERE Macro Stop <REM2:Initialize variables><ASCIIC:13:1:013><ASCIIC:1:1:010><TMVAR2:08:13:01:000:000:><REM2:><REM2:Set the main string variable><TVAR2:10:01:If you are reading this from an email system other than Lotus Notes, there are Lotus Notes document links that will not work on your email system. URL links (text that starts with "http") are provided instead.><TMVAR2:01:10:00:000:000:><IVAR2:10:12:10><TVAR2:11:01:><REM2:><REM2:Process the whole string><REP3:08:000006:000002:0010:0:01:36><REM2:><REM2:Get the next 36 characters><TMVAR2:10:01:10:001:036:><REP3:01:000036:0000-1:00036:1:01:><REM2:><REM2:Find first "space" (right-to-left)><TMVAR2:10:02:01:N01:001:><IFVAR2:1:02:1: ><EXITREP><ENDIF><TMVAR2:11:01:00:N01:001:><ENDREP><REM2:><REM2:Strip value from main string and reset the length variable><TMVAR2:01:01:00:000:000:><TMVAR2:21:10:00:000:000:%T1%><TMVAR2:01:10:00:000:000:><IVAR2:10:12:10><REM2:><REM2:Type the current string><TEXTTYPE:%T1%><REM2:><REM2:PLACE YOUR CODE TO <TAB> AND SO FORTH HERE><REM2:><ENDREP><REM2:><REM2:Save the remainder><TMVAR2:01:10:00:000:000:><REM2:><REM2:Type the current string><TEXTTYPE:%T10%><REM2:><REM2:PLACE YOUR CODE TO <TAB> AND SO FORTH HERE><REM2:><MSTOP>
  6. Hello Dean! Using the Date/Time command, store a formatted date/time string to a variable, say T1, and then use it in the Rename File or Files command. Like this: If File Exists "capture.mpg" Date/Time: Save "yyyy.mm.dd hh.mm" into %T1% Rename File or Files: "capture.mpg" End If <IFOTH:01:2:c:\temp\capture.mpg><DT:yyyy.mm.dd hh.mmT:01:1:><DOFILE:06:NN:c:\temp\capture.mpg>c:\temp\%T1%.mpg><ENDIF>
  7. There is no way to set the size of a Macro Express 3.x MCM dialog, at least not that I am aware of. As to the second part of the question. You can set integers to the screen size and window sizes. Macro Express will also let you resize and position a window, so you have control over where it is and how big it is by doing some calculations and placing the results in the relevant fields of the commands.
  8. Hello Cyberchief! This should should handle the parsing but it does not do the text typing. Change as needed. // Initialize variables Variable Set %T13% to ASCII Char of 013 Variable Set %T1% to ASCII Char of 010 Variable Modify String: Append %T1% to %T13% // Set the main string variable Variable Set String %T10% "If you are reading this from an email system other than Lotus Notes, there are Lotus Notes document links that will not work on your email system. URL links (text that starts with "http") are provided instead." Variable Modify String: Trim %T10% Variable Set Integer %N10% from Length of Variable %T10% Variable Set String %T11% "" // Process the whole string Repeat Until %N10% <= 36 // Get the next 36 characters Variable Modify String: Copy Part of %T10% to %T1% Repeat Start (Repeat 36 times) // Find first "space" (right-to-left) Variable Modify String: Copy Part of %T1% to %T2% If Variable %T2% = " " Repeat Exit End If Variable Modify String: Delete Part of %T1% Repeat End // Strip value from main string and reset the length variable Variable Modify String: Trim %T1% Replace "%T1%" with "" in %T10% Variable Modify String: Trim %T10% Variable Set Integer %N10% from Length of Variable %T10% // Save this string Variable Modify String: Append "%T1%%T13%" to %T11% Repeat End // Save the remainder Variable Modify String: Trim %T10% Variable Modify String: Append "%T10%%T13%" to %T11% // Here it is. Variable Modify String: Save %T11% to Clipboard Macro Stop <REM2:Initialize variables><ASCIIC:13:1:013><ASCIIC:1:1:010><TMVAR2:08:13:01:000:000:><REM2:><REM2:Set the main string variable><TVAR2:10:01:If you are reading this from an email system other than Lotus Notes, there are Lotus Notes document links that will not work on your email system. URL links (text that starts with "http") are provided instead.><TMVAR2:01:10:00:000:000:><IVAR2:10:12:10><TVAR2:11:01:><REM2:><REM2:Process the whole string><REP3:08:000006:000002:0010:0:01:36><REM2:><REM2:Get the next 36 characters><TMVAR2:10:01:10:001:036:><REP3:01:000036:0000-1:00036:1:01:><REM2:><REM2:Find first "space" (right-to-left)><TMVAR2:10:02:01:N01:001:><IFVAR2:1:02:1: ><EXITREP><ENDIF><TMVAR2:11:01:00:N01:001:><ENDREP><REM2:><REM2:Strip value from main string and reset the length variable><TMVAR2:01:01:00:000:000:><TMVAR2:21:10:00:000:000:%T1%><TMVAR2:01:10:00:000:000:><IVAR2:10:12:10><REM2:><REM2:Save this string><TMVAR2:07:11:00:000:000:%T1%%T13%><ENDREP><REM2:><REM2:Save the remainder><TMVAR2:01:10:00:000:000:><TMVAR2:07:11:00:000:000:%T10%%T13%><REM2:><REM2:Here it is.><TMVAR2:16:11:00:000:000:><MSTOP>
  9. joe

    Gregorian

    Hello Dash - We've done the work for you within our PGM Functions Library. Here is a page from the manual that explains our take on handling date numbers: ----------- Overview We were asked numerous times by quite a few of our clients to create a set of reusable macro functions to handle date calculations and here they are. They will allow you to: Convert a date string to a Julian number, numeric day-of-week, character day-of-week, or numeric day-of-year. Convert today's date to a Julian number, numeric day-of-week, character day-of-week, or numeric day-of-year. Convert a Julian number to a date string, numeric day-of-week, character day-of-week, or numeric day-of-year. Calculate a new date by adding or subtracting days or months. Calculate the difference in days between two dates. Evaluate if a year number is a leap year. Return a character day-of-week from a numeric day-of-week. Return a character month from a numeric month. Parse a day number from either a date string, Julian number, or today's date. Parse a month number from either a date string, Julian number, or today's date. Parse a year number from either a date string, Julian number, or today's date. Reformat a user's date input string. Validate both date strings and Julian numbers input by users. The functions are all based on Julian Day numbers, which are not to be confused with Julian Dates, whose calendar ended on October 15th, 1582 when the Gregorian calendar replaced it. The Gregorian calendar is the reformed Julian calendar with the year fixed at 365 days except for leap years which contain 366 days. Leap years are years that are exactly divisible by 4 except for century years which must also be divisible by 400. This is the calendar in common use today. Dates in the Gregorian calendar are called Gregorian dates. Here are some dates and their equivalent Julian Day number. March 1st, 0000 as far back as these functions go 1721120 January 1st, 0001 first day of the 1st century 1721426 October 15th, 1582 first day of Gregorian calendar 2299161 November 16th, 1858 nothing special, just the Julian Day: 2400000 February 28th, 1900 last day of month, not a leap year 2415079 January 1st, 1901 first day of the 20th century 2415386 January 1st, 2001 first day of the 21st century 2451911 December 31st, 9999 as far into the future as we go 5373484 We were only able to cover a span of (almost) 10,000 years from March 1, 0000 through December 31, 9999. Any dates outside this range will return an error. All functions have been tested against results obtained from Microsoft Visual FoxPro and Microsoft Visual Basic. We tested hundreds of thousands of dates and numbers to confirm the accuracy of these functions.
  10. To use a Window Control, you must first tell Macro Express about it with either the Get Control or Capture Control command. Although they both stuff a variable of your choosing with information from a Window Control, their individual use is different. Get Control is used at design time, while Capture Control is used at runtime. Design time is when you are creating, editing, fixing, and otherwise, changing a macro. You know what the Control is and will be. Runtime is when the macro you just designed, edited, fixed, is ... well, running, but you do not know until then what, or where, the Control will be so you have to capture it on-the-fly.
  11. The Macro Run command is what you are looking for.
  12. Sure can ... it is happening within the "****** Get CPU Delay information ******" section. You've processed the "JES" and the "FROM" lines. But when the current line (in the subsequent loops) contains one of the three choices it gets processed, too.
  13. Bob - It appears that the Switch/End Switch contruct won't do you any good here. It seems that all of your saved information is coming from the "JES" and "FROM" lines. I do not understand why you would even need to parse the "WAITING FOR CPU", "ECB WAIT" and "SWAPPED WITH WTOR" lines.
  14. Bob - The Switch/End Switch construct can only be used for an exact string or number comparison. It does not allow for "contains". Also, string comparisons are case sensitive. Looking at your code, it appears that you are attempting to pull certain strings, in the order they appear, and place them in some type of structured CSV file. I can only assume that each line in the CSV file is based on the next "JES" section of the text file. Is this correct? If so, and if the "WAITING FOR CPU", "ECB WAIT" and "SWAPPED WITH WTOR" lines all come after the current "JES" line and before the next "JES" line, then you should be able to use the IF/End If construct, along with OR logic commands, to parse the data. Do you have an example of the output CSV file you are generating?
  15. Macro Express was not specifically designed to run in the background. And neither are active Windows windows. Yes, you can do certain things with windows that are minimized or hidden, but these are not true background tasks. The biggest obstacle to what you are trying to do, however, is that your computer has just a single mouse and keyboard, which Windows assumes is being used in the window that currently has focus. In an attempt to do simulated background tasks, Macro Express uses some API calls to send information to captured Window Controls. The Windows Control concept is very much dependant on how the target application is written. What works in one may not work in another. It has been my experience that Internet Explorer has very few, if any, useful Controls. That being said, there are certain things that you can try. One feature is the ability to Text Type strings into a captured Control, which you are already familiar with. By the way, I was surprised at the limited number of navigation keys that Internet Explorer accepts in whatever Controls it has. For your mouse activity you should be able to use the Mouse Click on Control command. The problem is that web pages have no Controls. You can, however, use offset coordinates to target your clicks. Look at the Advanced tab in the "Mouse Click on Control" dialog. Try to capture a known Control in Internet Explorer, determine the offset values to the coordinates you want to click, and then fill in the appropriate X and Y fields. I am not sure how sending text and mouse clicks directly to background Controls will affect whatever it is you are doing in the focused window, or vice-versa. You may see intermingled text or strange mouse activity. It is not possible to give you an exact script. It is your project and only you can create the exact script needed. You already know what your macro needs to do becuase you made a list of the steps. And the list certainly seems reasonable. Not I. I did not write Macro Express and neither do I work for them, although I can certainly understand why a person would think so. I wrote the Macro Express Explained book, published the PGM Functions Library (along with Paul Thornett, my co-conspirator), and my company sponsors this forum. This sometimes happens within forums to be sure. However, after re-reading the posts in this topic, I think everyone understood from the beginning what you were attempting. What you are attempting may or may not work. All we can do in this forum is point out the commands and concepts to try.
  16. Camarosource - One more nasty post like your last one and you are out of here. I guarantee it. The reality of any online forum is this: you think your problem is the most important one in the world. Others don't. People are doing their best to help you here. I spent a good hour of my own time trying to find a solution for you. Maybe one exists for your problem. Maybe not. But if you want help keep a civil tone in your posts.
  17. If the Control is in the background, using the Text Type command with the Send Text to Control chosen will send it as you expect. As a test, create a macro that does the following: Launch IE Goto a web page Capture the page to Control %C1% Now launch something in the forground, say Notepad Set the Notepad window so that you can see part of the web page Now Text Type <PAGE DOWN> to the %C1% Control You will see the web page scroll in the background
  18. Yes because the command assumes a partial window title. So: "request" is contained in "request E50" and also "request E504345345" "request E50" is contained in "request E504345345" but not in "request" "request E504345345" is not contained in "request E50" or "request"
  19. You can use a partial-title match like Wait For Window Title: "request E50" It will wait for any window containing the string specified.
  20. Use the Text Type command. It does whatever you would normally do. If, for example, you wanted to page down in a document, you would normally hit the PageDown key. Using Macro Express the command would be: Text Type: <PAGE DOWN>
  21. This might work under XP if you launch two instances as two different users, switching between them. You would not, however, have access to the other's memory space, so you will not be able to check variables. Instead, write the variables to a CSV file and have the other instance check them. Timing in this scenario is everything so use the Wait for File Exist and Wait for File Ready commands.
  22. Welcome to the group! Try this: Time: Save hhmmss (150423) into %T1% Repeat Until %T2% = %T1% commands ... commands ... commands ... Wait Time Delay 1 Seconds Time: Save hhmmss (150423) into %T2% Repeat End Macro Run: <Your Next Macro> Macro Stop <hhmmssF000{N}{F001}01><REP3:08:000001:000001:0002:1:01:T1><TDELAY:1><hhmmssP000{N}{P000}02><ENDREP><MACRUN2:Your Macro><MSTOP>
  23. My cohort Paul uses Clipmate. He swears by it I think. That being said, I personally don't think it's more useful than Macro Express But I have been wrong before.
×
×
  • Create New...