Jump to content
Macro Express Forums

margaret

Members
  • Posts

    92
  • Joined

  • Last visited

Everything posted by margaret

  1. Do I need the default delays that are shown in Preferences if I use the "Wait for Text Playback" command after any Text Type command that is sending more than a couple of characters to an application? In the Preferences I see a default delay of 250 milliseconds after clipboard commands, and Text Type default delay of 300 milliseconds. My macro has Keystroke Speed set to 2 milliseconds. Some of the macros seem a little slow in pasting, and I was just wondering about these default delays versus Wait for Text Playback. (The macros copy, then switch to another application and paste in, and they do a varying amount of handling to the text before pasting in depending on which macro, and they are sometimes a little unpredictable. I've just discovered Wait for Text Playback, which seems to make them more reliable.) Thanks, Meg
  2. This is great, Paul. Thanks! rberq' s solution works as well, but took me longer to write up. Naturally, I had it figured out his way before I saw yours... Meg
  3. How would I go about counting the number of spaces in a string? The string will already have been trimmed on both sides, and will already have had any instances of two spaces in a row changed to one space. What I want to do is to evaluate the string, and if it only contains two words (hence one space), stop the macro, because that macro is designed to deal with a string of more than two words. I know how to find out if the string doesn't contain any spaces, but how would I find out if there's only one? Thanks!
  4. hi Bob, Yes, the data selected would be confined to a single screen. The user will be selecting only a word or phrase, most likely never more than about a line's worth at a time. The only exception would be if the desired word or phrase began on one page and ended on another. I've not looked into finding colors, but since the macros are intended to be used by different users on different systems, it seems as if the selection color could vary unpredictably. It's not an absolutely-must-have feature; it's a "would-be-extra-cool" feature that one user particularly wants. If only it could be done by keys instead of mouse, it'd be easy, but I can't change Acrobat or Reader! I have to finish up some other aspects of the macros now, and I'll look at this again later. Thanks for all your help.
  5. Hi rberq, I tried taking out the mouse click and adding a delay. No difference. I tried a bigger delay (2 seconds), no difference. As far as what you say near the end your message, I'm not quite following. I'm not sure what you mean by "stepping the mouse backwards". The idea is to use stepping backwards by keys in order to obtain: #1 set of coordinates = where end of selection was #2 set of coordinates = where beginning of selection was at this point, the mouse is at #2, so we need to move it by the difference between #1 and #2. Supposing that #1 was 500,200, and #2 was 200,100, then if we're at 200,0, we need to move right 300,100. This whole thing is about working with PDF files. So far, in Adobe, can't get coordinates (I get numbers but they are meaningless as they are always the same no matter where I am). In PDF X-Change Viewer, can't get coordinates. In Foxit Reader, I get the coordinates. It sounds as if you can't get coordinates in every application. I'll try to attach a file with my macro. OK, the first macro I uploaded is wrong. The 2nd and 3rd are corrected and are the same (couldn't figure out how to delete attachments, thought I had deleted them so I uploaded again). THe good news is that the revised macro works in Foxit Reader -- the bad news is that it selects on the line above where the original selection was. ExperimentingWithSelections.mex
  6. OK, more testing has shown that the get coordinates thing just doesn't really work in this application. I was getting 0,0 at one point because I had my variables mixed up. When I got them straightened out, I saw I was getting the same coordinates no matter where I was. I think that idea would be the way to go *IF* that command worked, but it's no go in this application. There are a couple of similar applications I'll try the same thing in, though.
  7. Hi Brandon, That sorta kinda works. The amount of text it selects is unpredictable. But I'm working on another idea, see the message I just posted. The text in the first program is selected by the user -- it has to be as it's unpredictable, depends on the user's judgment.
  8. I think I've got an idea of how it SHOULD work, but the problem I'm having is with the get coordinates command. At one point in the macro it doesn't work, at another point it does. the idea is: copy the selection save the length of the selection in variable press right-arrow key (moves text cursor to end of where selection was) move mouse to text cursor location click mouse get mouse coordinates move left-arrow key the number of times = length of original selection move mouse to text cursor location click mouse get mouse coordinates subtract 2nd set of coordinates from 1st, save in New Variable mouse left button down mouse move position by the amount in New Variable mouse left button up The problem is, at the first time I try to get mouse coordinates, it gets 0,0. The second time, it gets coordinates, so I don't know why it wouldn't get them the first time. I've tested enough that I know the "move mouse to text cursor location" command is working.
  9. Hi rberq, That would leave the text "highlighted" in the sense of being selected (as if you were going to copy). That's not what I'm trying to do. In Adobe Acrobat, if you select text and copy it, then the text is still selected. But then if you click on the Highlighter tool (to make the text yellow), that text becomes deselected and the cursor no longer knows where it was. So you have to click on the Highlighter tool and then re-select the text if you want to make it yellow. The idea is to get the macro to both copy it and highlight it yellow without the user having to re-select the text. (In Word, this wouldn't be necessary -- in Word, when you select something, then copy it, then it's still selected, and you can click on the Highlight button to highlight it -- clicking on the Highlight button doesn't de-select it.) If the cursor knew where it had been, I might be able to select with Shift-arrow combinations from that point by the number of characters equal to the length of the original selection, but as far as I can see, selecting text to highlight it yellow only works with the mouse.
  10. Hi Brandon, I tried this, but it seems to just not do anything. What I was hoping for was for the user to initiate the macro after they've selected the text (since this is the way the existing macro that I want to expand upon already works). As I suspected, this is probably not possible. Thanks.
  11. Apparently it's possible to select text in a macro if I know the mouse coordinates that I want. Is it possible to get the coordinates of an already existing selection, so that the macro could re-select the same thing again on that same page of the document? Suppose that when the macro starts, certain text is already selected (as if you were going to copy it). The macro copies it. Then the user has to select a different tool, which the macro can accomplish by keyboard shortcut -- but after the tool is selected, the previous text selection is no longer selected (that's just the normal way that the application we're working in works). Is there any way for a macro to save information about the previous selection such that it could re-select the same thing? Thanks.
  12. It's not a question of multiple spaces. It's spaces where a space should not be, in the middle of a word. For example, suppose you had a name like "John P. Pas solo." There shouldn't be a space between the two s's. So if I have the macro check the first space (doesn't fit parameters, thecharacter following the space is uppercase), then the second space (doesn't fit parameters, the character following the space is a period), then when it comes to the third space, it will fit the parameters (surrounded by lowercase letters) so the macro will now "know" that this space shouldn't be there. Aha, so the other problem is Firefox. Thanks, I'll look into that.
  13. Hi Paul, Thanks. I think that would do it if I already knew where the three characters are in the string, but I will not know that. I want to find any two lowercase characters that are separated by a space (i.e., every word after a space should begin with a capital letter, but sometimes there are unwanted spaces in the middle of a word, hence before a lowercase character). To use the above, I guess I would have to loop through the variable finding all the spaces and then testing the surrounding characters for case. I will work on that. What I was hoping for was some way to look for the combination as a search parameter, like "if <string> contains <[a-z] [a-z]> then... By the way, when writing a forum message, every time I try to type an apostrophe, my cursor focus gets moved out of the message and into a "Find" box. Is this to be expected?
  14. Hi Scasper, Both of your suggestions work perfectly! I think the first one is all I need for my current purpose, but I am certainly saving both of them. Yes, I know about saving the variables. What I was trying to do is to have the user delete unwanted characters in a string. so that the string would work correctly with the string-manipulation routines that follows. The content of the strings and the placement of the unwanted characters are almost all unpredictable, so there was no way for the macro to determine what to delete.
  15. I would like to be able to test whether a variable contains any three characters where the first and last character are any lowercase letters and the middle character is a space. I can do it with specific characters, but is there a way to use wildcards so I could test for all such situations?
  16. Is there a way to show a string to the user, allow the user to edit it, and then store the resulting edited string? I've been looking at the dialog box options and haven't found this so far.
  17. It's a text variable that I want to save, so that sounds as if it would work. I'll try it. I guess this is a new question, but I have a macro that calls another one, and I don't seem to have to save/restore the main variable (the main macro copies the clipboard, the called macro manipulates that text in various ways, then the main macro takes over and does more stuff, and supplies the modified text to another program a few steps later. It works without saving/restoring the variable. Apparently I only have to save/restore the variables if they'll be used by a different macro entirely (in the same session), that runs separately from the macro in which I saved the variable -- but not if they're being used by a macro called while the original macro is running. I've wondered how "safe" this is to do, but it helps me because all the macros used this called routine, so if I want to modify it, I'll only have to modify that one macro instead of all of them.
  18. A spreadsheet -- that is a truly great idea! I'm used to VBA where I can name variables with names that have some connection to reality. In the last macro I wrote, I had to write out pseudocode with imaginary meaningful variable names and put the Txx and Nxx numbers above the meaningful names in order to figure out what I needed. ME Pro sounds great for me, but what I'm doing is creating a set of macros for other people, who won't want to get ME Pro. I would assume that plain ME can't read the custom-name variables that you create in ME Pro, right? Thanks for the suggestions.
  19. Apparently the only way to save variables is to save all variables of a certain category (all text variables, for example). Is that correct? There's no way I can just save one particular variable? Thanks.
  20. Hi rberg, I mean that if I'm just using or testing the macros, just running them, this problem never happens. It only happens when I have been making changes to the macros since the last time I opened ME. I have four sets of similar macros [that do the same thing in four different situations] which are "evolving" as I keep figuring out new things and adding them. But this problem doesn't happen every time I make changes. Something along the lines of what you're talking about happened to me once, although it didn't run the macro. It just switched me into ME instead of switching me where I wanted to go. So I changed my macro names so that they couldn't possibly be confused with the application window that I wanted. If you have a macro open in the Explorer at the time, then you could have, say, one window title of FileMaker and a window title of FileMakerMacro2 in ME. If I remember correctly, it activated the script editor window instead of the application window. So I was back in ME and didn't know why at first. If you don't have the macro open in the Explorer, then the macro title won't be in the ME window title, so the name won't matter.
  21. Hi, Well, with your window control example, you seem to be describing a predictable problem, and this problem isn't predictable. It happens only once in a while and only durng a session of making changes to the macros. I can't predict when it will happen and I can't make it happen on purpose. I have manually entered the window title and it is a partial match. It's not that the match doesn't work. It's that the whole command only partially works now and then -- but not that often, since I've changed these macros thousands of times and it's only happened twice. (Of course now when I want it to happen so that I can test whether rebooting Macro Express but not rebooting Windows would fiix it, it's not happening.)
  22. Why would an Activate Window command that has worked succesfully so far in 32 macros suddenly stop working? I tried adding a "Wait for Window Title to Appear," but that didn't help. What happens is that in the window that is active when the Activate Window command should occur, the title bar appears to lose focus. But the window that was supposed to activate doesn't, and there's no "running man" icon, error message, etc. I'm doing the same thing I've done many times, so I'm baffled why it would stop working. [added later] Now I realize this has happened once before, in a similar situation (I had been changing other parts of the macro and then testing, and the other parts that I'm changing appear to have nothing to do with the problem). Although I haven't had any other problem related to changing-saving-then-retesting, now I'm wondering if it's rebooting Macro Express that made the difference, not rebooting the machine. I don't think I can reproduce the problem on purpose, but if it happens again I'll try rebooting Macro Express first.
  23. I don't think I made my question clear enough. I believe the help file gives the same info as Macro Express Explained, which is what I read. Even if I don't use the /S switch, the user still has to use Start, Run, navigate to the file, etc., and see the screen go black temporarily. That is exactly what I don't want. So the best thing is to give them instructions to run the usual installation with options so that the Editor is installed but not loaded at startup, and have them open the editor from the context menu of the system tray icon and then load my file. After that they won't need the Editor unless they decide to change the keyboard shortcuts for activation since my file will be loaded by default from that point on.
  24. When distributing files to macro users, there is no way short of a silent install to have a different macro file loaded by default -- correct? The users will not need to use the Editor unless they decide to change the activation shortcuts, in other words, most of them won't need to use it, but I have to install it because if I don't, then those who want to change the keyboard shortcuts won't be able to. (These are individuals in different locations on their own computers, not on a network.) I'd like to keep them out of the editor to keep things as simple as possible. I tried creating a silent install but I think that would be inadvisable for these users, to whom a regular installation process will seem more familiar than the screen going blank during the silent install. But they'll have to use the Editor in order to load my MEX file, unless I have them not launch the program at installation end and then rename my MEX file to macex.mex. That doesn't seem like a good idea because it would make it harder for me to keep track of which version of my file they have (there are several versions for different situations that do the same thing in different programs).
  25. Have you thought about trying voice recognition? Dragon Naturally Speaking Professional has very extensive macro capabilities, which would be very easy for you to use with your programming background, and you can use it in combination with Macro Express. It is expensive, but may be worth it in your situation. The less expensive version, Dragon NaturallySpeaking Preferred, has much more limited macro capabilities, but I believe you would be able to speak the shortcut keys that you have programmed into Macro Express. Also, some programmers have come up with ways to write more macros in Dragon NaturallySpeaking Preferred by using additional languages. I don't know much about that because I have the Professional version. If you'd like more info, please send me a private message through the menu next to my username.
×
×
  • Create New...