Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,203
  • Joined

  • Last visited

  • Days Won

    61

Posts posted by rberq

  1. Ditto what Alan said. Withing limits, keystrokes have the advantage that Windows MAY buffer them so you can feed them to Word faster than it can process them, which simplifies timing (see below).

     

    For testing/debugging, after each mouse move use a ME text box to display where you have moved it to, instead of having ME click the mouse. Then you can move and click the correct spot manually, so as to continue through the process and take more notes.

     

    You may have to insert delays so Word can respond to a mouse click, before you continue to the next click. Often time delays will not be reliable because Windows will respond faster or slower depending what else it is doing. In cases where the screen changes you may be able to check pixel color at selected places to wait for the screen to change, so you will not be clicking the wrong screen.

  2. Shouldn't DEFAULT CASE precede END SWITCH?

    Though I don't see why that would cause your problem, unless the macro compiler gets mixed up by the out-of-place statement.... It's worth a try to move the DEFAULT CASE, or eliminate it entirely at least for testing.

     

    Macro Express 3 only allowed the first 36 options A thru Z and 0 thru 9. So you might be looking at a bug where ME Pro is erroneously still stopping after 36 tests. Are you on the latest version of ME Pro, and/or have you checked with product support on this problem?

  3. With some web pages, I have had ME do a Ctrl-a to highlight all text on the page, then copy to clipboard and transfer to a ME text variable. Then you can scan the whole text string looking for "Yesterday's Calls" or whatever other words delimit the beginning and end of the data you want to extract. Whether it works or not depends a lot on how the page is presented. Sometimes the page is in sections, and you have to click on the right section before doing the highlight/copy-to-clipboard. You can test in a few seconds to see if it will work, by manually doing the Ctrl-a and Ctrl-c, then paste into Notepad and see what you have.

  4. MS Remote Desktop allows the remote user to sign on to the host machine, more or less at the operating system level, and then to do whatever his user ID allows him to do, as if he were sitting at the host's keyboard and monitor.

     

    Citrix allows extensive configuration of APPLICATIONS on the host, and retains a lot of control at the host as to what the remote user can do. Generally the remote user has no access to the host desktop, nor to any programs on the host other than those allocated to him. For example, the remote Citrix user could not even open Notepad on the host unless Notepad is permitted to him. Again, I'm no Citrix expert, but it doesn't surprise me that the host machine clipboard can be restricted, with no ability for the remote client to override.

  5. So let me restate what I think you are saying:

     

    1) On the Citrix client, you can (sort of) paste into an application field by simulating keystrokes with ME. I am guessing you simulate typing the actual characters you want entered, rather than having ME enter Ctrl-v, because Citrix would intercept the Ctrl-v and paste inappropriate material from the application server's clipboard. Correct so far?

     

    2) On the Citrix client, you can probably highlight the contents of an application field either by keystrokes or by a mouse swipe. You can accomplish this highlighting either manually or via ME keyboard/mouse actions. However, if you then do a Ctrl-c, Citrix intercepts the Ctrl-c and the copied data winds up in the (inaccessible) application server's clipboard. Correct?

     

    I don't know how big a development budget you have -- i.e., how important this is to your company -- but could you (1) highlight the desired field(s) on your local Citrix client machine, (2) do a full or partial screen capture via a PrntScrn key or with a package like SnagIT, then (3) use character-recognition software to read the data off the screen image? At that point you would have the data captured on your local PC and could do with it as you wish.

  6. If you are using a Citrix client on your PC to access an application on a remote server, then I withdraw my suggestion about reading from controls -- I don't think it will work, because the "real" controls don't exist on the client machine, they are only simulated. At least that is my high-level un-detailed understanding. I have had mixed success with Macro Express running on the Citrix client machine and doing copy/paste -- sometimes it would work, sometimes not, maybe depending on the version of Citrix, I don't know.

     

    Sorry, I'm not sure that is very helpful, but I'm a little confused as to just what configuration of remote vs. local machines and applications you are working with.

     

    Edit: I see Cory posted while I was typing. Maybe THAT'S why I could make it work sometimes and not others. I didn't configure the Citrix piece, so it could have been dependent on the preference or whim of the Citrix guru. :o

  7. Look at the Help screens for Environment Variables -- you can create variables with whatever name you like and store string data in them, then retrieve it later. But I don't remember whether the environment variable survives a reboot of Windows; I don't think so.

     

    Also look into Create Registry Entry, and write-to/read-from the variable. Again, I don't know whether the created entry survives a reboot, but it seems that it should -- what's a registry for, after all? :)

  8. You could also experiment with having ME read directly from the controls within the application form, as opposed to copying to the clipboard. (If you can make it work, it's very fast and the user need not even know it has happened if, say, you launch a macro based on the form's window title.) Then as Cory suggests have ME write the data to a file in order to transport it outside the application.

  9. How about a macro that doesn't move the files but renames them? For example, if the file is destined for folder A, then the macro:

    1. Clicks once on the thumbnail to highlight it.

    2. Uses keyboard commands to rename it from, say, FILE12345.JPG to A_FILE12345.JPG.

    3. Moves on to the next thumbnail.

     

    The rename should happen pretty fast, not like waiting for the clipboard which can be slow.

     

    Then once you have renamed a few hundred or a few thousand, you run a simple DOS batch script to move them:

    move c:\sourcefolder\A_*.* c:\destination_A_Folder

    move c:\sourcefolder\B_*.* c:\destination_B_Folder

    move c:\sourcefolder\C_*.* c:\destination_C_Folder

  10. Are you really working with, literally, more than 12 million files? Or is that hyperbole?

    I don't see how it is practical to sort through them manually in any case. That would be almost 7,000 hours of work even if you could handle one file every two seconds, which you probably couldn't.

    It would help to know what there is within each file name that you want to use for sorting.

     

    My first inclination would be to:

    Produce a complete file list using the DOS "dir" command.

    Sort the list by importing it into Excel or some similar computerized process (ME might be helpful at this stage).

    Convert the sorted list into DOS "move" commands in a batch file, with the appropriate destination folder embedded in each command.

    Run the batch file.

     

    If you truly want to handle the files manually with help from ME, then you could write a macro that

    1. clicks on the file name to highlight it (you would start with the mouse positioned over the file name in a Windows explorer screen)

    2. copies the highlighted file name into the clipboard (F2 key followed by Ctrl-c)

    3. generates a command.com command string to move the file to the appropriate folder, and launches command.com with the command string.

    You could have several macros, identical except for the destination folder name, and launched by different hot keys. That way, you would position the mouse over the file name, hit the appropriate hot key, and the file would be zinged off to the destination folder.

  11. I don't know any way to do it directly from ME.

    However, if you can write the C# or VB code, your macro could call a program to check the mouse. Google "detect mouse button state" and you will find a number of examples of simple C# or VB or Javascript code to check it.

     

    It sounds like a useful command that Insight could "easily" add to ME -- I suggest you ask them to do so. Won't help you right now, but maybe in the future ....

  12. %tAlternative% may truly have length 24, but leading or trailing blanks may be disappearing during the Display. Try this:

     

    Set a variable to the asterisk, or a capital X, or anything you like.

    Variable Set String %tX% "X"

    Then concatenate your new variable to the beginning and end of %tAlternative%, and display your new concatenated variable. You will then be able to see whether there are embedded leading or trailing blanks.

     

    Or simply right-trim and left-trim %tAlternative% before setting the length.

  13. This is not an ME question, but I know some of you do a lot more than write macros.

     

    Can anyone recommend a good book or other resource for getting up to speed with Visual Studio / Visual Basic / .NET programming? I am NOT interested in the typical 1500 page book that tells me every mouse click and wrist movement to drag controls onto forms and display "Hello, World" in a message box. What I need is more of a technical understanding of how projects are structured internally, how they interact with Windows and with SQL databases and file systems, what those <weird strings of words in brackets> are all about, how to package procedures in a DLL as opposed to an EXE, how to integrate a VB program with one in some other language like C++, and so on. I come from a long background in procedural language programming (IBM Assembler, COBOL, RPG), where you could pick up a book and understand how your program interacts with the operating system. But I am having trouble getting my arms around object oriented programming and the fact that Microsoft invents a new programming architecture about every 18 months.

     

    Thanks for any sources you can recommend.

  14. I don't know an easy, straightforward way to do it.

    You could use the Program Launch command to run command.com, passing it a DOS "dir" command and directing output to a text file. For example, dir c:\foldername /s > c:\listfile.txt. Use appropriate options with "dir" if you want to include subfolders.

    Then use Text File Begin Process to read back the text file. The last couple lines should tell you number of files and total size, which you can extract into variables. When you get done with this macro you won't consider yourself a newbie any longer.

  15. You could experiment with the Wait for Web Page command, which is intended to tell you when IE is no longer busy (that is, next page has been completely loaded).

     

    Another method would be to pick a pixel location that you know will change color when the subsequent web page appears, and monitor for the change with a REPEAT loop that checks current color. That might or might not be sufficient, since the spot on the screen could change before the next page has finished loading.

     

    Or, try having the macro type Ctrl-f (again in a REPEAT loop) to find and highlight "RATEPLAN SELECTION", followed by ESC to clear the Find box, followed by copy-to-clipboard, then examine the clipboard contents for the text. If it's there in the clipboard then your next page has at least partially loaded. Might be best to follow detecting the text with Wait for Web Page. This method is kind of ugly since the Find box will appear on the screen. Make sure to clear clipboard content so you don't "find" text left over from last time the macro ran.

     

    If you're lucky, someone will post a cleaner and simpler and more reliable method that I haven't thought of.

  16. A couple more ideas, in case Paul didn't nail it:

     

    (1) Should you be getting pixel color relative to WINDOW or relative to SCREEN?

     

    (2) Instead of relying on an absolute color value, do an initial capture of pixel color, save it as both original color and current color, then "repeat until current color is NOT equal to original color". The trouble with specifying an exact color value is, the color may change on a different PC or if you switch among 16 / 24 / 32 bit color schemes.

     

    (3) Move the mouse pointer to the pixel location, as a debugging tool to make sure the macro is checking the right location.

     

    P.S. Maybe ME doesn't like your accent. Over here we always check colors, not colours> :P

  17. Alan - Does Pro's memory consumption increase much when various states are being monitored?... or does monitoring increase likelihood of conflicts w/ other programs? ME3 typically consumes less than 10 Mb.

    Free advice, and worth it: Check carefully the enhancements available with ME Pro, and if you don't REALLY need them then stick with ME3. The ME3 script editor is just much easier to navigate, and ME Pro has been very buggy. I have put together some fairly complex (IMHO) applications with ME3, running happily on about 350 PCs. I began several times to convert them to ME Pro as fixes to Pro were released, but each time I just ran into problem after problem after problem. Sorry to be a naysayer, my frustration is showing. ME3 has worked SO well that it was really a bummer to struggle with ME Pro. :(

×
×
  • Create New...