Jump to content
Macro Express Forums

Right Click On A File?


Cory

Recommended Posts

I would love to be able to right click on a file in Windows Explorer and have an option in the menu for "ME processes" that would run a macro. I know I've seen pretty simply programs which add things to this list and I was wondering if anyone knew how.

 

Alternatively I wouldn't mind simply highlighting a file and then run a hotkey macro that would somehow gather the file name so I can do something with it.

Link to comment
Share on other sites

I assume you're using Windows XP.

 

In the example below, we're going to add a context menu item called "Me Macro" to ALL files!

 

- Run regedit.exe

 

- Navigate to HKEY_CLASSES_ROOT\*

(HKEY_CLASSES_ROOT is the first main branch in your registry)

 

- If the key called "shell" doesn't exist, add it (exclude the double quotes) by right-clicking on *, choosing New / Key.

 

- Right-click on "shell", and choose New / Key

 

- Type "Me Macro", then press ENTER (without the quotes)

 

- Right-click on "Me Macro", and choose New / Key

 

- Type "command", then press ENTER (without the quotes)

 

- Left-click on "command", then, in the right-hand pane, double-click on "Default"

 

- Type in the following, including the quotes:

"C:\Program Files\Macro Express3\MeProc.exe" /AContextMacro /VT1%1

 

Close Regedit.

 

Here's my ContextMacro macro:

 

Variable Restore All Variables
Text Box Display: (ContextMenu is now running! Parameter is %T1%)

Link to comment
Share on other sites

I followed your instructions to the letter and it looks like it might work but I think there might be somethig about Vista that is causing this not to work. When I right click I see the menu item but I get the error "Windows cannot access the specified device, path, or file. You may not have the appropriete permissions to access the item."

 

Any thoughts?

Link to comment
Share on other sites

Ah, a (too?) early take-up of Vista <g>!

 

Vista permissions are rather different to its predecessors, and I have not yet got any practical experience of how to avoid or resolve this type of problem. I think the real problem is that Vista, by default, does not grant you admin permissions - and I imagine that's what you need to change registry settings.

Link to comment
Share on other sites

I'm soooo excited about this and it's tantalizingly close. You're just teasing me, aren't you Paul? <g>

 

"C:\Program Files\Macro Express3\MeProc.exe" /AContextMacro /VT1:%T1

 

Is what I have in the key now per your instruction. It still returns blank. In the case that Vista was tossing in a greasy monkey wrench I tried it on a Server 2003 machine and got the same result. Are you sure about that syntax? The "%T1" seems an awkward way to end it. I tried "%T1%" and "%1" but still no luck. Any other ideas?

 

Also where can I find a list of command line switches? I see no reference to them in help or o the ME website. I'll keep cracking at it.

Link to comment
Share on other sites

I found it!!!!!! Paul you're my golden god for a day. Many thanks.

 

The syntax SB /VT:%1, not /VT:%T1

 

It works so cool now! My mind is boggling at the possabilities.

 

My problem was when it did not work initially I started changing things. One of the first things I tried was to remove the variable restore and like an idiot never put it back. Once I read the help file on the syntax I saw the need for it and put it back but was getting "T1" as the result. So I went back and tried the %1 trick and it worked perfectly. Still don't understand te restore variables thing but that's a subject for a seperate post.

 

Thank you very much Paul!

Link to comment
Share on other sites

My first attempt was this:

"C:\Program Files\Macro Express3\MeProc.exe" /AContextMacro /VT1%1

The only thing wrong was the missing colon immediately before the %1.

 

Then we got this:

C:\Program Files\Macro Express3\Meproc.exe" /AContextMacro /VT1:%T1

Here we have the mysterious appearance of an unwanted T in %T1.

 

I doesn't seem to matter how many times I checked my script (and I took a great deal of care) - I'm not perfect after all <g>!.

 

Paul you're my golden god for a day.

So I can't be God, because God, by definition, is perfect <g>!

Link to comment
Share on other sites

The syntax SB /VT:%1, not /VT:%T1

 

It works so cool now! My mind is boggling at the possabilities.

 

