Jump to content
Macro Express Forums

PotterHarry

Members
  • Posts

    76
  • Joined

  • Last visited

Everything posted by PotterHarry

  1. Chris, I examined my macro for the spurious spaces, and was surprised to find many more than perhaps could be attributed to mere carelessness. This is the reason why: The extra copies created during a save appear on the variable list as "SPACE%PIXEL%". Whilst attempting to make the macro work, I had selected some of these self-defined variables from the list and edited out the extra inverted commas, but failed to notice the space still remained after back spacing... So the variable % %PIXEL%% ended up with an extra space in front. This is probably a red herring, but I was doing fine with a large and complex macro, all of which seemed to function fine until I introduced variable save and variable restore before and after each sub-macro. May just be coincidence. I accept fully that it was my failure to read the user guide that was the cause of my problems!
  2. Thanks lemming, Yes I have discovered that it is easier to just disable the line of code, delete all offending variables, and then redefine the variables from scratch. Trying to redefine from within existing code just doesn't work. "Part of the problem is that you have defined many of your variables twice, e.g. PIXEL and %PIXEL%" Ah, I think what is happening here is that at runtime MEP is producing spurious variables. I can check the list of variables and I have not defined them twice, and then run the macro, and some extra ones appear - the ones with the same name but with %%! I think this is what's happening.. I have now successfully got the macros to work. Thanks for all your help.
  3. Thanks Cory and Paul. I have attached a segment of my macro which demonstrates that it fails on line 8, where I am attempting to define the initial value. I get the feeling I have missed something major, here. I had the project up and running almost, and now I'm struggling to define a variable! I abandoned the N variables and tried to use %meaningfulnames% instead, but I still can't get it working. Thanks for your advice.
  4. Hi there... I am chasing my tail on this one. At run time I am getting the error "Undefined variable or the variable is of the wrong type. %N72% Line 34" The line is Variable set integer %N72% to 0. This is happening in a macro called by the main macro. In order to work out what was happening I created a very simplistic macro with the same structure as the original. In the test macro I can freely add/remove/assign variables and I don't get this error. I have added the lines save variables and restore variables before and after the sub-macro. It still works although more slowly... Okay, In my original problematic macro, I cannot define N72 in the main macro. I double click on Variable Set Integer, Select variables (destination), Add, (type is set to integer) Variable name: N72. I see in bold: A variable name already exists or has invalid characters. So, If I open the list of variables there's a list of a dozen or so existing variables in there, none of which are N72. Why is this happening?
  5. Hello experts. Would it be possible to assist me with this, please. I have some variables where I need to strip out the commas. For example 29,223 1,300 have to be input as 29223 1300 How can I solve this one?
  6. I have achieved this by using: Mouse Move Screen Mouse Left Button Down Mouse Move Position (Relative to the last position) Mouse Left Button UP Clipboard copy. Then assign contents of the clipboard to another variable. This would work if your rows of numbers appear in a fixed place on the screen. In your exmple there is a row of numbers with a stray '1' That would mess things up somewhat. Amazingly I was looking on the forum for a solution to a problem I have, and your question, top of the list, was on the same topic! I have obtained a clipboard variable using the method I described, and I want to remove the alpha characters nd, rd, th from 3rd 4th 5th etc. Will be very interested in your answers!
  7. I meant to say macro return ... sorry! I took your advice and divided all the sub-macros into less complex units, and I found the culprit. It was a repeat exit that shouldn't have been there! Thanks for your help.
  8. Thanks, rberq. It didn't but now it does! I have put Macro Stop commands at the end of all the sub-macros. Problem persists. I know the culprit - it is some lines within macro "web". I am selectively disabling lines within it, and it runs with blocks of lines disabled. An odd thing happens. As the macro is running, I see macro express maximised, and then ME closes down, locking the XP desktop. ME disappears from the taskbar, and I have to re-launch it.
  9. Hi there, I am running a macro which opens a web page and scans for certain colours, which will prompt actions further down the macro. I wanted to test this by leaving it running all day, and getting it to check the page every ten minutes or so. I set up a repeat, until loop. Within this section there is a Run Macro "Web". It won't work. It runs through it once and then stops. I substituted Run Macro "Web" with Run Macro "Beep" (A short macro which beeps to indicate it has occured), and that works fine every time. I checked to make sure I am not using the same conflicting variables, and I am wondering... the Web Macro in turn calls other short macros. Is there a possibility that this is the reason for its failure? Thank you.
  10. Thanks again, that was right on the mark. It works very elegantly. There is no colour change on hover, no the reason I couldn't test one set pixel, was the web site operator for some reason changes the width of the tables. Even as I prepared the original macro, I found that next day the macro was sampling the next column, so this was my idea to scan across several narrow columns and hopefully could not miss the pixel colour event. I have copied my corrected code here for anyone facing the same dilemma. rberq your answer was very easy to follow, most grateful. Mouse Move Screen 503, 699 Variable Set Integer %N12% to 0 Variable Set Decimal %D1% to 0 Repeat Until %D1% = 100 Get Pixel: Under Mouse into %N1% If Variable %N1% = 7143674 Variable Modify Integer: %N12% = %N12% + 1 End If Variable Modify Decimal: %D1% = %D1% + 1 Get Mouse Position Screen: %N2%, %N4% Variable Modify Integer: %N2% = %N2% - 1 Mouse Move Screen %N2%, %N4% Repeat End HERE I AM INCREMENTING ANOTHER VARIABLE IN CASE RED OCCURS MORE THAN ONCE IN THE PASS: If Variable %N12% > 0 Variable Modify Integer: %N51% = %N51% + 1 End If
  11. Hi, I have read some of the forum questions with similar issues, but I admit I cannot understand the solution. PLEASE help! I am placing the mouse pointer at the end of a series of web page panels. The word YES and NO appear in Red or Black, and I want to use Get Pixel Under Mouse to detect either answer. So, the pointer starts at 496,724 and then travels left. I can detect red, but I cannot limit how far the mouse goes along looking for red. How do I exit the loop when red is not detected? I tried to get it limited with D1 variable, but this does not work? Mouse Move Screen 496, 724 Variable Set Integer %N12% to 0 Variable Set Decimal %D1% to 0 Repeat Until %D1% = 100 Get Pixel: Under Mouse into %N1% If Variable %T1% = "7143674" Variable Modify Integer: %N12% = %N12% + 1 Variable Modify Decimal: %D1% = %D1% + 1 End If Get Mouse Position Screen: %N2%, %N4% Variable Modify Integer: %N2% = %N2% - 1 Mouse Move Screen %N2%, %N4% Repeat End If Variable %N12% > 0 Variable Modify Integer: %N51% = %N51% + 1 End If Repeat Exit Launch and Activate: "notepad.exe" Text Type: %N12% %N51% Delay 1 Seconds Window Close: Current Window
  12. It worked! ... eventually. Thanks a hell of a lot. I had to left click down, drag and then left click up to enable me to copy to clipboard. I had a major problem because I dragged too far on one of the characters and introduced a spurious blank character. This is most of the script for anyone who may wish to simplify bank login. I have substituted x's in order to preserve my millions. // Get Character 3 from login screen ...... // Input the second number Macro Run: WAIT UNTIL xx IS OPEN Mouse Move Screen 510, 580 Mouse Left Button Down Mouse Move Screen 519, 586 Delay 0.5 Seconds Mouse Left Button Up Clipboard Copy Variable Set String %T1% from Clipboard Mouse Move Screen 623, 579 Mouse Left Button Down Mouse Move Screen 632, 585 Delay 0.5 Seconds Mouse Left Button Up Clipboard Copy Variable Set String %T2% from Clipboard Mouse Move Screen 739, 580 Mouse Left Button Down Mouse Move Screen 748, 586 Delay 0.5 Seconds Mouse Left Button Up Clipboard Copy Variable Set String %T3% from Clipboard Mouse Move Screen 18, 200 Delay 1 Seconds Get Pixel: Under Mouse into %N90% Mouse Left Button Double Click Mouse Move Screen 667, 558 Mouse Left Button Double Click Mouse Move Screen 434, 557 Mouse Left Button Click If Variable %T1% = "1" Text Type: x End If If Variable %T1% = "2" Text Type: x End If If Variable %T1% = "3" Text Type: x End If If Variable %T1% = "4" Text Type: x End If If Variable %T1% = "5" Text Type: x End If If Variable %T1% = "6" Text Type: x End If Mouse Move Screen 550, 557 Mouse Left Button Click Mouse Left Button Click If Variable %T2% = "1" Text Type: x End If If Variable %T2% = "2" Text Type: x End If If Variable %T2% = "3" etc.
  13. Alan, thanks for your reply. Yes I have tried to drag and copy the digits into notepad, and it does work. Will have a go at your suggestion (thanks for the code - It will be very helpful). Will post back with the outcome...Many thanks.
  14. I wish to have part of my macro open a web page and login to a site (a banking account) where there are three boxes into which you have to input three characters from your password. I can work out how to do that, but the challenging bit is to get the macro to read off the screen the desired numbers of the random letters. For example just now it is asking for Character 6: character 5: character 2. What would be the most economical way of doing this? How would I get the 6,5 and 2 into my variables?
  15. I have worked this one out. The macro will work correctly if I use mouse clicks on start - windows shortcuts (or desk-top icon), but if i try to get ME to start the program directly using launch.exe in program files, the problem behaviour persists. Dont know why, but at least I have a work-around!
  16. Hi I am trying to create a macro to use with ArtMaster. I open the program, load an image, and select studio. If I do this manually I get a menu of artwizards to left of screen, but when ME does this the menu is absent? Any ideas please. I have tried activating Artmaster within the code, I have experimented with adding delays. If I quit out of ME, the menu is not available (via studio button) until I close AM and restart it again manually. Thanx
  17. Thanks Pete, I like the suggestion: test that the mouse is as expected before any clicks, else abort... I have used pixel colour with some success, but when things go wrong the effects are quite random as you can probably imagine, so it would be hard to define colours in advance. I Will try the mouse pointer thing, and thanks for your help... Ian.
  18. This is just a thought, and I have no idea how to implement it. I am running a ME macro in Photoshop. Its quite a complex macro with lots of mouse clicks all over the screen. I am not able to abort the macro using the key press method (I am not sure why), and because the mouse is under the control of the macro it is difficult (no its nearly impossible) to right click on the little black running man in the tray. When the photoshop actions go astray for whatever reason there are always a series of audible error sounds. It would be nice if the macro could detect them and then right click on the little guy for me, and so abort the macro. There may be another more obvious method, but do you have any ideas? Scoll lock/pause doesnt work. If this could be made to work it would also usefully abort the macro if it goes astray when I leave it running unattended. Thanx.
  19. Thanks Kevin, <ALTD>f<ALTU> worked and it greatly improves things. Appreciate the prompt reply. P
  20. How is it possible to get a macro to highlight the FILE section in a window. IF I try to do it by text/enter (Using ALT) it does not work. I can of course make the mouse point to it and click, but why dont the keyboard shortcuts work. Is there a workaround. I have the macro set to global.Thanks.
  21. I figured out myself using one of the free downloads from ME as a template. Thanks anyway ...
  22. Hi people. Im new and somewhat ignorant of programming. Imagine a 26 line macro, for example labelled A to Z, different letters at the start of each line.... How do I start the macro at A with an assigned variable N1, and then let it run to Z where you increment N1 by 1, and then loop back to line B until N1 is say 30 where it quits? Is there an equivalant of the basic command goto? Thanks for your time ...
  23. Thanks joe and jason, I was unaware of either of those options. I dont know if it is possible, but the option to search in the script would be handy too...
×
×
  • Create New...