Jump to content
Macro Express Forums

terrypin

Members
  • Posts

    2,199
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by terrypin

  1. Thanks for testing Alan. I assume it was set for a few hours ahead and did not trigger an hour earlier? My result sounds strangely like your other tool, as we are of course currently in summer time, GMT plus 1. Terry 15:10, 7th July.
  2. I've always assumed that when using scheduled activation I could rely on using the time correctly set in the date/time icon at the right of my taskbar. If that matches my watch within one minute then I'm happy. But an alarm I set this morning is being activated an hour early. I assume the alarm will stop triggering an hour early too, as logic suggests. That would obviously be very worrying if I hadn't become aware of it. Sound File: Alarm-Beeps.wav Text Box Display: Alan Smith <SOUND FILE File="C:\\Users\\terry\\Sounds\\Sound Effects\\Alarm-Beeps.wav" Wait="FALSE" _PROMPT="0x0007"/> <TEXT BOX DISPLAY Title="Alan Smith" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs72 Alan Smith\\b0\\f1\\fs20 \r\n\\par }\r\n" Left="390" Top="485" Width="783" Height="421" Monitor="0" OnTop="TRUE" Keep_Focus="FALSE" Mode="\x00" Delay="0"/> Terry
  3. Agreed. I too would like to know the underlying cause. No response from the author.
  4. Or just click the target pane with the mouse? 🙂
  5. OK, thanks Alan, I’d misunderstood. Trauton: I’m very surprised that, having selected an entry manually with the arrow keys, there is then no single key or hotkey to open its chart. But I see that the developer confirmed that. Is mouse usage really slower overall? After all, wouldn’t it mean you could then click or d-click directly after visual selection of your target?
  6. It looks interesting, but: - I have scores of macros working with File Explorer, including a dozen or so sizing and positioning windows - Another learning curve I can do without - Already a year or two of work waiting on my To Do and To Learn lists - In view of the subject discussion I suspect there may be other quirks So I'll give it a day or two in case the author corresponds about the puzzle outstanding, and then uninstall.
  7. I would need to know what was at 550,59 on your computer screen to be able to run that successfully. A screenshot, or at least some comments in your script, would tell me. But I'm guessing it's the tool icon that sets the layout to the default 4-pane one? That's (350,40) on my 1920 x 1200 screen and works fine here.
  8. I was also wondering if the same result could be achieved by other means, but so far that’s elusive. Tab will take you through each of the four panes. And if there is some way to identify your starting tab then the rest is easy. I reckon you could get that ‘base tab’ by pixel colour tests, but you’d then have to sacrifice the versatile viewing options, or add even further complexity. Why not just settle for the good old fashioned method of clicking the target? 🙂
  9. rberq, Yes. The macro runs fine however it’s activated, including other hotkeys or debug mode. But Q-Dir does not respond to being given Ctrl+1/23/4 by MX Pro rather than manually. Nor if that’s preceded by a variety of other characters (to which it does respond). I have yet to try a few other possibilities.
  10. No, mine behaved the same. (Now that I know what it's supposed to do!) There's definitely something strange going on with those hotkeys Ctrl + 1/2/3/4. BTW, I couldn't find them documented? At least, not in the list I've shown below. FWIW I've emailed the author.
  11. And your reply to the rest of my request? "Please post your macro and describe the startup state required and what it is supposed to do when you activate it with Alt + 1" Also, did you try running mine? EDIT: Meanwhile, as far as I can tell after some trial and error, the application shortcuts CTRL + 1, CTRL + 2, CTRL + 3, and CTRL + 4 appear to successively select each of the four (default) panes. Is that what you want it to do? If so, I was able to reproduce your problem. Thursday 1 July 2021, 1105
  12. Alexis, More detail needed! Please post your macro and describe the startup state required and what it is supposed to do when you activate it with Alt + 1 if it's not obvious from your commented script. Meanwhile, I've installed the program (64-bit, as Admin), but using the following minimalist macro, I could not reproduce the issue during a dozen or so runs. // Attempting to reproduce problem described at https://pgmacros.invisionzone.com/topic/8883-mex-pro-4-and-q-dir-hotkey-problems/ // Ensure Q-Dir has focus before activating this macro with ALT + 1 Delay: 0.1 seconds Text Box Display: Temp Text Type (Simulate Keystrokes): <CONTROL>1 // Now added a long delay (0.5 s) waiting for whatever is supposed to happen after typing CTRL + 1. Delay: 0.5 seconds // Long delay (0.5 s) waiting for whatever is supposed to happen after typing CTRL + 1. Text Box Display: Temp <COMMENT Value="Attempting to reproduce problem described at\r\nhttps://pgmacros.invisionzone.com/topic/8883-mex-pro-4-and-q-dir-hotkey-problems/"/> <COMMENT Value="Ensure Q-Dir has focus before activating this macro with ALT + 1"/> <DELAY Flags="\x01" Time="0.1"/> <TEXT BOX DISPLAY Title="Temp" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 The macro has been activated by Alt+1\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <TEXT TYPE Action="0" Text="<CONTROL>1"/> <COMMENT Value="Now added a long delay (0.5 s) waiting for whatever is supposed to happen after typing CTRL + 1."/> <DELAY Flags="\x01" Time="0.5" _COMMENT="Long delay (0.5 s) waiting for whatever is supposed to happen after typing CTRL + 1."/> <TEXT BOX DISPLAY Title="Temp" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 The macro typed CTRL + 1. Now what?\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> BTW, I'm always rather careful about using Alt in my activation keys, as I've occasionally had quirky results, particularly under Win 10. And I assume you've tried varying delays after the crucial TextType, and also Wait For Text Playback? To make further progress we need to be singing from exactly the same hymn book, as the devil is usually in the details! Terry Thursday 1 July 2021, 0907
  13. I’m obviously missing something! How exactly do you do this at present? you select a row manually with the arrow keys, yes? And a double left mouse click will then do what you want, namely open a chart? So surely you just create a macro that performs the mouse double click, and activate it with your chosen hotkey?
  14. With the app maximised, try methodically establishing the locations (x,y coordinates) of points in the middle of all the boxes into which you expect the macro to enter text. Do so under the differing conditions that you actually encounter. If/when you find an inconsistency (when a box location has changed), try to identify exactly why. As just one example, it may be lower down because extra material (such as tabs in your we browser) have been generated for some reason at the top. You may then be able to determine what that ‘extra’ is by some fairly simple logic test, typically with pixel colour testing at a known location. And then, with a little maths, scroll up or down a compensating amount, so that you can click directly on the target.
  15. Is it possible to show us the web app? Otherwise mainly guesswork. If confidentiality precludes that, then can you find another accessible web site that gives you the same problem?
  16. I'll shortly be leaving my PC for most of the day. So I made the assumption that your answer to my key question would be Yes. I've therefore gone ahead and written the heavily commented demo macro below. Together with Alan's suggestions I hope it will help you get the problem sorted. Come back if not. // The MX Pro macro is now running, having been triggered in an appropriate way. // The next command starts a loop which will repeat until othewise ended. For this basic demo that will be by using the hotkey assigned in Options > Preferences > Playback > Miscellaneous > 'Hotkey to abort macros'. // One way to repeat indefinitely, until otherwise stopped. Repeat Until %N[99]% Does not Equal "%N[99]%" Get Mouse Position into (MouseX, MouseY) Relative to Screen // Test if mouse is inside Notepad If Variable %MouseX% Is Less Than "777" AND If Variable %MouseY% Is Less Than "566" // So the next command should switch focus to that window if it does not already have it. Window Activate: - Notepad // In addition, for this demo, let's briefly show a message. Text Box Display: Message End If // Test if mouse is inside Paint If Variable %MouseX% Is Greater Than "257" AND If Variable %MouseX% Is Less Than "970" AND If Variable %MouseY% Is Greater Than "578" AND If Variable %MouseY% Is Less Than "1160" // So the next command should switch focus to that window if it does not already have it. Window Activate: - Paint // In addition, for this demo, let's briefly show a message. Text Box Display: Message End If End Repeat // The window will be repeatedly toggled until the mouse leaves the area. But that makes no practical difference, and the temporary messages can be deleted after testing. // Only experiment will determine whether the macro is fast enough to respond to brisk cursor movement <COMMENT Value="The MX Pro macro is now running, having been triggered in an appropriate way."/> <COMMENT/> <COMMENT Value="The next command starts a loop which will repeat until othewise ended. For this basic demo that will be by using the hotkey assigned in Options > Preferences > Playback > Miscellaneous > 'Hotkey to abort macros'.\r\n"/> <COMMENT Value="One way to repeat indefinitely, until otherwise stopped."/> <REPEAT UNTIL Variable="%N[99]%" Condition="\x01" Value="%N[99]%"/> <GET MOUSE POSITION Option="\x00" X="MouseX" Y="MouseY"/> <COMMENT Value="Test if mouse is inside Notepad"/> <IF VARIABLE Variable="%MouseX%" Condition="\x02" Value="777" IgnoreCase="FALSE"/> <AND/> <IF VARIABLE Variable="%MouseY%" Condition="\x02" Value="566" IgnoreCase="FALSE"/> <COMMENT Value="So the next command should switch focus to that window if it does not already have it."/> <WINDOW ACTIVATE Title=" - Notepad" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <COMMENT Value="In addition, for this demo, let's briefly show a message."/> <TEXT BOX DISPLAY Title="Message" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n{\\colortbl ;\\red255\\green0\\blue0;}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 The mouse cursor has entered the target window called Notepad.\r\n\\par \r\n\\par \\cf1 Use the macro button to trade!\\b0\\f1 \r\n\\par }\r\n" Left="824" Top="620" Width="352" Height="122" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x01" Delay="1"/> <END IF/> <COMMENT/> <COMMENT Value="Test if mouse is inside Paint"/> <IF VARIABLE Variable="%MouseX%" Condition="\x03" Value="257" IgnoreCase="FALSE"/> <AND/> <IF VARIABLE Variable="%MouseX%" Condition="\x02" Value="970" IgnoreCase="FALSE"/> <AND/> <IF VARIABLE Variable="%MouseY%" Condition="\x03" Value="578" IgnoreCase="FALSE"/> <AND/> <IF VARIABLE Variable="%MouseY%" Condition="\x02" Value="1160" IgnoreCase="FALSE"/> <COMMENT Value="So the next command should switch focus to that window if it does not already have it."/> <WINDOW ACTIVATE Title="- Paint" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <COMMENT Value="In addition, for this demo, let's briefly show a message."/> <TEXT BOX DISPLAY Title="Message" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n{\\colortbl ;\\red255\\green0\\blue0;}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 The mouse cursor has entered the target window called Paint.\r\n\\par \r\n\\par \\cf1 Use the macro button to trade!\\b0\\f1 \r\n\\par }\r\n" Left="824" Top="620" Width="352" Height="122" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x01" Delay="1"/> <END IF/> <END REPEAT/> <COMMENT Value="The window will be repeatedly toggled until the mouse leaves the area. But that makes no practical difference, and the temporary messages can be deleted after testing."/> <COMMENT/> <COMMENT Value="Only experiment will determine whether the macro is fast enough to respond to brisk cursor movement"/> Terry
  17. There are several aspects of your problem definition that I’m not clear about. I suppose I still don’t understand exactly what you are doing and what you want to happen. “I created a macro which I execute by clicking the left mouse button.” Yet as I understand it you also want your macro to left click when the mouse cursor is hovering over a certain window directly before you make a trade with your ‘macro’ buttons. Seems like potential conflict, as that would restart your macro. Did you consider the command Window Activate I asked about? As usual the devil is in the details. What exactly do you want to happen, not only when you move your mouse into a specific window but also afterwards? Specifically, am I right that as soon as the mouse cursor moves into a ‘target window’ you want it to get the focus abd keep it until the cursor enters another window? If so, what are the time constraints, if any? For example, if you were trading briskly and moved from window #1 to window #2 in less than say 0.5s, I assume you would want both the MX macro and your macro buttons to respond correctly? I’m not familiar with your application or with online trading. Nor do I have any ‘macro buttons’ on my mouse. And I use only a single large monitor, albeit usually with many windows open. These are obstacles to helping you, so we need a shared basis for discussion. If you confirm that I’m on the right lines so far then I suggest we continue the discussion as follows: using two windows, each occupying a fixed section of the screen, say Notepad and Paint, both universally accessible on MS Windows based PCs.. I would then draft a simple demo macro which you could hopefully adapt to your Ninja Trader scenario. Terry
  18. “It's passing strange to me that a simple macro can't be created to duplicate a manual click on a screen coordinate” I’m lost! Of course a macro can do that. For example, the mouse location can be captured as coordinates (MouseX,MouseY) and an IF Variable used to determine whether that falls within the required area. But as you have to first activate the macro, why not just do so with a Mouse Event specifying a position chosen visually? That could simultaneously give that area the focus, yes? I clearly must be missing something here. It would be helpful to see a non-confidential screenshot or two, plus your full macro. And, as this is your first post could you indicate your level of experience with MX Pro macros. For instance, are you familiar with the full command set? Including Window Activate etc? And when specifying a window in the Script Editot have you tried showing Hidden windows.
  19. Hi Alan, My greatest challenge at present is trying to achieve a day’s worth of intended tasks in a 24 hour day! Can hardly believe that I used to manage a commute and work as well as hobbies. Terry
  20. Hi Alan, In garden using iPad so can’t try it yet. But with the target cell selected I would expect a copy followed by set variable then a trim would deliver the text you need for the rest. Failing that, an F2, a move to the edit box, and take the copy from there. But a VBA macro would be my personal choice! Not only because it would be so much faster but it would be a refresher exercise as I haven’t done any VBA stuff for ages. Terry
  21. Hi Alan, I don’t see the challenge in this one? Y = 1.13 * X, so X = Y/1.13, for the selected X that the user recognises as a mistake. A bit of rounding and that’s it, yes? Terry
  22. I got up to around 50 or so macros using the prefix '='. Soon regretted it when the conflict in Excel became apparent, but never got around to changing it. I see that I'm up to 217 now and might well switch to the better choice of ';;'.
  23. Do you want a really SIGNIFICANT reply to the "save as"? Modesty not a strong-point then? 😉
  24. To remove all ambiguity why don't you simply show two examples of the input and output?
×
×
  • Create New...