Jump to content
Macro Express Forums

MEnewb1143

Members
  • Posts

    23
  • Joined

  • Last visited

Posts posted by MEnewb1143

  1. Believe it or not, still working on this one. The problem I'm running in to is that things are random. There isn't a set number of charactors and the numbers are not the same every time. Here's an example of what I'm talking about.

     

    <random type>###-#######-#######<random type>

     

    The ONLY that is the same every time is that there are '3numbers'-'7numbers'-'7 numbers'.

     

    I get saving the clipboard as a variable and then getting rid of the first part and the last part and then saving that to the clipboard, but when you search for something, I need to search for more than '-'. Does any of this make sense?

     

    Thanks

  2. Read the screen name!! :) I don't program, but I understand the basic stuff. To search in Outlook I use 'F4' which brings up a search window. From there I type in what I want to search for. Forever, it's been the same thing. Recently, it's now four things I need to search for. The format is '000-0000000-0000000' All numbers, no letters. The first three are what I've searched for. When I search, it's either true or false. I don't know how I can search for multiple things. Like I search for '1234' and I either get something or I get a system beep when I don't find anything. Make more sense?

  3. Trying to do something like this:

     

    If search results in Outlook equal '1234' then goto "here"

    Or search results in Outlook equal '2345' then goto "here"

    Or search results in Outlook equal '3456' then goto "here"

    Else stop macro

    (This is the rest of the macro or "here)

     

    The issue is that when I search for something, I hit F4 and type in '1234' and press enter, or the macro does.

     

    Does this make sense? Any ideas?

  4. I'm using CRT. Text will scroll up and depending on lag, it make vary. I would make a macro that simply waits and in most cases CRT would be 'ready'. The problem is, I'm making this macro to do mundane things so I can speed up my routine. :) I have certain text or a prompt. When that prompt shows up, I'd like for it to run the next piece instead of relying on me to start it back up again. Is there a way to do this?

     

    Thanks!

  5. Unfortunately this window is used a lot, so type is scrolled by with each use. A select all would be a LOT after a few minutes. Even if that was a possibitly, you can't. :( Only the mouse, that I know of, can select the type. I can do this manualy, no problem! It's just "Mouse down, move, Mouse up" doesn't seem to select the type, even though that's exactly what I'm doing. :/

     

    Thanks

  6. Here's my thinking. I've got delay's all over the place and it doesn't seem to improve anything. I'm thinking that even though the mouse pointer is at the right spot and the left button is held down the next line in the macro is to INSTANTLY move up left. I'm thinking it doesn't like that. Is there a way to move the mouse from point 'a' to point 'b' over 0.2 seconds?

     

    Thanks

  7. I put mouse delays before every mouse action. It worked.. "better". Is there a way to simply slow down the mouse speed of the selecting part? My guess is that it's instantaneously jumping from one area to another and therefore not selecting the stuff in between.

     

    Thanks

  8. I'll post the entire code as that 'may' have something to do with it.

     

    Activate Window: "<window name>"
    Mouse Move Window 40, 705
    House Left Button Down
     Mouse Speed: 250 Miliseconds(Doesn't seem to help the problem)
     Mouse Move Window 10, 510
    Mouse Left Button Up
    Variable Set String %T1% from File: "copy.txt"
    Activate Window: "%T1%"
    Text Type: <ALTD>r<ALTU><CTRLD>v<CTRLU>

     

    The main issue is that it's not selecting! :( This works every so often, but as in just about all uses of a macro, I'm trying to save time. :)

     

    Thanks

  9. Here's what I'm trying to do.. Reply to an email, new window pops up. The 'title' will always be different since it's the subject of the email. Copy a piece of that email, switch to another program, run a command with that copied piece. Switch back to the reply and paste some text.

     

    I've got everything down but switch back to a window that changes it's name all the time. I can't put in a command to switch to "window X" since the name will be different. Here's what I've come up with. First, save the window name as a variable, do the other stuff, then use that variable for a window name to switch back to. Problem is, how? :)

  10. Here's what I have so far:

     

    Contol Key Down

    Text Type: c

    Contol Key Up

    Variable Set String %T1% from Clipboard

    Variable Set Integer: %N1% from Position of Text in Variable %T1%

    Variable Set Integer: %N1% = %N1% - 4

    Variable Modify String: Delete Part of %T1%

    Variable Modify String: "External - SecureCRT"

    Text Type: z -os <CTRLD>v<CTRLU> -s

     

    I'm trying to get a number from the cliboard. Copy to it, parse out the piece I need (xxx-xxxxxxx-xxxxxxx), switch to my CRT window and run a command with what I copied out. Where am I going wrong? I run the macro and it switches to the CRT window and copies the wrong thing, looks like random text.

     

    Thanks!

  11. Thanks guys! All of that 'makes sense' but don't know how to apply it yet. I've got 'the book' on the way and hope to understand this stuff one day. I definently don't leech everythinI can hoping that you guys will make a macro for me. I spend a few hours a day on this believe it or not. Just want you guys to know, I'm willing to work at this. :) Where did you guys learn this stuff?

     

    Thanks!

  12. Almost. :) What I'm trying to do is find that number that's 3-7-7. The dashs need to be in there, it's just that number is different each time.

     

    Example:

     

    blah blah blah 123-1234567-1234567 blah blah blah blah

     

    How do I get just the number? They could refer to numbers in other parts of the email, so the "3numbers"-"7numbers"-"7numbers" would have to be specific to what needs to be extracted.

     

    Thanks!

  13. Hope this isn't redundant! :) I think I got the basics of parsing, but I need to go a tad further with it. The emails I get have 3numbers, dash, 7, dash, 7. Is there a way to look for these? It's all numbers and no "text". The format is also the same every time, 3-7-7. After the clipboard copies it, how do I strip out that number?

     

    Thanks again!!

  14. The online help that I've looked at and appears to be the same that you point out, are extremely basic and have very simple macros. Am I missing something?

     

    Also, the F3 was for Outlook for the find window. :)

     

    Thanks!

  15. Welcome to the forum.

     

    Since you know the text at the beginning and the text at the end and since the size of the window varies, my recommendation is to ... (yes) ... highlight the text, copy it to the clipboard, copy the clipboard to a variable, and parse the variable. I will outline how this works but you may need to spend a few minutes in the help file for details.

     

    Highlight the Text

    The first thing to think about when trying to accomplish something with Macro Express is "How would I do that manually". Many Windows programs will allow you to highlight the content of a window by pressing Ctrl-a. So, when the email is visible, does Ctrl-a highlight everything? If so, then this step is easy. Just Text Type: <CTRLD>a<CTRLU>. (Note that you should use lowercase letters not uppercase. If you use uppercase A you are actually sending <CTRLD><SHIFTD>a<SHIFTU><CTRLU> which may not work in some applications.)

     

    If <CTRLD>a<CTRLU> doesn't work you might want to try typing the keystrokes that 'forward' the email message. Then the body of the email will be in an editable box and the Ctrl-a technique is likely to work. After the text is highlighted and copied to the clipboard you could type <ESC> or something similar to cancel the forward of the email.

     

    If this does not work then you need to find another way to highlight everything. Perhaps using the mouse will help. Again, experiment manually to determine what will work for your application. You may be able to click the mouse button down and drag it to another location. If that is the case you will need to know where to start and where to stop.

     

    There are macro commands to return the position (relative to the screen) of a window. Look at the Variable Set Integer %N1% from Top of Window, Variable Set Integer %N2% from Left of Window, Variable Set Integer %N3% from Width of Window and Variable Set Integer %N4% from Height of Window commands. Once you know the coordinates of the Window it becomes a math problem to determine the position of the area within the program window that actually contains the information you need. You may need to adjust the top coordinate, for example, to skip over menus, toolbars and headers. The Variable Modify Integer command allows you to do math.

     

    You need to find top-left and bottom-right positions of the window containing the body of the email. Each of these positions require two variables (for the top and left or the bottom and right) for the X and Y coordinates. Once you have the two locations you can move the mouse to the beginning, do a Mouse Left Button Down then move the mouse to the ending position Mouse Move Screen %N3%, %N4% and then do a Mouse Left Button Up to highlight the text.

     

    And one more option would be to use the Window Control commands. If they work they would greatly simplify finding the position of the area of the window containing the body of the email message.

     

    Copy to Clipboard

    Use the Text Type: <CTRLD>c<CTRLU> command to copy to the clipboard. You could also use Text Type: <CONTROL>c or Clipboard Copy. There are several ways to copy to the clipboard because some methods work with some programs and not others.

     

    You will likely need a small amount of delay between highlighting and copying to the clipboard. Macro Express sends commands very quickly and Windows often needs a chance to finish one command before the next one is sent.

     

    Parse the variable

    This step is also straight forward. Use the Variable Set Integer %N1% from Position of Text in Variable %T1% command to find the location of the 'beginning' text in the variable. Use the Variable Set Integer %N2% from Position of Text in Variable %T1% command again to find the location of the 'ending' text in the variable. Then, using the Variable Modify String: Copy Part of %T1% to %T2% command you can copy the information between the beginning and the end. You will need to adjust the beginning variable (in this case %N1%) to take into account the length of the 'beginning' text string.

     

    The resulting macro may look something like this:

    // Highlight
    Text Type: <CTRLD>a<CTRLU>
    Delay 0.1 Seconds
    
    // Copy to clipboard
    Text Type: <CTRLD>c<CTRLU>
    Delay 0.1 Seconds
    
    // Copy from the Clipboard to a Variable
    Variable Set String %T1% from Clipboard
    
    // Parse the variable
    Variable Set Integer %N1% from Position of Text in Variable %T1%
    Variable Set Integer %N2% from Position of Text in Variable %T1%
    Variable Modify String: Copy Part of %T1% to %T2%

     

    If you do not want to tackle the problem that way you could, as you describe, try to find the beginning text and the ending text and copy only the information in between. The trick would be to know how to determine where the beginning and ending text are located. So, how would you do this manually? See if there is a command in your email client that allows you to do a 'Find'. In Outlook you press the F3 key to start a find so you would do a Text Type: <F3> command. I would find the beginning text and store that position in two variables (for the top and left or, in other words, the X and Y coordinates) and then find the ending text and store that position in two other variables. Once you have the two locations you can move the mouse to the beginning, do a Mouse Left Button Down then move the mouse to the ending position Mouse Move Screen %N3%, %N4% and then do a Mouse Left Button Up.

     

     

    The reason other topics suggest copying the entire thing to the clipboard (the first technique described above) is because that method is likely to be more reliable and probably quicker.

     

    Best of luck to you. We are here to help if you get stuck.

    I'm getting there, honestly! :) F3 does nothing for me, not sure why. But that's not entirely a bad thing. Manually, I can select all(crtl+a) and copy(ctrl+c), so that part is taken care off. Is there some sort of online tutorial or help guide? I saw the one on the main site, but it's VERY basic and doesn't even mention 98% of the functionality of the program. Back to the macro part. I see it, but don't understand it completely.

    // Parse the variable
    Variable Set Integer %N1% from Position of Text in Variable %T1%
    Variable Set Integer %N2% from Position of Text in Variable %T1%
    Variable Modify String: Copy Part of %T1% to %T2%

    I got the Variable Set Integer part. %N1% and %T1% I assume you're taking a temporary "thing" into a variable that's concrete? What do those stand for? I also assume the %N1% and%N2% are the begining and end of the clipboard(%t1%)? And then the last line I'm confused at. :)

     

    Sorry for the complete newb questions. I've spent endless hours between this and Visual Basic. Found a great book on VB, but nothing but my own guesses on the scripting of this one. :)

     

    Thanks!

  16. I know this has been asked many times, and I've searched the forums quite a bit.

     

    I know it's possible.. My goal is to get an email, based on that, run a macro. I need to copy the whole email to the clipboard(I think) and then parse out what I need. What I need is a number, so among text, that's easy. The macro needs to switch to another application(SecureCRT) use a command and inset that number in the middle of that command. Got that part. I need to copy only a piece of what pulls up from all the information. I can't tab or up arrow, but I can use my mouse to select the type. I would like to search the window for the starting few words(which don't change) and the last few words(which don't change) and select everything in between rather than the mouse coords since windows sometimes move and the response is sometime shorter of longer. Then I need to paste that into an email. They copying and pasting and switching windows I've got. It's the selecting the type of the email(that one number) and from the SecureCRT window that stumps me. Long drawn out explanation, but I wanted to be as clear as I could. :) I'm a newb(check the user name :) ), so just saying that I need to copy to the clipboard, save to a variable and parse it doesn't make much sense. My ripping apart the forums gave me that! :)

     

    Any help would be greatly appreciated.

     

    Thanks

×
×
  • Create New...