Help with macro for mouse menu items

pajenn's picture

I've attached a pic of my Windows Explorer context menu that pops up when I select a file or folder and right click on it. Moving the mouse cursor to the "FileMenu Tools" has activated the submenu with further options. I want to write a macro that would execute the 'copy path' option when I say 'copy path':
So something like this using Natlink/Vocola:

Copy Name = {Mouse Right Click} Wait(100) {"FileMenu Tools"} Wait(100) {"Copy Name"} ;

except that I'm unclear on how to call for menu items in scripting language. Please help me get this to work. It almost works when I say it out loud, except DNS/Natlink doesn't recognize "FileMenu Tools" - but saying a menu item name when a menu is open seems to work for me in general.

Also, I'm currently writing this as a global command instead of a Windows Explorer command, because when I say "Edit Windows Explorer Voice Commands," or variations of it, nothing happens, what's the problem?

Thanks in advance.

AttachmentSize
Mouse_Items.jpg50.68 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Quote: Also, I'm currently

Quote:

Also, I'm currently writing this as a global command instead of a Windows Explorer command, because when I say "Edit Windows Explorer Voice Commands," or variations of it, nothing happens, what's the problem?

How about simply opening Windows Explorer and simply saying "edit Voice Commands".that should get you to where you want to be.

As for trying to get the path with your mouse, might it not be simpler to simply use the Alt-D shortcut to get the path .. assuming that you are showing the full path in the address bar?

Another option would be to use the Shift-F10 hotkey to bring up the context menu and setup your menu option to have a unique hotkey of its own.

something like = {Shift+F10} 'o'; or simply count down and {Enter}

Copy Path and Filename = {Alt+f}m{Ctrl+c}{Alt+d}{Right}\{Ctrl+v}{Home}{Shift+End}{Ctrl+c}{Esc};

Mark

pajenn's picture

MarkUK wrote: Quote: Also,

MarkUK wrote:
Quote:

Also, I'm currently writing this as a global command instead of a Windows Explorer command, because when I say "Edit Windows Explorer Voice Commands," or variations of it, nothing happens, what's the problem?

How about simply opening Windows Explorer and simply saying "edit Voice Commands".that should get you to where you want to be.

Doh! yes, of course you are right, I just got confused... thank you.

Quote:

As for trying to get the path with your mouse, might it not be simpler to simply use the Alt-D shortcut to get the path .. assuming that you are showing the full path in the address bar?

Another option would be to use the Shift-F10 hotkey to bring up the context menu and setup your menu option to have a unique hotkey of its own.

something like = {Shift+F10} 'o'; or simply count down and {Enter}

Copy Path and Filename = {Alt+f}m{Ctrl+c}{Alt+d}{Right}\{Ctrl+v}{Home}{Shift+End}{Ctrl+c}{Esc};

Mark

I was using the wrong command for mouse clicks. I now have this, which works for the test subject:

Quote:

# Voice commands for explorer

test this = ButtonClick(2,1) Wait(100) {Down_13} {Right_1} {Down_7} {Enter};

However, I'm pretty sure the items and their arrangement on my context menu changes depending on the context, so I need to find out how to get natlink/vocola to select an item from the menu using the item's name. Your way would probably be simpler for the 'Copy Path' command, but I want to repeat this method for each frequently used item on my mouse menu, and maybe use it in other mouse applications, so that's the problem.

pajenn wrote: However, I'm

pajenn wrote:

However, I'm pretty sure the items and their arrangement on my context menu changes depending on the context

Well, yes, at least the contents can change, although I doubt their arrangement does also.

The way to handle this is a different script for each context. For example, one script for Desktop use, another for FireFox (or even Foxfire, if you use that variant;-)

If Vocola can detect these changes automagically, I may have to go through the considerable hassle of figuring out what the installation package du jour might be Smiling

Bruce

pajenn's picture

BruceCyr wrote: pajenn

BruceCyr wrote:
pajenn wrote:

However, I'm pretty sure the items and their arrangement on my context menu changes depending on the context

Well, yes, at least the contents can change, although I doubt their arrangement does also.

The way to handle this is a different script for each context. For example, one script for Desktop use, another for FireFox (or even Foxfire, if you use that variant;-)

If Vocola can detect these changes automagically, I may have to go through the considerable hassle of figuring out what the installation package du jour might be Smiling

Bruce

Start hassling because I just discovered the MenuPick() command. This works:

# Voice commands for explorer
test this = ButtonClick(2,1) Wait(100) MenuPick("FileMenu Tools") {Right_1} MenuPick("Copy Path");

I still need to get DNS to accept the voice command as "copy path" instead of "test this" of course - the later worked, but when I tried to switch the command name DNS confused it with other "copy" commands at first and then crashed...

