Tee Hiett Posted January 11, 2019 Report Share Posted January 11, 2019 Any suggestions as to why the Shell command method nor the hot key method shown below will activate the MacroExpress, also shown below? The Macro Express macro works as expected alone. I just can't activate it from Dragon. Thanks, Tee Dragon Sub Main ' Shell command method - Macro Express nickname FillWithRobo Shell "C:\Program Files (x86)\Macro Express Pro 6\MeProc.exe /AFillWithRobo" 'Hot Key method Ctrl+Shift+Alt+9 ' SendKeys "^+%9" Wait 2 SendKeys ListVar1 Wait 0.2 SendKeys "{Enter}" End Sub' Macro Express <COMMENT Value="==========================================================================="/> <COMMENT Value="opened the window for RoboForm Search"/> <COMMENT Value="----------------------------------------------------------------------------------------------------------------------------------"/> <MOVE MOUSE TO NOTIFICATION AREA ICON Icon="RoboForm: fills forms, manages passwords" Exact="FALSE" Center="TRUE" Left="0" Top="0"/> <COMMENT Value="Change focus to Search box "/> <WINDOW ACTIVATE Title="RoboForm Search Box" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <COMMENT Value="Clear any existing text "/> <TEXT TYPE Action="0" Text="<DELETE>"/> Quote Link to comment Share on other sites More sharing options...
Samrae Posted January 11, 2019 Report Share Posted January 11, 2019 I'm not sure if this is still the case but some years ago when I tried to use Dragon with Macro Express it would not work. There was something in Dragon that prevented access to other macro programs. At the time Dragon offered a more expensive version that did allow it to interact with Macro Express. To run macros Macro Express uses the Windows Hooks. Use of the hooks works if all programs using the hooks properly cooperate. However, some programs intentionally interfere with the hook chain. You might try clicking Tools, Restore Keyboard and Mouse Hooks from within Macro Express after Dragon is loaded. Another thing to try would be to run Macro Express as Administrator. Quote Link to comment Share on other sites More sharing options...
Tee Hiett Posted January 11, 2019 Author Report Share Posted January 11, 2019 Thanks, Samrae. I forgot to mention that I am using the latest programs for both Dragon and Macro Express, DPI 15.3 for Dragon and Macro Express Pro 6. I have tried Tools/Restore Keyboard and Mouse Hooks. I have also set the Option/activation/hooks/Auto restore the keyboard and mouse Hooks. All of this to no avail so far. Tee Quote Link to comment Share on other sites More sharing options...
acantor Posted January 12, 2019 Report Share Posted January 12, 2019 I just tested the hotkey method, and discovered that the code samples I provided in my article on Dragon/Macro Express integration no longer work. However, if you translate SendKeys into SendSystemKeys, the command works fine: SendSystemKeys "{Alt+Shift+Ctrl+9}" When I tried it with SendDragonKeys, it didn't work. It would appear that only SendSystemKeys may be used to invoke a Macro Express hotkey macro. Quote Link to comment Share on other sites More sharing options...
acantor Posted January 12, 2019 Report Share Posted January 12, 2019 I just tested the shell command method, and it worked fine. I wonder whether the problem you are experiencing has anything to do with the Windows version. I'm using Windows 7. Double-check that the nickname of your MEP macro is really "FillWithRobo", and that you don't have two different MEP scripts with the same nickname. Check the "Scope" in MEP, and the "Availability" of your script in Dragon. For testing purposes, you might want to make everything global. Quote Link to comment Share on other sites More sharing options...
acantor Posted January 12, 2019 Report Share Posted January 12, 2019 Other things to check: 1. Ensure you don't have two Dragon commands with the same name. 2. Add a message box or a beep command to your MEP command. The Dragon command might be triggering the MEP command, but maybe the keystrokes the MEP command is sending aren't doing what you expect. 3. Check that the MEP macro file that contains your "FillWithRobo" script is open. You should be able to see it on the list in the left pane of the Macro Explorer, below "System Macros." Quote Link to comment Share on other sites More sharing options...
Tee Hiett Posted January 12, 2019 Author Report Share Posted January 12, 2019 Thanks, acantor. When I run the command SendSystemKeys "{Alt+Shift+Ctrl+9}" on my computer, I get the error message shown in the attached file. When I run the Shell command method, the program runs all the way through but does not produce any results. The macro seems to run consistently when I key in the Alt, Shift, Ctrl and 9 keys. I am running Windows 10, Macro Express Pro 6 and DPI 15.3. Could the problem be with Windows 10? Thanks for your help with this. Tee Quote Link to comment Share on other sites More sharing options...
acantor Posted January 13, 2019 Report Share Posted January 13, 2019 Post your MEP and Dragon scripts here. I'm curious what's on line 8. Quote Link to comment Share on other sites More sharing options...
Tee Hiett Posted January 13, 2019 Author Report Share Posted January 13, 2019 Scripts are attached. Thanks for your help with this. Tee Quote Link to comment Share on other sites More sharing options...
acantor Posted January 13, 2019 Report Share Posted January 13, 2019 What is on lines 1 through 3 of the Dragon script? Both scripts look fine. Try recreating the Dragon script totally from scratch, without any extra lines, and in a simplified form, e.g., Sub Main SendSystemKeys "{Ctrl+Shift+Alt+9}" End Sub Quote Link to comment Share on other sites More sharing options...
Samrae Posted January 14, 2019 Report Share Posted January 14, 2019 Have you tried running Macro Express Pro as Administrator? Quote Link to comment Share on other sites More sharing options...
James534 Posted January 14, 2019 Report Share Posted January 14, 2019 I use the following If InStr(ListVar1, "plan") Then ShellExecute "C:\Program Files (x86)\Macro Express Pro\MacExp.exe /Aplan" try shellexecute Quote Link to comment Share on other sites More sharing options...
acantor Posted January 14, 2019 Report Share Posted January 14, 2019 James, Is the macro triggered if you specify MeProc.exe rather than MacExp.exe? Quote Link to comment Share on other sites More sharing options...
James534 Posted January 15, 2019 Report Share Posted January 15, 2019 acantor I have not tried it with the MeProc.exe , the code I listed above is one that I use with Dragon Medical 4, works fine. I think there was an issue with execute vs shellexecute with windows 10 James Quote Link to comment Share on other sites More sharing options...
Tee Hiett Posted January 15, 2019 Author Report Share Posted January 15, 2019 After I recreated the scripts, the attached Shell command method seems to be working consistently. I am not running this as administrator. I was unable to get the Hot Keys method to work. The command SendSystemKeys "{Ctrl+Shift+Alt+9}" produce the error message Invalid Instruction. Thanks for all the help. Tee Quote Link to comment Share on other sites More sharing options...
acantor Posted January 15, 2019 Report Share Posted January 15, 2019 34 minutes ago, Tee Hiett said: The command SendSystemKeys "{Ctrl+Shift+Alt+9}" produce the error message Invalid Instruction. Curious! 1. Try retyping this line. Don't copy it from somewhere else. Instead, Type every character. Then test. 2. Try assigning hotkeys with two modifiers instead of three, e.g., Ctrl+Alt+9, Shift+Ctrl+9, Shift+Alt+F12, and so on. If that doesn't work, I'm stumped! But at least the Shell method is finally working. Quote Link to comment Share on other sites More sharing options...
Tee Hiett Posted January 16, 2019 Author Report Share Posted January 16, 2019 SendSystemKeys "{Ctrl+Shift+Alt+9}" Error : Invalid instruction SendKeys "{Ctrl+Shift+Alt+9}" Error: (10111) Invalid key name SendSystemKeys "{^+%9}" Invalid instruction SendKeys "{^+%9}" Error: (10111) Invalid key name Using SendSystemKeys returns the error Invalid instruction no matter the number of modifiers or method of identifying the keys. Using SendKeys returns the error Invalid key name no matter the number of modifiers or method of identifying the keys Enter the key strokes from the keyboard always executes the command, without the name of the site, of course. Quote Link to comment Share on other sites More sharing options...
acantor Posted January 16, 2019 Report Share Posted January 16, 2019 I'm not surprised that lines 2 and 3 are causing problems, as the syntax for both is incorrect. But line 1 and 4 are valid. Perhaps the problem relates to the statements, the commands, or your Dragon profile. So let's check them all: 1. A problem with SendKeys and SendSystemKeys: Comment out (or delete) all lines containing SendKeys and SendSystemKeys. Then add something more straightforward, like this: SendKeys "Hello" SendSystemKeys "Goodbye" Set "Availability" to "Global," save the command, and try running it in a text editor. What happens? 2. A problem with the command: Create a new command. Don't clone an existing one. Start from scratch. Do you have problems with simple code like SendKeys "Hello"? If that works, try SendSystemKeys "Goodbye" If that works, try SendSystemKeys "{Ctrl+Shift+Alt+9}" 3. A problem with your Dragon profile: If trying the above results in error messages every time, export your commands, create a new Dragon profile (which only takes five minutes), and import your commands. Quote Link to comment Share on other sites More sharing options...
Tee Hiett Posted January 17, 2019 Author Report Share Posted January 17, 2019 acantor, I must apologize. I have been used a Dragon add-in named KnowBrainer for so many years that I had forgotten that it really is a separate program. When I loaded Dragon without KnowBrainer and put the commands into the MyCommands editor of Dragon I got the same results that you have reported. Although the Shell method of calling the Macro Express macros work fine, I am investigating this further and will let you know what I find out. Thanks so much for hanging in there with me. Tee Quote Link to comment Share on other sites More sharing options...
Tee Hiett Posted January 18, 2019 Author Report Share Posted January 18, 2019 acantor, Here is the response I got back from the KnowBrainer forum regarding my problem: Edgar has posted a message entitled KnowBrainer and shellexecute.The following message was posted on: Friday January 18, 2019 11:40:24 AM In the KnowBrainer example you need to use SendKeys like this: SendKeys "+^%9", 1' note that I have removed the curly braces So both methods now work correctly when I am using KnowBrainer. You might like to take a look at the very active KnowBrainer forum for reference when you have questions about Dragon. You might even want to look at KnowBrainer. Thanks so much for your help and especially your patience. Tee Quote Link to comment Share on other sites More sharing options...
mdoverman Posted January 22, 2019 Report Share Posted January 22, 2019 To call a Macro Express macro from Dragon the command is ShellExecute, not Shell. If calling from Knowbrainer, the Shell command is correct. Ex: Sub Main ShellExecute "c:\Program Files (x86)\Macro Express Pro 6\meproc.exe /AResults Lipid Panel" End Sub Quote Link to comment Share on other sites More sharing options...
Tee Hiett Posted January 22, 2019 Author Report Share Posted January 22, 2019 Thanks for the clearing this up. Tee Quote Link to comment Share on other sites More sharing options...
acantor Posted January 24, 2019 Report Share Posted January 24, 2019 Quote You might like to take a look at the very active KnowBrainer forum for reference when you have questions about Dragon. Funny you should mention the Knowbrainer forum. I have hung out on two sub-forums for 12 years, and have posted 3300 times. But I normally don't check other sub-forums, including "KnowBrainer Software and Support," where you got Edgar's helpful response. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.