Jump to content
Macro Express Forums

terrypin

Members
  • Posts

    2,232
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by terrypin

  1. I think you will need to make a few modifications to your macro to get reliable operation. Here is my version: [color="#0000FF"]// This macro will run at random intervals, set by N1 Keystroke Speed: 10 Milliseconds Mouse Speed: 1 Milliseconds // This is where you would insert commands for your macro // My example is the following trivial one // Activate NotePad (already running) Activate Window: "Untitled - Notepad" Wait For Window Title: "Untitled - Notepad" Text Box Display: Your macro is running // Record current position of mouse, in case it's important to return it Get Mouse Position Screen: %N1%, %N2% Delay 100 Milliseconds // Open MX Editor by clicking its System Tray icon Move Mouse to Tray Icon: "Macro Express" Delay 100 Milliseconds Mouse Left Button Click Delay 100 Milliseconds // Return mouse Mouse Move Screen %N1%, %N2% // Get a random number between 1 and 100 (choose your own) which will be the interval before next run Variable Set Integer %N1% with a Random Number Wait For Window Title: "Macro Express - Macro Explorer" // Ensure Macro Explorer is displaying ALL macros (not just the last category you displayed). Text Type: <HOME><TAB> // Deselect the top macro automatically selected // Otherwise that one, which is quite likely to be the one you want to find, especially during experiments, // will be missed by the Find - which apparently ignores the starting position! // The only way I can think of to do this is to click the top entry, based on its position // To keep it simple I've assumed MX will be consistently sized and positioned the way I happen to have it at present // It should be straightforward to add code to ensure this before this part of the macro was run Mouse Move Screen 1314, 120 Text Type: <CTRLD> Delay 100 Milliseconds Mouse Left Button Click Delay 200 Milliseconds Text Type: <CTRLU> Delay 200 Milliseconds Text Type: <ALT>mh Delay 200 Milliseconds Wait For Window Title: "Find" Text Type: Run at random intervals Delay 100 Milliseconds // Open Scripting Editor for 'Run at random intervals' Text Type: <ENTER><ESC><ENTER> Wait For Window Title: "Scripting Editor" // Open its Properties Text Type: <SHIFT><TAB><ARROW RIGHT> Delay 100 Milliseconds Text Type: <ENTER> Delay 100 Milliseconds // Tab 9 times to reach te Schedule button // Note: this should already be checked Text Type: <TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB> // Open the Schedule dialog // 'Other' and 'Play Macro Indefinitely' should already be specified as checked. Text Type: <ENTER> Delay 100 Milliseconds Wait For Window Title: "Set Schedule" // Navigate to the 'Every' box and enter the random number of minutes Text Type: <TAB><TAB> Delay 100 Milliseconds Text Type: %N1% Delay 100 Milliseconds // Navigate to the 'OK' box and close Text Type: <TAB><TAB> Delay 100 Milliseconds Text Type: <ENTER> Delay 100 Milliseconds // Save the macro with its new setting, so that it will restart in N1 minutes Text Type: <CONTROL>s Delay 100 Milliseconds Restart Macro Express[/color] And here is the code <REM2:This macro will run at random intervals, set by N1><SPKEY:0010><SPMSE:00001><REM2:This is where you would insert commands for your macro><REM2:My example is the following trivial one><REM2:Activate NotePad (already running)><ACTIVATE2:Untitled - Notepad><WAITWIN2:000010:000000:Untitled - Notepad><TBOX4:T:4:CenterCenter000278000200:005:Your macro is runningDid you take a break since this message last time? ><REM2:Record current position of mouse, in case it's important to return it><MOUSEPOS:T:01:02><MSD:100><REM2:Open MX Editor by clicking its System Tray icon><MOVETOTRAY:Macro ExpressT:F:0:0><MSD:100><LCLK><MSD:100><REM2:Return mouse><MMS2:1N,2N><REM2:Get a random number between 1 and 100 (choose your own) which will be the interval before next run><IVAR2:01:06:3><WAITWIN2:000010:000000:Macro Express - Macro Explorer><REM2:Ensure Macro Explorer is displaying ALL macros (not just the last category you displayed).><TEXTTYPE:<HOME><TAB>><REM2:Deselect the top macro automatically selected><REM2:Otherwise that one, which is quite likely to be the one you want to find, especially during experiments,><REM2:will be missed by the Find - which apparently ignores the starting position!><REM2:The only way I can think of to do this is to click the top entry, based on its position><REM2:To keep it simple I've assumed MX will be consistently sized and positioned the way I happen to have it at present><REM2:It should be straightforward to add code to ensure this before this part of the macro was run><MMS2:1314,120><TEXTTYPE:<CTRLD>><MSD:100><LCLK><MSD:200><TEXTTYPE:<CTRLU>><MSD:200><TEXTTYPE:<ALT>mh><MSD:200><WAITWIN2:000010:000000:Find><TEXTTYPE:Run at random intervals><MSD:100><REM2:Open Scripting Editor for 'Run at random intervals'><TEXTTYPE:<ENTER><ESC><ENTER>><WAITWIN2:000010:000000:Scripting Editor><REM2:Open its Properties><TEXTTYPE:<SHIFT><TAB><ARROW RIGHT>><MSD:100><TEXTTYPE:<ENTER>><MSD:100><REM2:Tab 9 times to reach te Schedule button><REM2:Note: this should already be checked><TEXTTYPE:<TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB>><REM2:Open the Schedule dialog><REM2:'Other' and 'Play Macro Indefinitely' should already be specified as checked.><TEXTTYPE:<ENTER>><MSD:100><WAITWIN2:000010:000000:Set Schedule><REM2:Navigate to the 'Every' box and enter the random number of minutes><TEXTTYPE:<TAB><TAB>><MSD:100><TEXTTYPE:%N1%><MSD:100><REM2:Navigate to the 'OK' box and close><TEXTTYPE:<TAB><TAB>><MSD:100><TEXTTYPE:<ENTER>><MSD:100><REM2:Save the macro with its new setting, so that it will restart in N1 minutes><TEXTTYPE:<CONTROL>s><MSD:100><RESTARTMACEXP:FT> ymnav: Note that during testing I set N1 to a max of 3 minutes, not 100, so remember to change it to whatever you want. Also, while I was composing this, the macro ran OK automatically a few times but just now gave an error because I had not excluded the possibility of a zero interval. So add the following directly after the random variable command: // Ensure N1 is never 0 Variable Modify Integer: %N1% = %N1% + 1 Scasper: Re my previous post about the tray icon not working here, it all now seems OK. I think it may have been because of the Scroll Lock key being on, although that might be coincidence. Thanks a bunch for introducing me to the Move Mouse to Tray Icon command, which should prove very handy! -- Terry, East Grinstead, UK
  2. Scasper, I was interested in your macro approach which uses a command I've never used myself before, Move Mouse to Tray Icon: "Macro Express". But I'm getting very erratic results with it. I had it working inconsistently for a while earlier, but now I've tried a dozen times in succession and get 'The system tray icon, "Macro Express", could not be located' every time. After that I noticed that r-clicking the MX system tray icon no longer displayed a menu. So I closed MX via XP Task Manager and re-started it. Now I have the r-click menu back, but the macro still fails with that message. Also, while the message is displayed, I note that the system tray icon has disappeared and a minimised tab for tne MX macro has appeared in my taskbar. When I abort the macro, the sys tray icon returns. Any ideas on what might be happening here please? -- Terry, East Grinstead, UK
  3. This has had me puzzled for a while so I wonder if someone can explain it please. As part of another exercise, I'm experimenting with the following very trivial macro, which simply activates Notepad, maximises it, and pops up a message. // Activate NotePad (already running) Activate Window: "Notepad" Wait For Window Title: "Notepad" Window Maximize: "Notepad" Text Box Display: Macro Return The actual code is: <REM2:Activate NotePad (already running)><ACTIVATE2:Notepad><WAITWIN2:000010:000000:Notepad><WMAX:Notepad><TBOX4:T:4:CenterCenter000278000200:005:Notepad has been opened and maximised><MRETURN> Note how I've entered just the partial name 'Notepad', not the full name 'Untitled - Notepad'. Now, if I run that from the script editor it fails to work properly. The message pops up OK, but Notepad has not been maximised. Yet if I change that command to Window Maximize: "Untitled - Notepad" it does work correctly. And if I activate from a hotkey instead of from the Scripting editor, either version works fine. Is there some obscure/undocumented issue at work here please? -- Terry, East Grinstead, UK
  4. Why use Get Pixel? In fact, I don't see how you could do it by that method. As I understand it, you want to copy a rectangular section of the screen and make that a new image in Paint, yes? So why not do it as you would do it manually, namely 1. Capture to clipboard with a screen capture program (or the Prt Scr key) 2. Open Paint 3. Paste. Use the known co-ordinates of the target rectangle with Mouse Move and dragging commands to specify it before your capture, if using aprogram like Snagit. Or do that afterwards in Paint if you've captured the whole screen with Prt Scr, and paste that extract to a new file. -- Terry, East Grinstead, UK
  5. I've successfully used the Mouse Left Button Down/Up commands before in various ways, but I'm stumped as to why this present little macro doesn't work. I'm simply trying to drag an entry in a list from one place to another, with familiar code like this: Mouse Move Screen %N3%, %N4% Delay 200 Milliseconds Mouse Left Button Down Delay 200 Milliseconds Mouse Move Screen %N1%, %N2% Delay 100 Milliseconds Mouse Left Button Up Delay 300 Milliseconds But it acts as if the mouse button has just been clicked, not kept down, so no dragging occurs. Maybe it's a quirk of the application itself, so if anyone has Google Earth and likes a puzzle... (Just try to drag an item in My Places.) -- Terry, East Grinstead, UK
  6. OK, thanks Stan, got it. I'd suspected that was the order, but it didn't seem to match what I saw. But prompted by your post I've checked an example more methodically and it does indeed square with date of creation. What had thrown me was that I have a fair number of macros scoped to several programs and windows. Viewed in scope order and searching for a specific application, I didn't see some of these until I widened the window and scope column. It's a neat tool, but pity it can't be hacked to alphabetic. -- Terry, East Grinstead, UK
  7. Thanks but I think perhaps you misunderstood? I'm talking about the system macro, "...the built-in Menu of Macros for Topmost Window", which is invoked by Ctl+Shift+Alt+z. Its menu is apparently built automatically, so it's not accessible in Macro Explorer as your solution seems to imply. As far as I can see its sequence seems fixed and follows no logic I can detect! -- Terry, East Grinstead, UK
  8. There are several sites that will display your 'internet IP' (as opposed to your 'computer IP', which is what the MX command Get IP delivers). For example: http://www.lawrencegoetz.com/programs/ipinfo/ http://www.computerhope.com/cgi-bin/systeminfo.cgi http://www.ipchicken.com/ http://www.liveipmap.com/ Using that last one you can get your IP into T99 with this short macro, and it doesn't appear to create a CR/LF in T99: // Get internet IP Web Site: [url="http://www.liveipmap.com/"]http://www.liveipmap.com/[/url] [Default Browser] Delay 2 Seconds Text Type: <TAB><TAB><TAB> Delay 100 Milliseconds Text Type: <CONTROL>c Variable Set String %T99% from Clipboard Delay 100 Milliseconds Text Box Display: Result Macro Return If you want to use your existing code, try adding the command Variable Modify String > Strip CR/LF for T99 -- Terry, East Grinstead, UK
  9. From Help: "This command will find the IP (Internet Protocol) address of the computer running the macro and save this address to a Text String variable" That sounds like exactly what it did, yes? What are you trying to do? -- Terry, East Grinstead, UK
  10. Why do you keep opening new threads? -- Terry, East Grinstead, UK
  11. That's odd, it was working fine here. Your example would just need the 6 tags editing. Maybe there was some corruption during my cutting/pasting, or I screwed up the post somehow. Hope you manage to get it working. I'm packing in for the night here, but may have some time to look at it again tomorrow. -- Terry, East Grinstead, UK
  12. The following is probably not the most elegant solution but it does the job: // Add tags to 3 lines (for pepperpod) Text Box Display: Opening message Variable Set String %T1% from Clipboard // Set a variable for a CR (EOL) Variable Set %T2% to ASCII Char of 13 // Set variables for the 6 tags needed Variable Set String %T21% "[LINE1TAG1]" Variable Set String %T22% "[\LINE1TAG]" Variable Set String %T23% "[LINE2TAG]" Variable Set String %T24% "[\LINE2TAG]" Variable Set String %T25% "[LINE3TAG]" Variable Set String %T26% "[\LINE3TAG]" // Create Line 1 in T4 Variable Set String %T3% "" Variable Set Integer %N1% to 1 Variable Set String %T4% "" Repeat Until %T3% = %T2% Variable Modify String: Copy Part of %T1% to %T3% Variable Modify String: Append %T3% to %T4% Variable Modify Integer: %N1% = %N1% + 1 Repeat End // Remove unwanted final CR from T4 Variable Modify String: Strip CR/LF from %T4% // Create Line 2 in T5 Variable Set String %T5% "" Variable Modify Integer: %N1% = %N1% + 1 Repeat Until %T3% = %T2% Variable Modify String: Copy Part of %T1% to %T3% Variable Modify String: Append %T3% to %T5% Variable Modify Integer: %N1% = %N1% + 1 Repeat End // Remove unwanted final CR from T5 Variable Modify String: Strip CR/LF from %T5% // Create Line 3 in T6 Variable Set String %T6% "" Variable Modify Integer: %N1% = %N1% + 1 Repeat Until %T3% = %T2% Variable Modify String: Copy Part of %T1% to %T3% Variable Modify String: Append %T3% to %T6% Variable Modify Integer: %N1% = %N1% + 1 Repeat End // Remove unwanted final CR from T6 Variable Modify String: Strip CR/LF from %T6% // Add tags Variable Modify String: Append %T4% to %T21% Variable Modify String: Append %T22% to %T21% Variable Set String %T4% "%T21%" Variable Modify String: Append %T5% to %T23% Variable Modify String: Append %T24% to %T23% Variable Set String %T5% "%T23%" Variable Modify String: Append %T6% to %T25% Variable Modify String: Append %T26% to %T25% Variable Set String %T6% "%T25%" Text Box Display: Tagged values Delay 100 Milliseconds Macro Return And here's the Direct Editor output if you're impatient to run it <REM2:Add tags to 3 lines (for pepperpod)><TBOX4:T:4:000671Center000428000200:000:Opening messageThis assumes you already have 3 lines of text copied from somewhere onto the clipboard. If not, do so now. Click OK to run the macro.><TVAR2:01:03:><REM2:Set a variable for a CR (EOL)><ASCIIC:2:1:13><REM2:Set variables for the 6 tags needed><TVAR2:21:01:[LINE1TAG1]><TVAR2:22:01:[\LINE1TAG]><TVAR2:23:01:[LINE2TAG]><TVAR2:24:01:[\LINE2TAG]><TVAR2:25:01:[LINE3TAG]><TVAR2:26:01:[\LINE3TAG]><REM2:Create Line 1 in T4><TVAR2:03:01:><IVAR2:01:01:1><TVAR2:04:01:><REP3:08:000001:000001:0003:1:01:T2><TMVAR2:10:03:01:N01:001:><TMVAR2:08:04:03:000:000:><NMVAR:01:01:1:0000001:2:0000001><ENDREP><REM2:Remove unwanted final CR from T4><TMVAR2:04:04:00:000:000:><REM2:Create Line 2 in T5><TVAR2:05:01:><NMVAR:01:01:1:0000001:2:0000001><REP3:08:000001:000001:0003:1:01:T2><TMVAR2:10:03:01:N01:001:><TMVAR2:08:05:03:000:000:><NMVAR:01:01:1:0000001:2:0000001><ENDREP><REM2:Remove unwanted final CR from T5><TMVAR2:04:05:00:000:000:><REM2:Create Line 3 in T6><TVAR2:06:01:><NMVAR:01:01:1:0000001:2:0000001><REP3:08:000001:000001:0003:1:01:T2><TMVAR2:10:03:01:N01:001:><TMVAR2:08:06:03:000:000:><NMVAR:01:01:1:0000001:2:0000001><ENDREP><REM2:Remove unwanted final CR from T6><TMVAR2:04:06:00:000:000:><REM2:Add tags><TMVAR2:08:21:04:000:000:><TMVAR2:08:21:22:000:000:><TVAR2:04:01:%T21%><REM2:><TMVAR2:08:23:05:000:000:><TMVAR2:08:23:24:000:000:><TVAR2:05:01:%T23%><REM2:><TMVAR2:08:25:06:000:000:><TMVAR2:08:25:26:000:000:><TVAR2:06:01:%T25%><TBOX4:T:4:001039000863000565000242:000:Tagged valuesT1 = Original clipboard = %T1% T4 = Tagged Line 1 = %T4% T5 = Tagged Line 2 = %T5% T6 = Tagged Line 3 = %T6%><MSD:100><MRETURN> Finally, here's an example of the output (in a message box): T1 = Original clipboard = Text line 1 A second line And a third final line of text T4 = Tagged Line 1 = [LINE1TAG1]Text line 1[\LINE1TAG] T5 = Tagged Line 2 = [LINE2TAG]A second line[\LINE2TAG] T6 = Tagged Line 3 = [LINE3TAG]And a third final line of text[\LINE3TAG] -- Terry, East Grinstead, UK
  13. Another one sorted! I found that the total number scoped to the application (for which I was automatically building a menu) just happened to be 36. After increasing it, I did indeed get them all in the menu. So that just leaves the question about the sequence. -- Terry, East Grinstead, UK
  14. I've just started trying the built-in Menu of Macros for Topmost Window but can't get any macro it builds to work. All fail on the very first command, with a message like this: "Macro Express encountered an error while attempting to read the next macro command..." Can others successfully use this important feature please? Is there a known problem with it? --------- Pleased to report that upgrading from 3.7b to Version 3.7d build 1, 3.7.4.1 seems to have fixed this. Is there any way to get more than 36 macros listed? Joe Weinpert in Macro Express Explained says on page 51 that this is possible, but I don't appear able to do it. Also, what sequence are they in and can it be changed? -- Terry, East Grinstead, UK
  15. Kevin, BTW, does that still work only for IE, or can I use it confidently in Firefox please? -- Terry, East Grinstead, UK
  16. OK Frank, here you go: I first put an arbitrary 18 names into a file called NameList1.txt, and your 5 domain name into DomainList.txt Here's the macro: // Randomising email addresses (for frank1968) // Ask how many entries are needed Variable Set Integer %N9% from Prompt Repeat with Variable using %N9% // Get a random number between 1 and 18 to decide the Name T1 Variable Set Integer %N1% with a Random Number // Get a random number between 1 and 99999 to decide the Number N2 Variable Set Integer %N2% with a Random Number // Convert the integer to a string (so that it can be padded) Variable Modify Integer: Convert %N2% to text string %T2% // Pad it with leading blanks Variable Modify String: Pad Left %T2% Replace " " with "0" in %T2% // Get a random number between 1 and 5 to decide the Domain T3 Variable Set Integer %N3% with a Random Number Text File Begin Process: "NameList1.txt" Text File End Process Text File Begin Process: "DomainList.txt" Text File End Process // Activate the form (in this case a Notepad document) Activate Window: "RandomEmailForFrank.txt - Notepad" // Enter the first two line (Name & Number) Text Type: %T1%<ENTER> Text Type: %T2%<ENTER> // Create the email adress and enter it as the third line Variable Set String %T4% "" Variable Modify String: Append "%T1%@%T3%" to %T4% Text Type: %T4%<ENTER><ENTER> // Repeat the loop again, until all the required entries have been made Repeat End Macro Return Here's the direct code: <REM2:Randomising email addresses (for frank1968)><REM2:Ask how many entries are needed><IVAR2:09:02:FHow many random entries do you want?FFCenter:Center><REP3:05:000001:000001:0009:0:01:><REM2:Get a random number between 1 and 18 to decide the Name T1><IVAR2:01:06:18><REM2:Get a random number between 1 and 99999 to decide the Number N2><IVAR2:02:06:99999><REM2:Convert the integer to a string (so that it can be padded)><NMVAR:05:02:0:0000002:0:0000000><REM2:Pad it with leading blanks><TMVAR2:14:02:00:005:000:><TMVAR2:21:02:01:000:000: 0><REM2:Get a random number between 1 and 5 to decide the Domain T3><IVAR2:03:06:5><BTFBEG:001:N00001:000001:C:\Docs\SUNDRY\Macro Express\NameList1.txt><BTFEND><BTFBEG:003:N00003:000001:C:\Docs\SUNDRY\Macro Express\DomainList.txt><BTFEND><REM2:Activate the form (in this case a Notepad document)><ACTIVATE2:RandomEmailForFrank.txt - Notepad><REM2:Enter the first two line (Name & Number)><TEXTTYPE:%T1%<ENTER>><TEXTTYPE:%T2%<ENTER>><REM2:Create the email adress and enter it as the third line><TVAR2:04:01:><TMVAR2:07:04:00:000:000:%T1%@%T3%><TEXTTYPE:%T4%<ENTER><ENTER>><REM2:Repeat the loop again, until all the required entries have been made><ENDREP><MRETURN> And this is what the result looks like when I specified 10: Peggy 92014 Peggy@three.com Mary 46249 Mary@three.com Elvis 82790 Elvis@two.com David 60355 David@four.com Buddy 02297 Buddy@three.com Buddy 64823 Buddy@one.com Jim 31594 Jim@one.com Luke 85162 Luke@one.com Peggy 55350 Peggy@three.com David 38314 David@four.com (Had to edit my first attempt as I'd padded with blanks instead of zeros. Looks OK now...) I've been generous with Remarks, so you should be able to see what's happening and tailor it as you wish. Come back if you need any further help. -- Terry, East Grinstead, UK
  17. First, please reassure us! I do hope you're not a potential mass email spammer? -- Terry, East Grinstead, UK
  18. I thnk this should do what you want, Meg. After logging in, click My Controls (top right) and then click Options > Email and make the settings I've shown: -- Terry, East Grinstead, UK
  19. What timing! I just came to the forum to ask almost exactly the same question (in my case replacing with a comma plus a space) and found this as the second post from top. Thanks Stan -- Terry, East Grinstead, UK
  20. Nick, As Stan mentioned, Alt+d seems to do it. Works for me in both Firefox and IE6. -- Terry, East Grinstead, UK
  21. Thanks Kevin. I'll explore that. I was wondering if there might be a more direct way of somehow repeatedly reading through the registry values downwards from that first one. -- Terry, East Grinstead, UK
  22. Hi Cory, Just been experimenting with this out of curiosity. The following commands Read Registry String: "DisplayName" Delay 100 Milliseconds Text Box Display: Macro Return gets me the first entry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{00040409-78E1-11D2-B60F-006097C998E7}\DisplayName But how would you iterate from there through the entire long list? -- Terry, East Grinstead, UK
  23. Great, that sounds just the job. I haven't used that Text > Date/Time command before - I'll try it tomorrow. -- Terry, East Grinstead, UK
×
×
  • Create New...