Jump to content
Macro Express Forums

Cory

Members
  • Posts

    4,207
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by Cory

  1. So I take it your problem is that you can't Wait for Control because you don't know which is next? And you can't "Wait for Window" because the window title is different in each? As is often the case I don't have enough details to give you a perfect solution but I'll take a stab at it. First off if any part of the Window is common like "Error:1", "Error:2", and "Error:3" you can use Wait for Window using a partial match but if the windows are "Tom", "Dick", and "Harry" then you're SOL with Wait for Window. I suggest using Wait for Window Lose Focus using your program's window title. So Wait for Window Lose Focus for "My Application". Then set a text variable to the topmost window. Then ME can do whatever you want with your control like a mouse click based on logic from the new window title. If T1 = "Tom" click on C1 If T1 = "Dick" click on C2 If T1 = "Harry" click on C3 Else give me an error message Will that work for you?
  2. I've had a lot of frustration with using ME in web browsers and on rule I've made for myself is that you can use mouse move and clicks. One user will have a different toolbar, the website author decides to add a graphic or advertisement that's now 50 pixels taller... It's a moving target. Since there are no controls in web windows I had to invent several little tricks. One is to tab thru the window. Many times the field you want is 6 tabs in. However this has problems sometimes with variable pages like you described. In this case I would do some combination of tabs with clipboard copies to string vars where ME would have some logic to find my mark. Sounds difficult but it isn't too bad. Just think "How do I know which one is correct?" Another method is to use the find utility. Have ME text type CTRL+F and pull up the find dialog box. Then have it type in "My button" and it will jump the browser to the text "My button" just to the left of the button you want to press. Then you hit the Tab once and enter to 'click' your button. Like I said, there are several ways to approach this but without knowing things like whether the button you want to press has text and if it's always the same I can't advise you more. But if you can find a programmatic way to do it with your keyboard use that as your method of attack in ME. Works for me! And if you want to kick down more info I could give you more suggestions.
  3. While I wait for ME to get some killer error handling I would like to understand something. If ME email thing finds a bad email address or has some sort of trouble it will generate an error message. It would be nice to know which in thousands of email addresses was bunk so it got me to wondering... When the error pops up does the macro stop execution until the user clicks OK or does it keep plowing ahead? If it stops I could make a dialog box that would display once for each email with the line number, email address or something for the operator to record and deal with later. And of course any other suggestion would be appreciated.
  4. Well thank you, that's high praise considering the source. But beleive me I get way more out of the forum than I put in! Thank you all!
  5. It's a rare day I get to contribute somethign new to the group instead of asking questions or sharing what many know so it's a happy day! Macro Express has the capability of sending emails with multiple attachments but out of the box one needs to assign one string variable per attachment. To me this seemed inelegant as I hate setting aside large blocks of variables in order to accommodate an unknown number of attachments. After doing some experimentation I found that one can combine multiple attachments in one string variable by simply separating them with a semicolon. Using this method one can have any number of attachments without using up large blocks of string variables! Anyway I thought some of you might find this useful so I thought I would pass it along.
  6. I have a write up that will help you on my website. Check out this page on Hex editors and this page on CRLF and TAB. In cases like these I create a text var that represents CRLF and use it in the Replace Substring part of the Variable Modify String command. Works slick. Also you should know that if you are using lists from Excel or other Office apps the format used on the clipboard is a tab seperated file which once can easily manipulate in ME.
  7. This is a common problem. Wait for Window works great assuming there is no lag. What you want is a Wait for Window Ready but it doesn't exist and I'm sure the boys at Insight have technical reasons why this can't be done or they would have done it by now. In the beginning I put a Pause in after the Wait for Window. But this is not an elegant solution. Adobe Acrobat, which I use a lot, when doing large batches will load the File Save As dialog box instantly 90% of the time. But once in a while, probably due to network congestion, it hangs for a good second or more. But if I put in a 2 second delay every time my macro will take hours to complete. What to do? My solution has been to use the Wait for Control instead of Wait for Window in these cases. Often I am using the “OK” or “Save” button in the macro so it’s already defined. What I have found is that the program will not activate most of the buttons until it is ready so it makes complete sense to Wait for Control to Become Enabled. After all, that’s what you really want, isn’t it? How are things in Denmark? It was Denmark, wasn't it?
  8. OK, now try my link. In the beginning I had a more lengthy way of generating the padded number then I thougth of a quick and dirty means that worked a lot better. Enjoy!
  9. Hopld on a sec. That was my old one and I did it a stupid way. Give me a few minutes and I'll post a better one.
  10. Sorry, I was in Tucson for a few days. This page documents my file increment macro subroutine.
  11. It's actually very simple. Once on the clipboard move it to a string variable. Then find the position of the tab by setting an integer variable to it's location. Then you decrement it once and use the Variable Modify command of Copy Part of Text using 1 as the start and your integer variable as the end. Then increment the integer variable once and Delete Part of Text 1 thru your integer var. Now do it over again. You can put this in a repeat that will repeat until your string variable equals "" which means empty. If you have multiple rows you need to account for the CRLF at the end of each row. There are various ways of doing this or course and it depends on your workflow which way to do it. EG you might break away at each line to do something with those variables and part of another repeat. Check out my subroutine on CRLF and TAB. I run this at the beginning of each macro so that I have a string var representing CRLF and TAB that I can use, in this case in the Get Position of Text described above. http://bluepointdesign.com/macros/CRLF&TAB.htm
  12. On the first question there is a crude workaround. When the command runs direct the output to a text file instead of screen. Then process that file to get your results. I can't wait for #2....
  13. And your question is..... Assuming if you are asking if this can be done it can. I have a subroutine that takes a file name and path and check to see if it's unique. If it isn't it adds a number on the end until the file name is unique. Pretty simple.
  14. Yes and no. First off any program that will interact with an application has the potential for problems but if you are using mouse moves and such you will have a lot of timing issues to weed out. After you fix the timing issues macros can be very reliable. BTW if you are dealing with Excel or any office apps there’s a trick. Instead of moving around in the spreadsheet either export it to a delimited file and use the ACSII File Process command or copy large ranges into a variable via clipboard to process. When you copy tabular data is in a tab separated value format and is easily manipulated in ME. If you do this the macros are extremely reliable because it eliminates all the timing and interface issues.
  15. It can be done but usually there are built in import export capabilities that could do a better job. However I often need to tweak things just a bit in cases like these so I will often use ME and the export/import capabilities of the program to save me writing a ton of code in ME. BTW, ME works very will for processing delimited ASCII text files which are usually the default export format. For instance I will often get data CSV from OCR or other sources but need to rearrange and make comparisons for import. In one case I have a macro that plows thru a couple of CSV files and make comparisons and decisions and in some cases even prompting the user to make decisions. The results are pushed to a tab separated file which is then easy to port into Excel for another app.
  16. I don't have an answer for you but I'm curious about somethign you said. In all my IE automation routines I have never seen a control in and HTML web page. Of course after a while I gave up but what you said piqued my interest. Where did you find controls in a web site? Can you give an example? However I will say that I have been able to do everythgn I've ever needed to by using finds, series of tabs and such to navigate web pages.
  17. An equivelant to GOTO is an oft requested feature but ME doesn't have one. However I think most of use who use ME for a while gigure out that using repeats is a better way in any case and lends better structure to the code.
  18. Use the Text File Begin Process and read them in line by line ot a variable then use the Variable Modify String to copy part of the variable to other variables.
  19. I suggest you not plow thru the Excel file as described. I do this A LOT and it always breeds problems. Here’s the trick: Highlight the region in Excel and copy it to your clipboard. When you do so it is now in a tab separated values format! You can simply plow thru it parsing out variables until you get to the CRLF and then move on. No need to figure out how many there are. And all the manipulations can be done in memory without interacting with a program. Even your output can be accumulated in a variable for later use. I have several macros that work in this way and although it takes a bit at first to get your head around it I think you will find it’s way easier and more flexible.
  20. Current version is 3.6 and you should upgrade although I don't think it makes a difference. Get Pixel Color is under the System category.
  21. Sure, keep track of the number of lines. On first run I would count the total number of lines and record that in the registry using Write Registry Integer. But start at 1 instead of zero. Then each time the macro runs do a Read Registry Integer, increment and start at that point. Then each subsequent time it runs increment that counter and write it back to the registry. You might also consider adding a file size and/or creation date check to ensure a new log file hasn’t been created.
  22. I'm so sorry, I keep forgetting. No problem with the English lessons! BTW= "By The Way" We use a lot of these on message boards. "If" versus "If Not": Somewhere along in your message and reading your code I was a little confused and I was thinking you may have intended to use "If Window Not Running" instead of "If Window Running". IOW (In Other Words) is the condition you wish that is is not running or that it is. Try what I tried with the Notepad window to see if you get a similar result. Also when in the editor open up the dialog box for shoosing the window and make sure there are no more windows with the string "error" in the title. I have an idea. Is the windows title exactly "error" and nothing else or is there more text? You "If Window" allows for a partial match. You probably intended this but I thought I would point it out just in case.
  23. Sure, use the Date/Time to have the macro get the current date and do some comparisons when the macro fires. Now ME can't natively do date comparisons so either you need ot do some clever parsing or buy the PG Macros functions library.
  24. BTW, onedoes not need to clear variables at the beginning of a macro.
  25. I figured out how to download your file. Just need to rename the index.html. This works fine for me. I created a notepad doc named error.txt so that I had a window with a title ‘error’. With it open the “If” worked and if not the section was skipped. You mention “If Not” in your post but this statement is an “If’ not an “If Not”. Are you sure you got this straight?
×
×
  • Create New...