Jump to content
Macro Express Forums

Cory

Members
  • Posts

    4,207
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by Cory

  1. From time to time I open a dialog box and want to make sure a certain box is checked as part of my process. But one can’t blindly click on it because one doesn’t know what the existing state is. With the control commands one can get the text of a control which is something I often do but this doesn’t work for check boxes. I suspect there isn’t a way short of ‘get pixel color or something to do what I want but I thought I would ask in case I’m missing something. So far I’ve been able to check if another control is enabled or not and when that doesn’t work I try and find where the state is stored in the registry but it would be easier if I could somehow get the state from the control. Not only that but sometimes registry values are mystifying.
  2. I took a drag off my cup-o-joe and decided to have another look at your HTA this morning because I really would like to have this capability. I retraced my steps and found where I went afoul last time. Even though HTA is basically an HTML file associated with a different application your example is not a simple HTML form, it’s all VBScript. I am not a VB programmer so this is beyond my scope. I can follow it a little but it’s been decades since I’ve done any real programming and I know if I ever tried to fake it to make my own version I’d make some syntactical error someplace and would be stuck until I learned to program VBScript. One of these days I’ll lean VBScript and VB but for the moment it’s the deep end of the pool for me.
  3. Cory

    HELP

    You can use Get Pixel Color and put it in a loop that check that pixel every 500mS or whatever you like. But usually I can avoid that but using a control, weindow contents, mouse cursors, and so on. What is it you're trying to do? Maybe we can give you a better idea.
  4. You know what? I just did an experiment. One can simply paste the text in using the direct editor! Brilliant! I knew that thing would come in handy one of these days.
  5. That HTA thing ticks me off! I dorked and dorked with that and could never get one of my own to work and I REALLY would like a multi-field input capability. I finally had to give up due to time constraints and sanity levels. Maybe if Joe is interested in helping me I should take another crack at it. Now where was I? Oh yeah… The HTA is exactly the kind of thing I was thinking of in terms of storing a file. Mainly I wanted to check to see that I wasn’t missing something. Generally I think the CRLF is the best way to approach the problem especially since most of my macros start with my CRLF/TAB subroutine as I use them constantly. But in the case of an INI file I like the idea building it because it would then be easier to tweak later. I feel a feature request coming on… Embed File command.
  6. Is there a way to embed a file contents into ME easily? I’m developing a macro that relies on a couple of INI files with 50 or so entries each. For deployment to several sites it might be easier if I could have the contents of this file embedded in the macro. Something like T1=abunchoftext so that I could take T1 and write it to a file. But of course I can’t paste this in to a Set Text Variable since it has CRLF’s. My tack now is ot set a var for CRLF and paste that in to the set var command using the var. But that’s not very elegant. I could create the INI file and write code to create each entry in a sense building the INI from scratch but that seems laborious as well. Maybe I couldbypass the limitation of the input dialog box by using the direct editor. Is there an easier way to get a chunk of data into ME so that I could use it to create a file later?
  7. That doesn't sound right. I do stuff likethis all the time and don't have teh problem. Could you post an example with a small sample macro for me to debug? Thoughts: You dont' have worksheets but rather multiple 'views' open of the same spreadsheet. Or you have an =sheet1!A1 kind of formula. But I think you're clever enough to recognize these problems.
  8. http://blogs.msdn.com/ie/attachment/715071.ashx I came across this handy list of keyboard shortcuts for IE7 and thought you all might like to check it out. I was mainly interested in the shortcuts relevant to new features like the tabs and search but all the old ones are here too.
  9. I use the Set Integer to position of text in variable. Then add an offset to that number and the use the Copy Part of Text. So in your example I would get the position of “Objects” in the var, N1, then add 8 to get to the first X. Then Copy part of text T1 to T2 from position N1 and take 3 characters.
  10. I’m not sure of your question but I think you’re concerned about how to repeat a failed item. If you’re using ASCII Repeat you can embed a repeat within the loop. Let’s say 5 tries and after the fifth try have it log an error instead and move on. If it succeeds have it to a Break from the inner loop. Simple!
  11. I have not tried disabling the cache but I’m willing to try. However since I can’t get reproducibility I can’t test it. My main thing now is that I want to set some traps so when it does happen again I can gather some meaningful information to see what’s going wrong. For instance if the desired control pops up in front of me and ME errors out erroneously telling me that the control didn’t appear in the time specified time I can figure out why it’s not seeing what is obviously the desired control. In this case I can use WinID to get the HWND (Handle) of the visible control and if by some magic I could view the handle cache in ME’s brain I could tell if there’s a difference. Obviously there must be and we can figure out why. You see this is the way my brain works when troubleshooting. Understand how something works and evaluate all the relevant data and see where it’s getting it wrong. The problem in the computer world is that most of the time we’re not given the complete story on how something works and definitely not given the tools to collect the data. The reason of course is that the Engineers should be doing this, not the users, but the problem in cases like these is that the user can’t demonstrate the failure the Engineer has nothing to chew on.
  12. That could possibly work. I could set the action to always open the file folder for instance and when it sees a window title with "e:\" in the title. But that's a problem in Vista because Windows Explorer windows don't have titles anymore. It just seemed that the most elegant solution was ot create an even like OmniPage did.
  13. In cases like these I've had some success by polling the page contents. I use the IE command to wait for the page to load but if the page that loads is not the correct page or a 404 what does one do? Generally I do a CTRL+A to get all the text and make some sort of evaluation. EG if the page fails to display add an If T1 contains “Error: 404” the I know the load failed and to run the iteration again. Also you can use this to validate that the correct page has loaded. For instance I once harvested a Yahoo Group by visiting a URL in the form of http://blah.com/blah/messageID=12345 so 12345 was the variable and when the page loaded I grabbed the web page text (actually by using the View Source in IE) and evaluated it to see if the little line of text at the bottom of the message said “Message number: 12345” (Message number: %T1%) or whatever it was. If for whatever reason it failed it would launch the message ID again and again until it got it right. Then you can add code that would send you an email about the error if it failed a set number of times and went on to the next one. And of course log the error to a file. This eliminated many varied errors for me and I often find this approach very useful.
  14. At the moment I can’t think of any way to make this rear its ugly head so I’m stumped. So my tactic now is to go back to my macros and redo them and wait for it to fail again. My question is if it does fail what can I do to figure out what’s going on? I found an application called WinID that will give me the handles but that wouldn’t tell me what ME thinks the handle is or should be. Is there any way I can peek under the veil?
  15. I wrote a quick test macro that opened and close a few dialog boxes as quick as can be with 8 controls in a loop and let it run 93 times in IrfanView. These boxes were the same ones I was having trouble with before. It never failed. I can't figure it out. Even when it was failing before I would copy the control commands to another macro and they would work. And the failures happened in as few as 20 itterations. I don't know what to try next. Hmmm....
  16. While developing a couple of macros recently that use controls I’ve seen some odd behavior. An example might be a macro that one minute works with a certain control stops working like a Wait for Control that times out when the button is clearly visible to the user. Or a command to click on a control that fails because the apparently visible control can’t be found by ME. I have suspicions that it might be isolated to Vista but I haven’t been able to nail down the reproducibility to do any meaningful tests. I’ve tried several things but there doesn’t seem to be any pattern yet and things come and go in odd ways. I should have a little more time to play with this in the next couple of days but I thought I would just toss the question out there to see if anyone has noticed any problems using controls and if so what OS are they running. At this point my gut gives me about a 75% chance that it’s something I’m doing and not a bug but if no one else seems to be having problems then I can focus my efforts on possible user error causes.
  17. But Kevin, isn’t it a limitation of Windows 9X and not a limitation of ME?
  18. So did you have a question? I didn’t see any stated but let me take a stab at what you might be asking since I’m guessing you’re not just here to complain. There is no 64k limit of ME with regards to the Windows Clipboard. I routinely copy huge amounts of data to the clipboard and into vars in ME from a large variety of apps and I have never had a problem. To check I just created a 128KB notepad file of random text, copied it to the clipboard, copied the clipboard to a text var and wrote that text var to a file and it all came out intact. There must be something else wrong with your system. But you piqued my interest so I looked online and I could find no documented limit to the clipboard. But I am pretty sure in Windows 3.1 there was a 32 or 64KB limit. But I don’t think ME will even run in 3.1. What version of Windows are you using. The only thing I could find were physical memory limits. That is your clipboard size is limited to the amount of available physical memory. So if you only have 64K worth of RAM left that’s your limit. How are your system resources? I did see some posts from folks on the Usenet where they were seeing a limit but it had something to do with the program they were copying from, not the Windows clipboard. You might try reproducing my steps above and see if things work the same for you. In either case if you could give us the steps you took to come to this conclusion in detail I would be happy to try and reproduce it on my system to help you TS. Make sure to tell us what applications are involved, what OS, version of ME and all relevant info. And if we can't help you then it might be time to start a support incident with ISS. In any case I can tell you without a doubt ME does handle clipboards larger than 64KB.
  19. Cory

    work in

    Not really. Al least I don't think for what you want to do. Think of it this way... ME just types the keyboard and takes actions on your behalf. So or the same reason you can’t type simultaneously in Excel and Word ME can’t operate in two apps at the same time. But one can interact directly with controls and switch quickly between apps. For instance I can have a macro that waits for control C1 in a minimized application that will take some data from it without changing the minimized state, go to a minimized version of Calculator, do some calculations and push the results back to a control but I don’t think that will work for your game. However you might be able to have it sit and monitor for something then quickly switch to the game, do something, and switch focus back to what you were working on. I have some apps like this for clients that wait for files to exist then take action. But they warn the user by making an alarm sound so they know to stop typing for a second while the macro asks some questions.
  20. You can now download the old attachments without having ot rename them.
  21. I had bad timing and my post didn't migrate so I'm reposting... OK, I’m being lazy in asking but I don’t have time right now to spend hours researching this because of the 'needle in a haystack' problem googling. So hopefully one of you have some experience with this and can at least send me in the right direction. In Windows when using devices like scanners, cameras, and flash drives there are associated ‘events’. For instance if you push a button on the front of the scanner it might launch OmniPage and jump to the scan interface. Or if you plug in your camera or flash drive the OS will automatically dump your files to the My Pictures folder. In fact usually it will confront you with some options the first time you connect. So far, so good. But the options are predefined and often created by a program’s install app. So how does one define these? What I would like to do is add an event that will run a macro. Does anyone have any experience with this?
  22. Rusty you might consider using the "Wait for Window Title to Lose Focus" command. I used to worry a lot about speed and timing but eventually I learned that the better way was to use smart controls. This way the macro always runs as fast as it can and I don’t have to constantly tweak it for every machine. Things like waiting for a file to exist and then file to be ready. Controls are often a really good way as well. You see many time when you click a button and the program goes away to think about it some of the controls are inactivated until the program is ready to accept input. Also if you need to mouse click on a control in a popup dialog box and already have the control variable defined it works well to simply Wait for Control. This is often better than Wait for Window Title because sometimes the window will appear but not be ready yet. Also look at status bars which are usually controls. Often they will tell you something like “Loading…” and then change to “Ready” when the program is done. Wait for Mouse cursor is awesome too. Most programs will make the cursor ‘hour glass’ until it’s ready again. Anyway my 2¢ is to spend your time finding smart ways to control timing instead of tweaking speed settings. Sometimes it's inevitible but in my experiance it's only 1 time in 100 that I need to inject a dumb delay and I've never had to use the playback speed control. IMHO you will be a lot better off in the end without them. I know when you're just using a recorded macro you might not be into the scripting editor too much but if you’re getting to this stage of your macro writing you might consider writing your macros directly instead of using the recorder. The recorder is like bicycle training wheels. It’s good for driving up and down the driveway and getting your feet wet but you’ll never go fast (or corner) until you take them off. In fact just like training wheels they can be counterproductive at a certain point.
×
×
  • Create New...