Jump to content
Macro Express Forums

Nicolas

Members
  • Posts

    54
  • Joined

  • Last visited

Nicolas's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I only see one solution : 1) create a small macro for ONE month with %T10% 2) see how it looks like in the "direct editor" window : you should see %T10% somewhere (or at several places) now you can dynamically create the same macro (as in step 2) in variable %T1% for any %Tx% by replacing all these %T10% by %T%N1%% for instance, where %N1% is incremented for every month, beginning with 10 ... you'll launch this dynamic macro with the Run Macro in Variable %T1% command schematically (sorry I don't have time to produce real ME code) : %N1%=10 loop on months set %T1% with your "template" in which %T10% is replaced with %T%N1%% run macro in variable %T1% increment %N1% end loop on months
  2. I had the same problem with Paint Shop Pro ... using the "window" menu, and depending on what I needed, I selected the cascade or tile command, or directly a window as the ten first windows are explicitely displayed in this menu it's even better if your application gives you access to a list of all your child windows, as in Visual C++ ... if you only want to manipulate all windows one by one, using the cascade command ensure you that all child windows will have the same size and position can be easily calculated (from one picture to the next one : X+n and Y+n) ... you can also try to use TEXT TYPE with : <CTRLD><TAB><TAB>...<TAB><TAB><CTRLU> or <CTRLD><SHIFTD><TAB><TAB>...<TAB><SHIFTU><CTRLU>
  3. I often have the same problem when filling Flash forms : using "Mouse Left Button Click" does not work, I have to use "Mouse Left Button Down" + small delay + "Mouse Left Button Up" I don't think there is any solution ...
  4. nice idea ! i'll keep it in mind
  5. could also Macro Express write C++ code for me (and comment it, please) ?
  6. Variable Set String %T1% "1024x768" Variable Set Integer %N99% from Position of Text in Variable %T1% Variable Modify Integer: Inc (%N99%) Variable Modify String: Copy Part of %T1% to %T2% Variable Modify String: Convert %T1% to integer %N1% Variable Modify String: Convert %T2% to integer %N2% Pause: Complex <TVAR2:01:01:1024x768><IVAR2:99:13:1:x><NMVAR:08:99:0:0000001:0:0000000><TMVAR2:10:02:01:N99:010:><TMVAR2:05:01:01:000:000:><TMVAR2:05:02:02:000:000:><PAUSE2:000531,000636dimensions are : %N1% x %N2%T>
  7. learn ? hummm ... I'm a software engineer / project manager ... I suppose it helps regarding my algorithm, it's really a pity to have to split a string in two substrings and re-append them when I simply want to replace ONE character with another one : a string being an array of characters, you can replace a character in constant time ! so it would be REALLY faster if we had a "replace character at position %N%" function (maybe it exists and I did not find it ?) ... I think it is the bottleneck in my algorithm (hum I'm not sure if I can say that in english) anyway ... thanks for the figures Randall ! it's really interesting to compare algorithms relative performances ! but we can't easily use a file because we can't replace a character in a file without reading all the string / splitting / writing all the string ... would be even longer
  8. if you want a list of random numbers between 1 and N and if %Tx% variables can accept strings of length N (I don't know if %Tx% variables have a maximum length ?) I suppose it would go faster to use something like that : 1) fill %T1% with N+1 characters "0" (or any other character) 2) %N1% = random value with max N 3) if %N1%th character in %T1% = "1", back to second step 4) set %N1%th character in %T1% to "1" 6) add %N1% to your list (or skip this step and parse %T1% at the end) 7) back to step 2 until you have the requested number of random values I suppose it should be faster to look at a given character in a string rather than using the "If Variable contain" command ... moreover, with this algorithm your random numbers are sorted with no extra time here is a code, quickly written (I'm sorry but it is 3:00 am ) ... to replace a character in a string, I cut it in two substrings (before and after the character to replace) : is there any better solution ? // %N3% random numbers with max %N4% // sorry but it's late so results are simply stored (sorted) in %T3% // ------ Variable Set Integer %N3% to 20 Variable Set Integer %N4% to 30 If Variable %N3% > variable %N4% Pause: Complex Macro Stop End If Variable Set String %T1% "" Repeat with Variable using %N4% Variable Modify String: Append "0" to %T1% Repeat End Variable Set String %T3% "non sorted list :" Repeat Until %N3% = 0 // %N1% is a random number between 1 and %N4% Variable Set Integer %N1% with a Random Number If Variable %N1% <> 0 Variable Modify String: Copy Part of %T1% to %T2% If Variable %T2% = "0" // %N1% is a new random number Variable Modify String: Append " %N1%" to %T3% // we replace the relevant character in %T1% from 0 to 1 Variable Modify Integer: Inc (%N1%) Variable Modify String: Copy Part of %T1% to %T2% Variable Modify Integer: Dec (%N1%) Variable Modify String: Delete Part of %T1% Variable Modify String: Append "1" to %T1% Variable Modify String: Append %T2% to %T1% // we continue until we found %N3% random values Variable Modify Integer: Dec (%N3%) End If End If Repeat End Pause: Complex // list of sorted random values in %T3% Variable Set String %T3% "sorted list :" Repeat with Variable using %N4% Variable Modify String: Copy Part of %T1% to %T2% If Variable %T2% = "1" Variable Modify String: Append " %N1%" to %T3% End If Repeat End Pause: Complex <REM2:%N3% random numbers with max %N4%><REM2:sorry but it's late so results are simply stored (sorted) in %T3%><REM2:------><IVAR2:03:01:20><IVAR2:04:01:30><REM2:><IFVAR2:5:03:4:N4><PAUSE2:Center,Centersorry but I cannot find %N3% different values between 1 and %N4%T><MSTOP><ENDIF><REM2:><TVAR2:01:01:><REP3:05:000001:000001:0004:0:01:><TMVAR2:07:01:00:000:000:0><ENDREP><REM2:><TVAR2:03:01:non sorted list :><REP3:08:000001:000002:0003:0:01:0><REM2:%N1% is a random number between 1 and %N4%><IVAR2:01:06:%N4%><IFVAR2:2:01:2:0><TMVAR2:10:02:01:N01:001:><IFVAR2:1:02:1:0><REM2:%N1% is a new random number ><TMVAR2:07:03:00:000:000: %N1%><REM2:we replace the relevant character in %T1% from 0 to 1><NMVAR:08:01:0:0000001:0:0000000><TMVAR2:10:02:01:N01:N04:><NMVAR:09:01:0:0000001:0:0000000><TMVAR2:11:01:00:N01:N04:><TMVAR2:07:01:00:000:000:1><TMVAR2:08:01:02:000:000:><REM2:we continue until we found %N3% random values><NMVAR:09:03:0:0000001:0:0000000><ENDIF><ENDIF><ENDREP><PAUSE2:Center,Center%T3%T><REM2:><REM2:list of sorted random values in %T3%><TVAR2:03:01:sorted list :><REP3:05:000001:000001:0004:1:01:><TMVAR2:10:02:01:N01:001:><IFVAR2:1:02:1:1><TMVAR2:07:03:00:000:000: %N1%><ENDIF><ENDREP><PAUSE2:Center,Center%T3%T> you have to change %N3% and %N4% with the values you want and this sample will take %N3% different random values between 1 and %N4%, and display them (first in the order they were found then sorted)
  9. I don't see anything really wrong in this code ... not really ... maybe you could try that : Text type ENTER variable set integer %N1% to 0 /* to be sure it won't go out of your loop at the second call */ Repeat until %n1% = 14215660 Get pixel: screen coords:423,379 into %N1% Delay 1 second /* it sometimes help to have the CPU slow down */ Repeat end Delay 1 second Text type TAB Text type ENTER, etc. and to be sure your window is always positionned at the same coordinates, do it yourself : Activate Window: "xxxxxxxxx" Window Reposition: Current Win - (Left: 0, Top: 0) Window Resize: Current Win - (Width: 1000, Height: 720) last thing : if you're using your macro on two different PCs, colors can have different values ...
  10. if you want to follow links, maybe you could display the source code of the Internet page you're processing, copy everything in the clipboard, look at the relevant HTML tags, copy links in a file and process these links of course you can't use Google highlight colors in this case (source code is plain text), but it could give you some good ideas
  11. I had the same problem a few months ago with StopZilla (a popup killer) : the previous version was ok but this new one considered MacroExpress as a spyware or something like that and automatically killed it !! nobody from StopZill never answered my questions (how could I specify that this prog is ok) so I had to choose between an excellent popup killer and Macro Express : I installed the Google toolbar
  12. if this month has to be selected in a drop down box, I would rather convert this month into an integer (let's say %N1%), focus on this drop down box and do something like that : Repeat with Variable using %N1% Text Type: <ARROW DOWN> Repeat End to have the focus on your drop down box, you could click somewhere in the webpage and Text Type <TAB>
  13. you're supposed to write something like that : If Clipboard Text Equals "xxxxx" <do something> Else <do something else> End If (or If Clipboard Contains "xxxx")
  14. I sometimes compile C++ exe files to have them launched by Macro Express macros, but I would never have thought to dynamically generate VBScript files or HTML files that will dynamically generate MXE files ... ... that's GREAT !!! I will probably never use your samples "as is", but they are definitely full of small tips and ideas to create our own (powerful) macros ... many thanks !!
  15. the problem is that sometimes you don't have any error page loaded in IE ... your page is simply loading ... loading ... loading ... and when the "Wait For Web Page" maximum time is reached, it raises an error (and stops your macro) ! maybe one day we'll have an option such as "stop loading when max time reached", or at least "continue" so that you can check by yourself if it finished because the page is loaded or because the max time is exceeded for now, it seems that the better way to handle this kind of situation is to create your own "wait for web page"-like macro ! this point has already been discussed here : http://pgmacros.com/community/index.php?showtopic=139 ... where you should find some ideas
×
×
  • Create New...