KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Run Macro-Works in AddressBar & Run but...
Topic Summary:
Created On: 01/09/2022 02:56 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Run Macro-Works in AddressBar & Run but...   - Robert Snow - 01/09/2022 02:56 PM  
 Run Macro-Works in AddressBar & Run but...   - Edgar - 01/10/2022 10:52 AM  
 Run Macro-Works in AddressBar & Run but...   - Robert Snow - 01/10/2022 12:06 PM  
 Run Macro-Works in AddressBar & Run but...   - Robert Snow - 01/10/2022 05:05 PM  
 Run Macro-Works in AddressBar & Run but...   - Robert Snow - 02/12/2022 05:26 PM  
Keyword
 01/09/2022 02:56 PM
User is offline View Users Profile Print this message

Author Icon
Robert Snow
Advanced Member

Posts: 185
Joined: 04/18/2017

I'm conquering OneNote using the following  macro. I have created close to 200 macros that give me total control over OneNote. I'm using code that you helped me with over a year ago. The base for macro:

 

SubMain
AppBringUp "onenote:///B:\!MS\!OneNote\!MST-SYS\MacroX\!Dragon\ASK-Dragon.one#section-id={A5644D4C-897A-4CB4-B98F-98DF98477104}&end"
Wait 5.35
AppBringUp
"www.knowbrainer.com/forums/forum/categories.cfm?catid=12&entercat=y"
EndSub

 

Now I'm trying to get a little more control over my Opus, program. I'm using Dragon 15.61 to create macro. The code, C:\Program Files\GPSoftware\Directory Opus\dopus.exe /cmd Prefs LAYOUT=opusComputer, works in Run Command but not Dragon.  I get this error, PLEASE, correct syntax errors before saving a macro. This is the Dragon macro:

 

SubMain
    ShellExecute "C:\Program Files\GPSoftware\Directory Opus\dopus.exe /cmd Prefs LAYOUT=opusComputer"
EndSub

 

Opus uses this code (LAYOUT=opusComputer ).
Layout = A window in opus with the name "Computer".  I use many Layout's for different looks. In this case I''m loading the program Opus with a Layout called "Computer". I suspect my problem might be the use of "ShellExecute", just a guess. 

 

If it's a path issue here are my paths:

C:\Program Files\GPSoftware\Directory Opus\

C:\Users\ameri\AppData\Roaming\GPSoftware\Directory Opus\Layouts\Computer.oll

 

My plan is to load Opus when I run the above macro, when loading OneNote & Google Chrome, which works great.

 

Bob

PS What is it when Dragon uses v Opus?



-------------------------

Robert Snow
Germantown, WI



 01/10/2022 10:52 AM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1260
Joined: 04/03/2009

Originally posted by: Robert Snow 

 

SubMain    

ShellExecute "C:\Program Files\GPSoftware\Directory Opus\dopus.exe /cmd Prefs LAYOUT=opusComputer"

EndSub

 

the above statement might have a problem with the forward slash in front of "cmd" (/cmd) - may need to be escaped: "//cmd"

ShellExecute "C:\Program Files\GPSoftware\Directory Opus\dopus.exe //cmd Prefs LAYOUT=opusComputer"

A more universal answer to your underlying question "This works in Run but will not compile/work as a ShellExecute statement - what is wrong?" is…

Virtually anything that you can use in the Run dialog (or on the CLI) can be used in a batch file (FileName.BAT). This kind of file can be created with almost any text editor (Notepad, PSPad etc), just force the extension when you go to save the file.

In this case you will want to create a batch file with single line:

START "C:\Program Files\GPSoftware\Directory Opus\dopus.exe //cmd Prefs LAYOUT=opusComputer"

for this example, let's name this batch file "runOpus.bat" and save it on your Desktop (eventually, you could name it anything as long as it has the "bat" extension and save it anywhere Dragon has file access). Now, change your existing Dragon command so that the line:
ShellExecute "C:\Program Files\GPSoftware\Directory Opus\dopus.exe /cmd Prefs LAYOUT=opusComputer"
reads:
ShellExecute C:\Users\<USER_NAME>\Desktop\runOpus.bat

(replace "<USER_NAME>" with your actual username).



-------------------------

-Edgar
DPI 15.3, 64-bit Windows 10 Pro, OpenOffice & Office 365, Norton Security, Shure X2U XLR to USB mic adapter with Audio Technica DB135 vocal mic, Asus X299-Deluxe Prime, Intel Core i9-7940X (14 core, 4.3 GHz overclocked to 4.9 GHz), G.SKILL TridentZ Series 64GB (4 x 16GB) DDR4 3333 (PC4 26600) F4-3333C16Q-64GTZ, NVIDIA GIGABYTE GeForce GTX 1060 GV-N1060G1 GAMING-6GD REV 2.0 6GB graphics card with 3 1920x1080 monitors

 01/10/2022 12:06 PM
User is offline View Users Profile Print this message

Author Icon
Robert Snow
Advanced Member

Posts: 185
Joined: 04/18/2017

Than you Edgar.

>>SubMain
ShellExecute "C:\Program Files\GPSoftware\Directory Opus\dopus.exe //cmd Prefs
LAYOUT=opusComputer"
EndSub<<

 

I no longer get the error and can save it in the Dragon - Command Browser. But voice will not load it. I'm still trying to find the issue.

>>In this case you will want to create a batch file with single line:
reads: ShellExecute C:\Users\\Desktop\runOpus.bat (replace "" with your actual username).<<

 

I'm a bit confused on the the batch file naming convention. What I understand I create a file, text, and name it ????.bat and place it on my desktop. The name I create for the batch file can be anything that ends with .BAT The batch file will contain a single line:
ShellExecute "C:\Program Files\GPSoftware\Directory Opus\dopus.exe //cmd Prefs
LAYOUT=opusComputer". 

 

I can now execute the file with the mouse or by voice command. This will give me the answer, as to if the command works are not. It would be taking something out of the scenario that might be an issue.

 

Bob

 

 



-------------------------

Robert Snow
Germantown, WI



 01/10/2022 05:05 PM
User is offline View Users Profile Print this message

Author Icon
Robert Snow
Advanced Member

Posts: 185
Joined: 04/18/2017

I was able to do the following. Using the RUN command.

"C:\Program Files\GPSoftware\Directory Opus\dopus.exe" (Works but only halfway)
Doing it this way opens only the Opus program without the lister. Lister defines how I want Opus to look like and what directories I want to appear.

 

"C:\Program Files\GPSoftware\Directory Opus\dopus.exe //cmd Prefs LAYOUT=opusComputer" (Not at All, nothing opens)

It seems to have a problem with //cmd Prefs LAYOUT=opusComputer

Bob



-------------------------

Robert Snow
Germantown, WI

 02/12/2022 05:26 PM
User is offline View Users Profile Print this message

Author Icon
Robert Snow
Advanced Member

Posts: 185
Joined: 04/18/2017

Been some time but I never give up. Here isx what I did:

 

Both files are on my desk top.

File1 FileName-Opus.bat

I click on to exacute:

ShellExecute C:\Users\ameri>\Desktop\runOpus.bat (Saved as a bat file)

 

File2 FileName-runOpus.bat

Receives action from File1

ShellExecute "C:\Program Files\GPSoftware\Directory Opus\dopus.exe //cmd Prefs LAYOUT=opususerlocal" (bat File)

 

I tried, File2, with //cmd and also /cmd

Bob



-------------------------

Robert Snow
Germantown, WI

Statistics
32285 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 0 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 526 guests browsing this forum, which makes a total of 526 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2022 FuseTalk™ Inc. All rights reserved.