But that MenuPick() command is gold. I could not figure out the arrow keys for each possible context menu combination because they are not only application specific, but also target specific. For example, if I click on a .dll-file, the "Register/Unregister this Component" tabs show up on top. If I click on a folder, the Open tab will be on top, etc.

pajenn wrote: BruceCyr

pajenn wrote:
BruceCyr wrote:
pajenn wrote:

However, I'm pretty sure the items...arrangement on my context menu changes depending on the context

Well, yes, at least the contents can change, although I doubt their arrangement does also.

If Vocola can detect these changes automagically, I may have to go through the considerable hassle of figuring out what the installation package du jour might be Smiling

Bruce

Start hassling because I just discovered the MenuPick() command. This works:

Sorry, MenuPick() is an Advanced Scripting Extension that derives, I think, from DNS's predecessor, DragonDictate -- you know, back when PC's still had floppy drives Smiling If you did have Pro at some time it seems you scarcely bothered to explore it!

No, I meant if Vocola could detect such changes and present them to you as parameters you could use.

BTW, I still claim that the arrangements are constant for a given window.

Bruce

admin's picture

The one thing that seems to

The one thing that seems to be missing from your attachment image are the underlined keyboard shortcut characters. Have they been removed or turned off? Usually the underlined keyboard shortcut characters are unique, which is why I mention them.

pajenn's picture

Dunno. I have the underlined

Dunno. I have the underlined letters in Firefox, MS Office applications, and various other programs, but I'm not sure if they used to be present in Windows Explorer, or when they disappeared.

I removed MSM apps, Games, Accessibility options, Windows Tour, Net meeting, Movie Maker and all the other Windows XP components that I never use, so maybe I lost the unlined shortcuts during one of those operations...

The display of accelerator

The display of accelerator key underlining is controlled via an option in "Control Panel | Display | Effects" in WXP. Probably something similar in Vista.

Bruce

pajenn's picture

So I got the mouse context

So I got the mouse context menu items to work, EXCEPT for the "FileMenu Tools":

Here's the code:

# Voice commands for explorer

A. two this = ButtonClick(2,1) Wait(400) {Down_1} ActiveMenuPick("Scan with a-squared Free") ;
Fast Copy this = ButtonClick(2,1) Wait(400) {Down_1} ActiveMenuPick("FastCopy") {Right_1} ActiveMenuPick("Copy");
Fast Delete this = ButtonClick(2,1) Wait(400) {Down_1} ActiveMenuPick("FastCopy") {Right_1} ActiveMenuPick("Delete");
get Properties [for] this = ButtonClick(2,1) Wait(200) {Down_1} ActiveMenuPick("Properties") ;

get Path [to] this = ButtonClick(2,1) Wait(400) {Down_1} ActiveMenuPick("FileMenu Tools") {Right_1} ActiveMenuPick("Copy Path");

Rename this = ButtonClick(2,1) Wait(400) {Down_1} ActiveMenuPick("Rename") ;
Scan this = ButtonClick(2,1) Wait(400) {Down_1} ActiveMenuPick("Scan with Rising Antivirus") ;
Shred this = ButtonClick(2,1) Wait(400) {Down_1} ActiveMenuPick("Rising File Shredder") ;
Uniview this = ButtonClick(2,1) Wait(400) {Down_1} ActiveMenuPick("Universal Viewer") ;
Uniextract this = ButtonClick(2,1) Wait(400) {Down_1} ActiveMenuPick("UniExtract Files...") ;
Uniextract [this] here = ButtonClick(2,1) Wait(400) {Down_1} ActiveMenuPick("UniExtract Here") ;
Unlock this = ButtonClick(2,1) Wait(200) {Down_1} ActiveMenuPick("Unlocker") ;
Unzip this = ButtonClick(2,1) Wait(300) {Down_1} ActiveMenuPick("7-Zip") {Right_1} ActiveMenuPick("Open archive");
Unzip [this] here = ButtonClick(2,1) Wait(400) {Down_1} ActiveMenuPick("7-Zip") {Right_1} ActiveMenuPick("Extract Here");

They all have the same structure, and even the ones with submenus work fine, so what's the problem with "FileMenu Tools"?

When I try it, DNS gives me the following error message:

"Cannot find menu item with caption 'FileMenu Tools'. Please try again."

and under Details>>

"at line 1 in script execScript"

fwiw, it worked briefly when I tested it (with the 'test this' command), but then when I tried to change it, DNS got confused, and later crashed. Now I can get it to recognize "FileMenu Tools" anymore.

Any advice would be appreciated.

Also, should I add program names like "FileMenu" to the list of words?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Syndicate content