Jump to content
Macro Express Forums

terrypin

Members
  • Posts

    2,232
  • Joined

  • Last visited

  • Days Won

    23

Posts posted by terrypin

  1. I want to bring up a reminder every half hour about taking a break. I've done that easily enough by simply activating an image viewer with a specific JPG to come up full screen every 30 mins in the Schedule dialog. But now I realise I need something more refined than that. When the reminder comes up I get up from my PC and come back a variable amount of time later. Might be 2 minutes, might be 20. So I really want to leave the macro running while I'm away, close it on my return, and then not see it displayed again until 30 mins after that.

     

    Any suggestions would be appreciated please.

     

    --

    Terry, East Grinstead, UK

  2. I'm glad the issue was something else and is now resolved.

     

    However, in addition to the solutions above which work for me too, I also use the "Wait Text Playback" command immediately after a Text Type command. The wait text playback also helps when nothing else seems to work, especially with copying and pasting text from the clipboard. Perhaps our macros sometimes run faster than the computer can keep up!?

     

    Thanks for that tip, which I'll try when my next macro refuses to work!

     

    --

    Terry, East Grinstead, UK

  3. Is there some neat way to detect if an application X is already loaded (but not activated)? If it's already loaded I want to Activate it, and take various steps. Otherwise I want to Launch it, wait for a longish time, and then take those same steps.

     

    For my intended macro I can't just use Activate/Launch followed by a Wait for Window Title command. I want to paste some data to the program, and that is possible almost immediately if I just have to activate it, but it needs 15-20 secs if I have to load the program first. However, the title comes up fast in a second or so, with the long wait after that.

     

    --

    Terry, East Grinstead, UK

  4. Instead of

    Text Type: <CONTROL>c

    try using

    Text Type: <ControlDown>c<ControlUp>

     

    Instead of

    Delay 100 Milliseconds

    after the copy-to-clipboard, use Options | Preferences | Delays | Delay after clipboard -- I believe the default is 250 milliseconds, which seems to work pretty well, if not bump it up to 500 milliseconds and try that. Using the Preference just saves you having to code the delay after each copy-to-clipboard.

     

    No guarantees, but maybe these methods will help.

     

    Thanks, appreciate the fast reply. But after another hour or so of further head scratching I've found the cause ;) Turns out to be the same issue that keeps catching me out: shortkey settings. In the past I've had frustrating cases in which a simple macro didn't work, and I eventually solved them after a suggestion from Joe Weinpert last November. I changed the setting to Do Not Remove Keystrokes Typed on those occasions and the macros ran fine. But I've therefore slipped into the habit of setting that for all my macros! This latest one just needs the default Global setting. With that restored, the clipboard is working again, with lots of tolerance on timings.

    :rolleyes:

     

    --

    Terry, East Grinstead, UK

  5. Of all the problems I have, getting stuff copied reliably to the clipboard is by far the most frequent. This morning I've already spent an hour on what should be a pretty trivial macro. Whatever delays I introduce, whatever keystroke speeds I use (10ms, 20ms, 50ms), I still can't seem to get the selected text into the clipboard. Instead it usually seems to hold the previous (or even older) copy.

     

    Does this ring a bell with anyone please? Are there any other things I can try?

     

    Here's the current example. I left-click an entry to make it editable, copy that (automatically selected) string to the clipboard, remove the highlighting (probably a redundant step), and store the clipboard contents in a variable. But if I paste the clipboard to a text editor directly after running this, I can see it's usually not copied correctly what was selected.

     

    // Copy Name to T1, from already open Properties (at preset size & position)
    // Assumes entry selected and mouse hovered
    // L click entry to make it editable
    Keystroke Speed: 20 Milliseconds
    Mouse Speed: 1 Milliseconds
    Mouse Left Button Click
    Delay 600 Milliseconds
    Text Type: <CONTROL>c
    Delay 100 Milliseconds
    Text Type: <ESC>
    // Put name in string variable T1
    Variable Set String %T1% from Clipboard
    Variable Save Text Variables
    Macro Return

     

    Any advice would be appreciated please.

     

    --

    Terry, East Grinstead, UK

  6. Thanks Stan. I'm pleased to report that I solved the problem. It turned out to be the same issue that had me foxed months ago. I was using a Shortkey for activation. When I switched to a Hotkey, it worked. Back with the Shortkey, I changed the setting to Do Not Remove Keystrokes Typed - and it worked! For anyone new to this issue, here's the relevant Help:

    This option instructs the shortkey not to erase itself after being typed in. Normally, backspaces are issued to remove the shortkey from the screen before the macro is executed. When using shortkeys in non text usage programs, this may not be desirable to have "backspaces" issued

     

    It seems sort of counter-intuitive (my first thought is that I would normally want to remove those text characters in case they screw things up) but it's those pesky backspaces that cause the trouble. I'll try to remember this from now on ;)

     

    --

    Terry, East Grinstead, UK

  7. 1. Make sure you insert 2 clicks, one to select, a pause, and another click to edit the name

    2. Make sure you're clicking on the text itself

     

    Once you have another window appear (the Pause) the focus is lost on the overlay properties and it will no longer be editable.

     

    Thanks, but

    1. Tried that alternative earlier; made no difference. Various delays and minor variations - same result.

    2. Doing that; I have the mouse hovered over the selected (highlighted) text before running the macro. IOW, exactly the same as the manual procedure.

     

    I only added the Pause to check why the later Ctl+C command to get the name onto the clipboard was failing. It shows that the reason is because the text is not accessible for copying at the outset.

     

    --

    Terry, East Grinstead, UK

  8. I'm at the hair-tearing stage over what should be a really simple operation! In my application Memory Map there's a list of entries like this:

    mxproblem1gv6.jpg

     

    Manually, if I left click a selected entry then after about half a second the name becomes editable (so that I can copy it to clipboard for instance), like this:

    mxmanualdj0.jpg

     

    But if I try to do that in a macro the box refuses to become editable. For example, this code

    Mouse Left Button Click
    Delay 2 Seconds
    Pause: Basic

     

    results in this:

    mxproblem2cr4.jpg

     

    Anyone know what might be happening, and how to achieve the result I want please?

     

    --

    Terry, East Grinstead, UK

  9. Thanks for the alternative suggestion. I actually got stuck in and wrote the macro along the lines suggested by rberq. Happy to say it works fine. On using a hotkey combination (had to look hard for one still unused by FSX!) it pops up a small message window headed 'NUMLOCK Status' containing either 'ON' or 'OFF', and I then hit Enter (or click OK) to close it. That appears on top of whatever FSX window is active.

     

    But it's now redundant! Someone suggested a freeware program that puts indicators in the system tray, next to the clock:

    http://www.snapfiles.com/get/systrayindicator.html

    and that works a treat.

     

    I've rarely used MX's Logical commands before, so I'm sure my code could be much improved. (Would welcome tips.) Here it is anyway, in case anyone else ends up here and finds it useful.

     

    // Display status of NUMLOCK
    Keystroke Speed: 10 Milliseconds
    Activate Window: "TextPad"
    Text Type: <CONTROL>n
    Text Type: <SHIFTD><KEYP7><SHIFTU>
    Text Type: <SHIFTD><ARROW LEFT><SHIFTU>
    Delay 100 Milliseconds
    Text Type: <CONTROL>c
    Window Minimize: "TextPad"
    Variable Set String %T1% from Clipboard
    If Variable %T1% = "7"
     Text Box Display: NUMLOCK Status
     Clipboard Empty
     Activate Window: "TextPad"
     Text Type: <CONTROL><F4>
     Delay 50 Milliseconds
     Text Type: n
     Delay 50 Milliseconds
     Window Minimize: "TextPad"
     Macro Return
    Else
     Text Box Display: NUMLOCK Status
     Activate Window: "TextPad"
     Text Type: <CONTROL><F4>
     Delay 50 Milliseconds
    End If
    Window Minimize: "TextPad"
    Macro Return
    

     

    --

    Terry, East Grinstead, UK

  10. For my new PC I chose a Logitech wireless keyboard and mouse. A poor choice now that I realise it obviously has no Numlock LED indicator due to the battery limitation.

     

    I've just installed MS Flight Simulator, a birthday present from my son. Its flying controls vary significantly depending on whether Numlock is enabled or not. Anyone know of a simple way I can toggle a small message window displaying if it's ON or OFF please?. That would be marginally preferable to pressing Numlock to see what happens to my aircraft ;)

     

    --

    Terry, East Grinstead, UK

  11. Mmmmm.... Not sure I follow. I wouldn't use the taskbar but rather use the windows manipulation commands. Use the Repeat With Windows to generate a list with my Multiple Choice trick then when the user selects the various items restore those windows and resize by name. You can find all those in the "Windows/Programs" category in ME3.

     

    So make a list and give it to the user. Let's say he picks 4 windows. If we want them vertical tiled on the left half I would find the screen width and cut it in half, and the height and divide that by the number of windows. Oh, and of course you would have to count the number of selections. Now repeat 4 times, once with each window title and set the width and position of each. For the vertical value start with one and add the height of a window each time for the next position. Pretty simple really.

     

    OK, thanks, I'll try that approach.

     

    --

    Terry, East Grinstead, UK

  12. That raises all sorts of other possibilities in my mind. You're clearly way ahead of me on this. Is there a general way to work reliably with the taskbar entries? For example, how could I click on a particular entry? Even if I could assume it was present in the taskbar, it changes position/size as others are added or removed. Are the current names and positions accessible in the XP registry perhaps?

     

    --

    Terry, East Grinstead, UK

  13. What if you create a list of Windows using the Repeat With Windows command and give the user a multiple choice dialog box. There they can select the desired windows and ME could then restore them and, based on the number of windows, determine the size and position of each with a little math.

     

    Thanks Cory, that looks promising - I'll experiment along those lines. Nothing like that around already, I suppose?

     

    --

    Terry, East Grinstead, UK

  14. Does anyone have or know of a macro(s) that could help me achieve something I do a lot, like the following example.

     

    Suppose on my taskbar I have this typical mixture:

    - Browser

    - Text editor

    - A 'group' representing 3 JPG photo images from say IrfanView. (I have 'Group similar taskbar buttons' checked in Properties.)

    - Email program

     

    I'm composing a message about the photos in my email program, which therefore currently has the focus. If I look around or use Alt-Tab I can see one of the images, which was opened recently and not mimimised. I now briefly want to see all 3 images, plus my text editor document, vertically or horizontally tiled, at a single view. There appears to be no way to do that simply within XP.

     

    I can't even reliably see the 3 IrfanView images. Although r-clicking the grouped taskbar item displays a menu including 'Tile Vertically', it doesn't do so unless you use 'Minimize Group' first. Otherwise you get a mix of the images and whatever window last had focus. (Presumably a Windows design flaw or bug?)

     

    What I'm after in this example is to identify each of those 4 windows (probably just the text window and the grouped item), click or apply a hotkey, and have all 4 immediately tiled across the full screen. Click or hotkey again, (or Alt-Tab) and I want to be back to my email program.

     

    Any thoughts or suggestions please?

     

    --

    Terry, East Grinstead, UK

  15. Sorted thanks. It was easier than I expected. For anyone else who ends up here with a similar query, here's the basic routine:

     

    // Drags mouse rightwards until cursor changes to colour 13160660
    Repeat Start (Repeat 800 times)
     Mouse Move Position 1, 0
     Delay 4 Milliseconds
     Get Pixel: Under Mouse into %N1%
     If Variable %N1% = 13160660
       Text Box Display: Cursor change 1
     Else
     End If
    Repeat End
    Macro Return

     

    If there's a neater way, I'd appreciate seeing it please.

     

    Incidentally, I first experimented with using the Wait for Mouse Cursor command, set to <-||->. (MacroExpress calls that 'Horizontal Split'. Surely it should be 'Vertical Split'?) Anyway, that just didn't work. Even with the changed cursor showing for several seconds. Yet it did work with the other cursor, <->.

     

    --

    Terry, East Grinstead, UK

  16. Hi,

     

    Could someone point me to a macro that will let me size two panes in an application window please? I've attached a screenshot.

     

    post-1217-1211277052_thumb.jpg

     

    I can get the full window to its desired size and position using a program I have called Sizer. But the only way I can resize those two sections on the left is by dragging the mouse cursor. FWIW, when the mouse reaches the left border of the two it changes to something like this: <-||->. And when it reaches the one to the right, it becomes like this: <->.

     

    Presumably I need a subroutine (section?) to drag the mouse rightwards from say x=100 px and detect when it reaches the first border. Then drag this border to a point at say x=500. Then do something similar with the second pane.

     

    I'm hoping in particular that there is a well-tried macro for the detecting aspect?

     

    Any suggestions will be appreciated please.

     

    --

    Terry, East Grinstead, UK

  17. I am not encountering any problems with either way (mouse or F2). Both work fine for me.

     

    Now, it doesn't work when the Do Not Remove Keystrokes Typed checkbox is not checked. Without checking the box, you are telling Macro Express to backspace over what you just typed. And what happens when you backspace in Windows Explorer? You climb the folder tree, possibly all the way up to your desktop.

     

    Thanks Joe, good of you to take the trouble to try it.

     

    And yes, bingo, you've put your finger on the cause of my problem! I just came back here to post the good news that I'd had a very fast reply from Insight Software, making exactly the same point about that Do Not Remove Keystrokes Typed setting, and saw your post. Mine has always been unchecked, and I never thought to change it.

     

    I'm confident my other more complex macros will respond to the same technique too. I'll try it tomorrow.

     

    Really pleased to sort this - it's been vexing me for days!

     

    --

    Terry, East Grinstead, UK

  18. Thanks for the follow-up Alexandra. You're way ahead of me in your use of menus in general, and pop-ups in particular. But I'm going to set aside some time to experiment and will use this thread to help me, complementing the tutorial Cory recommended.

     

    Have you also used shortkey activation very much? As one of your motivations (like mine) is to avoid having to remember so many hotkeys, I'd have thought this was a promising alternative?

     

    Although it's going off at a bit of a tangent, can I get your interest in my issue about shortkeys please. I'm baffled why macros activated by a shortkey sometimes fail, yet work OK with a hotkey. Obviously, until this is resolved, it's a serious handicap to using shortkeys confidently. I use scores of them at present for simple stuff, like entering frequently-used folder names in browse windows, or typing common words/phrases. But it's only recently that I've tried using shortkeys to replace hotkeys in my more complex macros. That's where I've hit these problems.

     

    Perhaps you could try this this ultra-simple macro, for use on any selected filename in a Windows folder.

     

    Mouse Left Button Click

    Delay 500 Milliseconds

    Macro Return

     

    <LCLK><MSD:500><MRETURN>

     

    You just highlight a filename in any folder and activate the macro. It should just 'open up' the filename ready for for editing/copying.

     

    Here, with any shortkey, it fails. (It somehow goes 'up the tree' so that the result displayed is My Computer or sometimes the Desktop folder. No ill effects, just totally wrong result.) Yet with a hotkey it works perfectly.

     

    (Note that I've deliberately not used the alternative of entering F2 instead of left-clicking, because many of my programs don't support F2 for editing.)

     

    Feedback from anyone else would of course also be much appreciated too please.

     

     

    --

    Terry, East Grinstead, UK

  19. I don't really understand this.

    - You've presented a problem you're experiencing.

    - I've suggested a solution.

     

    But now you say you can't implement the solution (for reasons that are not clear to me). If it is indeed your left-click command that is causing the problem (certainly the case for me), then continuing to use code that contains this left-click statement will continue not to work. How then can you ever hope to solve your problem?

     

    Eh? I don't think you can have properly read this thread from the outset! In particular, my post of Nov 26 2007, 05:20 PM included:

    Thanks for your interest and help. Your macro worked fine for me too, but it's not quite equivalent to my problem macro, which I have still not been able to get working.

    and, in the code itself:

    // L-click to make it editable. (I could have used F2 instead, but this keeps it like the original.)

     

    I've reminded you of these points a couple of times since! So I'm baffled why you're finding it hard to understand. It's very simple. Your 'solution' (of using F2 instead of a left-click) is not applicable to the original macro that prompted this thread. F2 cannot be used in that box in Memory-Map.

     

    Our discussion on the ultra-simple macro was to find an answer to the underlying issue, namely: do macros sometimes work fine with hotkey activation and fail with shortkey activation? You are the only user who has so far tested this and your answer as I understand your feedback is plainly Yes. (However, a so far unexplained side issue arose because in your case your macro failed to get into edit mode even with activation by a hotkey. Like my original, my ultra-simple macro works fine with a hotkey.)

     

    So:

    1) I am still looking for a solution to my specific problem.

    2) I'm still hoping to get some MEX Support response on the underlying issue of unreliable shortkey activation.

     

    --

    Terry, East Grinstead, UK

×
×
  • Create New...