Jump to content
Macro Express Forums

Recommended Posts

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>"/>


               

Link to post
Share on other sites
  • Tee Hiett changed the title to Problem Using Dragon with Macro Express

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.

Link to post
Share on other sites

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

 

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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."

Link to post
Share on other sites

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

2019-01-12_16-28-00.jpg

Link to post
Share on other sites

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

 

Link to post
Share on other sites

1754305198_WorkingDragonscripts.thumb.jpg.6c1ea1d211da70fe242e006bb835357d.jpg

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
 

Link to post
Share on other sites
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.

 

 

Link to post
Share on other sites
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.

 

Link to post
Share on other sites

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.

Link to post
Share on other sites

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

 

 

Link to post
Share on other sites

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

Link to post
Share on other sites
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.

   

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...