Is that now actually correct? Shouldn't the full line be

"C:\Program Files\Macro Express3\Meproc.exe" /AContextMacro /VT1:%1

not

"C:\Program Files\Macro Express3\Meproc.exe" /AContextMacro /VT:%1

as you are saying?

 

However, I've not got it working with either! Maybe I'll try rebooting...

 

--

Terry, West Sussex, UK

Link to comment
Share on other sites

The fisrt one is correct:

 

"C:\Program Files\Macro Express3\Meproc.exe" /AContextMacro /VT1:%1

 

This is highly cool. I't killing me becasue I have other things to work on now and I can't play with it yet...

Link to comment
Share on other sites

Hope you're still around Paul? Any idea why I may be unable to get your interesting technique working please?

 

I'm running XP Home (SP1)

 

The registry key is:

HKEY_CLASSES_ROOT\Shell\Me Macro\command

 

Its contents under '(Default)':

"C:\Program Files\Macro Express3\MeProc.exe" /AContextMacro /VT1:%1

 

Location of MeProc on my HD:

C:\Program Files\Macro Express3\MeProc.exe

 

But nothing has been added to the r-click context menu of any file in a Windows folder.

 

--

Terry, West Sussex, UK

Link to comment
Share on other sites

The registry key is:

HKEY_CLASSES_ROOT\Shell\Me Macro\command

Its contents under '(Default)':

"C:\Program Files\Macro Express3\MeProc.exe" /AContextMacro /VT1:%1

I didn't make any mention of that registry key! Please take a fresh look at my message of 27th February, especially to the lines between Run regedit.exe and Close Regedit

 

Let us know how you get on.

Link to comment
Share on other sites

I'm not sure what to tell you. If you followed the instructions it should work. Did you get an error or anything? Does a macro run when you do it? IOW do you see the 'running man' in the sytem tray? Break it apart. Try associating it with a simple macro that says "Hi there" and see if that runs. Let me see.... If you didn't have the macro loaded in your file it would tell you, so that can't be it. If it was a problem passing the var you would just get a blank like me. Mabye try altering the command in the registry ot try opening notepad or something simple. If it's not doing anything in ME then somethign must be wrong with your MeProc line. Try taking the string from the registry and running it from the Run line. Beyond that I have no idea. It's hard to remmotely troubleshoot a customer complaint like "It doesn't work".

 

What OS are you running?

Link to comment
Share on other sites

Is the whole post based on Vista?

Not at all. I composed it using XP Professional, but it should work as is under Windows 2000. Earlier than that I cannot guarantee <g>!

 

Have your macro simply display a dialogue box to show that it's running. If it still doesn't work, please do as follows:

- tell us what operating system you're using

- run regedit.exe

- export the contents of the registry key HKEY_CLASSES_ROOT\* to a file

- edit that file and copy its contents to the clipboard

- paste the clipboard text into your message

Link to comment
Share on other sites

I am using Windows XP Pro and got it to work. Follow the instructions in Paul's post on Feb 26 2007 (the second post in this thread) except use this:

"C:\Program Files\Macro Express3\Meproc.exe" /AContextMacro /VT1:%1
instead of this:
"C:\Program Files\Macro Express3\Meproc.exe" /AContextMacro /VT1%1
Note the addition of the :

 

You must also create a macro and the nickname of the macro must match the name you use in the /A parameter ('ContextMacro' in the example).

Link to comment
Share on other sites

Thanks for the help!

 

My OS is Windows XP Home.

I tried to run the command on the "RUN" line, but that doesn't work either.

 

Here is the info from the registry:

 

Windows Registry Editor Version 5.00

 

[HKEY_CLASSES_ROOT\*\Shell]

 

[HKEY_CLASSES_ROOT\*\Shell\Me Macro]

 

[HKEY_CLASSES_ROOT\*\Shell\Me Macro\command]

@="\"C:\\Program Files\\Macro Express3\\Meproc.exe\" /AContextMacro /VT1:%1"

 

Let m know what I am doing wrong....

 

Thanks!

 

Pat

Link to comment
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...