Jump to content
Macro Express Forums

Cory

Members
  • Posts

    4,207
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by Cory

  1. You need to post this as a ZIP file. There is a sticky on this problem. Or post just the script code.
  2. I would copy it to a text variable and use variable manipulations to chew thru it. This post has a good example of this. If that isn't enough to get you started ask again with more detailed questions. It looks like some of your stuff is a uniform number count so you can just extract X numbers of characters instead of searching for text.
  3. I’m not 100% clear what you are trying to do but it sounds like you are taking a multi line text file one line at a time and adding HTML tags to the plain text which you then want save in another file. I don’t know what HTML you want to use but let’s say you wanted to color each other line red white and blue. If this is the case…. One thing that jumps out is that you referenced the command Text Type. If I understand you correctly I would not use this command to accomplish this task. Also it sounds as if you are trying to use some editor interactively to create this file Again, I would make my life simpler by not using any external application but rather doing it all internal in ME. In order to do this you need to understand a little better about using invisible characters like CRLF and such. I wrote a subroutine you can get at my website to generate CRLF and tabs you might want to look at and I also wrote up a deal about using a hex editor. Now you don’t need to use a hex editor but it would help lift the veil for you. Click here to get to my main macros page. Let me give you a brief idea of how I might approach such a problem. Now bear in mind simple HTML pages are plain text, this would not work for a compressed Word document. First I would write my HTML file header. I would set T1 to <HTML> and use Variable Modify String to append it to a text file with a CRLF. Then I would set T1 to nothing and append it to the text file with a CRLF to give a blank line. Then I would set T1 to <body> and write it to the file. See where I’m going? Now I would do a Repeat With File to grab each line and stuff it in T1. Then I would modify T1 to be “<p><font color="#FF0000">%T1%t</font><p>” to make it red. I would then write it to the text file. Now of course I would have to write some logic in to change the font color each time so that they would alternate but hopefully you get the idea. Does this sound like it would work for you?
  4. Trying to cheat at online poker are we? Just kidding. Don't use the record. Simply create the sequence in the scripting editor and experiment. If you need to move over so many times put the arrow move in a repeat so you can simply change the number of times it loops.
  5. You should make your request to Insight directly. This message board is hosted by Professional Grade Macros, a different company.
  6. You can not use the command line trick for a file that only resides in memory. It needs to reside on disk someplace. To silent print in Word don’t you just click on the printer icon?
  7. Some direct answers: 1. When you tell ME to Mouse Click on Control it does not move the mouse. It simply executes a click on the control. 2. Why are you double clicking the control? Normally tabs are activated by a single left click. 3. You describe the tab key passing over the tab in the form. That’s OK, as long as it is apparent in the Get Control Utility and it can normally be clicked on it should be OK. You say the tab is named “Application”. This is interesting. Is this where you launch your playable macro? If so I think you may be missing a general idea here about how ME is primarily intended to work. And it may be that you are making life difficult on yourself unnecessarily. Normally a user will have one macro file that will contain hundreds of macros and ME will load on startup so that are always available. One never closes ME. ME’s macros are then activated by any of a number of means but most often it’s with a hotkey. Personally I like CTRL and CTRL+ALT in combination with the number pad so it doesn’t step on top of other application hotkeys. In your application I envision that you need to get all your contact info onto the clipboard. In this case I would have the user move to the place with the desired information and fire the macro manually with CTRL+Keypad1. This macro would then directly launch you clipboard utility. See what I’m saying? It seems to me you are trying to launch macros and the other utility from within Act. But if you’re using playable macros that are not already resident in memory the macros can not activate because ME and your playable macro is not running. I’m just taking a stab at it here, maybe you are on the right track but some of your comments have left me scratching my head and if this is the case this would explain it. Let me know if I’m on or not here.
  8. Which part, having ME running all the time or the Set Focus?
  9. Are you sure that there aren’t CRLF at the end of those lines? I would check for that first. If they did exist and were not visible it would be a lot easier. If not I would chew thru the variable like we were talking about in our other post here. I would get the position of the first “..”, (Let’s say N1) decrement and test to see if it matches. If it does it’s one down arrow. If it doesn’t increment an integer as a down arrow counter. I would then delete the fist chunk of text from 1 to N1 then repetitively delete periods. Until the first character is not a period. Then delete the next chunk of text and again delete periods. Then repeat.
  10. Well your english is good enough to fool me! I was writing as if you were so I'll try to write more simply in the future. So where are you from? I live in Southern California although I originally hail from Montana.
  11. Ah, you replied while I was composing!
  12. Key? I’m not sure what you mean. Do you mean a macro launched by a hot key? I’ll assume you do for this message. I will also assume that you don’t know when it’s going to want to change. I’ll also assume it isn’t running in some loop or whatever and you need to have it remember what the value was last time. At the end of the macro simply write the value to the registry and read it in at the beginning. It sounds a little scary at first but it’s very simple, fast and won’t crash your system. <REGRSTR:1:HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express\Miscellaneous\johnboy><TVAR2:01:02:FWhat would you like?FFCenter:Center><TBOX4:T:1:CenterCenter000278000200:000:Do somethignTHis is where you would do somethign in the macro. %T1%><REGWSTR:1:HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express\Miscellaneous\johnboy> Try this macro as an example.
  13. I don’t have a lot of time this morning as I’ve had several crisis in my own systems this past couple of days. Stupid router. So I’ll just kind of blast thru your posts one line at a time. Please read my message more carefully. Also you might actually try doing this using the Debug > Debug Windows > Variable Values so you can see what effect the commands are having on the text. Trim does NOT remove spaces in the middle. It simply removes the non-printing characters from the ends of your string variable. The only reason I added this, as I explained before, is because sometimes users aren’t careful when they copy text and pick up superfluous leading or trailing characters that will mess up the parsing routine. If it helps you understand simply remove the trim command. It’s not strictly needed. On to your second post and the annotations: 1- [//find first space?] Yes, N4 is used to find the first space. 2- [//?] The Copy Part of Text will now parse out the first string variable. The command requires a start point and an end point. The start point is 1 in each case and is not variable. The end point is variable. My name is Cory Allen Jackson. The position of the first space is 5. If we grabbed 1-5 the text in your new variable would be “Cory “ with a space on the end. By decrementing N4 prior we get “Cory”. 3- [//Trimming what?] You’re trimming T8. In answer 2 above you have N4 set to 4, right? So now you delete 1-4 which leaves you with “ Allen Jackson”. Now the problem is that you have a leading space. If you ran the routine again it would find a space in position 1, copy 1-1 and you would be left with “ “ instead of the desired “Allen” for my middle name. So you Trim the space off the end. Usually I simply delete one character but Strathos’ approach is slick because it will work regardless of how many spaces there are. Very clever. I’ll have to adopt that one for myself. I think mainly you’re having troubles because of your misunderstanding of what Trim does. Go play with it and once you understand that it only removed non-printable characters from the ends of the string I think the rest will make sense to you.
  14. Well you're in luck. There's a "Set Focus" control command. Just set focus to the tab control when the macro fires or what have you. As far as firing I would think you woulnd't want to run the macro from a command line but rahter have it in your main marcr file tha'ts running all the time so that when the text in the drop down changes the macro would fire.
  15. Depending on your typematic settings the arrows will work differently. YOu see your system will see you holding down a key for a certian period of time and only enter it once unless the key is held more than X number of seconds. Once X seconds has passed your system will start repetitively firing the key sequence. To illustrate open notpad and start holding down any letter. You will see it fires once and then a bunch of times after a delay. Same with the arrow keys. So your system is really seeing the holding of the arrow down as a series of pressings. You can do the same. If you want to make the arrow go down like you holding it simply do a repeat with a down arrow command in the middle. However you wil probably need to introduce some timing controls depending on what you are trying to accomplish. If you get into that you need to consider ME's setting on how fast it 'types' your text commands. Either that or add somethig like a 100mS delay in your repeat. You can also change the type rate in the macro itself, check out Keyboard Repeat Speed and Delay commands under timing.
  16. OK, I think I undersand the general idea now. Still a little foggy on the details though. I understand there is an plugin called Clippie that copies all the fields to the clipboard. How is it activated? I understand that there is some sort of command line in Act. What would you use this for? Why are you using a playable macro? Wouldn't you want the macro always waiting to activate when whatever trigger event happens? Sounds like a pain to have to type it in each time. Personally I see people creating playable macros a lot and I think it's better to have all your macros in one file that's running all the time. Now you mention a drop down field. This is different than the tab? It sounds like you're trying to monitor a drop down field for a change and if it changes you want to click on a tab and run clippie, is this correct? If it is your activation should be for that dropdown field, not the tab. I'm sorry, I must be dense. The last version of Act I dealt with was the old DOS version so it's hard to visualize. Did I guess any of this right? Let me take one last stab. You want to monitor text in a dropdown box so that when it changes a macro fires, is that essentially correct? If it is I don't understand why you mention about running a playable macro from the command line.
  17. I’m not exactly sure what you’re trying to do. Could you explain more? It sounds to me like you want it to run a macro when you click on a tab. If this is the case this is not an activation handled by ME. If you are using MS Access I suggest you have an “On Click” event in VB run the macro. Otherwise there is no way to make ME fire a macro when you click on the tab. If your activation was set to Control on Top then it would fire all the time as you described. Whether the tab is the active tab or not it is of course “On top” and will cause the macro to fire. I think you’re thinking that if the tab, if not the selected tab, is not “On top”. While this is true from your perspective as a user as long as it’s visible and the application is on top is how the ME evaluates it. You might have some luck changing the activation to Focus instead of On Top. If your intention is to have a macro fire when that tab is selected in the DB you might see if you can fin a control in that tabbed area and set activation to it. If you click the tab all controls therein are immediately visible and that would work just the same for your purposes. But again, I’m not exactly sure what your intent is. Often people come to me with problems getting something technical to work and their problem usually is that they’re going about it the wrong way. Generally I have to stop them and have them explain their intent and usually the problem is that they’re trying to get something to work in a way it was not designed and the solution is a different approach.
  18. Yes it would but one would also need to replace three spaces and so on. There's always a way, I was just thinking it would be more elegant if the programmers at insight could simply anticipate my every whim and possible usage so that ME works exactly the way it think it should. In Excel I often concatenate cell contents to form quasi sentences that are easier for the user to read and understand and the Excel Trim come in very handy in these instances. I was thinking of writing a subroutine that would clean text. Have it evaluate one character at a time and if the ASCII value falls out of range be it odd characters or whatever and also kill end and multiple spaces. One of these days…
  19. Hey now, that is good to know. Thanks Joe! I was thinking I got it backwards anyway. What would be nice is a trim that work like MS Excel's trim where it also reduces multiple spaces to a single space each.
  20. Sorry about that. Usually when one says “virtual desktop” I think remote applications like Remote Desktop. To me running multiple desktops on one machine are “virtual machines”. Hence the name VMware. I would be interested in this answer to this as well. I can tell you this though: On a Windows Terminal Server running multiple desktop sessions for multiple users ME runs fine in all of them and as far as I know they don’t mess with each other.
  21. My example counts the number of spaces in your text variable. The number of names is therefore N+1. I mentioned this because you can use this to determine up front if there are two middle names. If N1=3 then you know there are two middle names and you can put them in the right place. IOW if you had 4 string variables but the person only had one middle name then the last name would be put into the second middle name field. But let me answer some of your other questions: Why trim? Because often users accidentally grab an extra space when copying with the windows clipboard. It’s not strictly necessary, just something I always do. This and the CRLF are just extra clean up steps. I think you’re confused by the Trim command. Trim does not remove spaces but rather it removed superfluous spaces from the ends of the text variable. It does not remove any spaces inside of that. Setting N1? N1 is an integer variable that tells us how many characters are in the string variable. We will use this to repeat N1 times when counting spaces. Let me describe this blow by blow. We clean the spaces off the end and remove any extra CRLF. We then count how many spaces are in the string variable and call it N1. We then repeat N1 times. When doing this repeat the repeat command sets N2 to the current iteration. IOW it counts up each time starting at 1. Inside this repeat we grab 1 character at position N2 and copy it to T2. We then test that character to see if T2 is a space. You need to look close since you can’t see it obviously but I have typed a space in there. Notice there’s a “ “ instead of a “” in the raw script and script text. If T2 is a space then we increment variable N3. When it’s all over N3 is the number of spaces. Does that make sense? From here one would use N3 in logic to determine if the last name is a last name or the second middle name. Now you mentioned there could be more than two middle name? You did not mention this in your examples before. But you can use this same method to count the number of words in order to determine where to stick each string var.
  22. Sure you can, I do all the time. However with some there are limitations. One application I use is VNC. It's nice because it's cross platform and free. The other nice thing about it is that instead of creating a virtual desktop session it connects to the console. Many techs will admonish you for troubleshooting a system with Terminal Services (Remote Desktop) or Citrix but there is no problem with VNC. The other nice thing about VNC is that the limitations I will mention in a bit with RD don’t exist with VNC. You can minimize or even close the session and the macro will run with no problems. There have been several times when I needed to run the same macro on several computers in parallel in order to accomplish a tas and VNC has proven invaluable. I also use Terminal Services via the Remote Desktop client with a fair amount of success. The major limitation here his that commands like “Wait For Window Title” and controls will fail if you minimize or disconnect. I think RD is smart enough not to paint this activity when you’re minimized because obviously there’s no audience. I like TS/RD better than VNC though and have a work-a-round. If you several windows open you and resize and move other things in front of that RD window and it will continue to work. Just don’t minimize or disconnect. Oh, another nice thing about RD is that you can share your local hard drive so you can have ME on the remote run off your local drive which avoids shuttling them around. I’m not suite about other software like PC Anywhere or Citrix but I’m sure they’re similar.
  23. I’ve been messing around with this and have found that the activation problem with IE7 only occurs when the browser has focus and is on top. I think most of you know this now but my earlier tests indicated a broader scope. But after thinking on it a bit I decided I like PM and found a work-a-round. My thinking is that generally one will only want to be running macros on predetermined sites and that these sites are probably ones you trust. So instead of disabling PM everywhere simply disable it in your trusted sites and local intranet zones and leave it on for the Internet zone. This way you can add these sites to your trusted sites zone and not have any problems. If anything it’s another measure to ensure you don’t run your bank log on to a phishing site! I’ve been doing this for quite a while and hadn’t even noticed the problem until a recent post here. Try it, I think you will like it.
  24. I'm guessing you're dangerous now but in a different way. Hey that's a great trick for printing. I'll need to make a note of that. I knew /m was the macro switch but I didn't know there was one for printing like this. Does it close Word as well?
  25. But I am running Vista and IE7 and don't have the problem. Am I remembering correctly that the problem was that hotkeys wouldn't activate a macro?
×
×
  • Create New...