Jump to content
Macro Express Forums

Right Click Context Menu


Recommended Posts

Hello all.

 

I was looking at this link in the older forum: http://pgmacros.invisionzone.com/index.php?showtopic=1787&hl=right+click and tried to get it to work with ME Pro. Here is what I have in the registry:

 

"C:\Program Files\Macro Express Pro\Meproc.exe" /AOpen CNN.com /VT1:%1 and it's not working.

 

Is there anything different with ME Pro that I need to know?

 

Pat

Link to comment
Share on other sites

Kevin,

 

That's a very nice macro. However, I am trying to add a context menu entry to Internet Explorer and I want it to show itself only when you highlight text in Internet Explorer. I know how to do this, but my command line is wrong. Can you take a look at it again?

 

I just need to know if my command line in my first post is wrong. If so, what is the correct command line to put in the registry?

 

Thanks again Kevin.

 

Pat

Link to comment
Share on other sites

I'd be concerned about what T1 means and how you are using it %T1% or %T[1]%. From the descriptions in Command Line Help it seems like your variable is %T1% verbatim, even though T1 would normally be expressed as %T[1]% in MEPro.

 

(edit) My interpretation is that when macro "Open CNN.com" runs %T1% = %1

If you wrote "Open CNN.com" assuming %T[1]% would be set to %1 you are out of luck. You have to change the Command Line statement or the variable. I don't know if [] are permitted characters in Command Line.

Link to comment
Share on other sites

Thanks John,

 

Actually, I took it straight from the link. I was able to make it work with ME3, but not this version. I didn't see anywhere in the old post(am I an old man!! Ha) that T1 had any significance as a Macro variable in the prior post. I think it's a trigger for the command line rather than something for ME. I could be wrong though. I will give it a shot.

 

Pat

Link to comment
Share on other sites

From a quick examination of that thread, "/VT1:%1" is used to transfer the filename selected in Windows Explorer into T1 for use in the ContextMenu macro. I've no idea what you are up to with "Open CNN.com" so I'll leave further comment to those more involved back then.

 

Don't forget to add Variable Restore Text Variables at the start of "Open CNN.com" to input T1, if that is what is intended. It does not sound as though you are sure what to do with T1, given your comments.

 

If you imported any of the Context Menu macros from 3x into MEPro, the variables would be converted to the Pro format [ ]. I suspect "/VT1:%1" was not converted because T1 is not encased in %%, which I assume is used as a signpost for variables needing conversion.

Edited by JohnS
Link to comment
Share on other sites

For anyone that is interested, to add a context menu to Internet Explorer, this is the Registry address: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt.

 

I am still not able to get it to work with the parameters above. It appears you do not have to add a Command key like the prior forum post, but nonethless, it still does not work.

 

Is anyone any expert in this? I followed Microsoft's suggestion on theie website and it's still not working. I am dying to find out how this works. It would make my life so much easier.

 

Thank you in advance!

 

Pat

Link to comment
Share on other sites

The technique works for both Macro Express and Macro Express Pro. It has been tested on Windows XP and Windows 7. (Since it works on Windows 7 it is likely to run on Windows Vista.) The sample macro Context Menu Macros demonstrates its use. Try the sample macro, look at the comments in the macro and your questions should be answered.

 

For it to work, information must be passed from Windows Explorer to Macro Express Pro. This is done via variables. Some of the parameters you are seeing are used to pass the path name of the file you click to a Macro Express Pro variable. The 'How it works' paragraph on the Context Menu Macros page describe how it works.

Link to comment
Share on other sites

Remember we are talking about Internet Explorer, not Windows Explorer. I'm not even sure if you can run an exe from IE due to browser security.

 

In the context menu registry key for IE you normally have a default subkey with the URL of the page the script is on (assumed normally JScript etc) and another subkey DWORD "Contexts" set to 0x10 (16) to so the context item appears when text is selected in the browser.

 

It's beyond my current knowledge. I have no idea how you get ME to run, especially with all the switches which may not be recognized by Javascript. Could be you go to Javascript to run a bat file to run the ME macro.

 

(edit) I got as far as opening Notepad from IE, whoopee doo!

 

Key HKCU\Software\Microsoft\Internet Explorer\MenuExt\Macro Express

subkey default, string, file:///D:/Temp/jsietofilejohns.htm

subkey Contexts DWORD 0x10(16)

Change key name and filepath to suit

 

jsietofilejohns.htm:

<html> 
<head> 
 <script language="JavaScript" type="text/javascript">  
	 WshShell = new ActiveXObject("WScript.Shell");
	 WshShell.Run("notepad");
</script> 
</head> 
</html>

 

(edit2) Got to 2nd base by running an .mxe file, per above but:

WshShell.Run("file://d:/Temp/Hello.mxe");

Same file in MEPro folder:

WshShell.Run("file:///C:/Program%20Files/Macro%20Express%20Pro/Hello.mxe");

 

 

(edit3) To make things more generic using the MEPro folder the above settings would be:

 

Key HKCU\Software\Microsoft\Internet Explorer\MenuExt\Macro Express (to make "M" the shortkey, name key "&Macro Express")

subkey default, string, file:///C:/Program Files/Macro Express Pro/jsietofilejohns.htm

subkey Contexts DWORD 0x10(16) (selected text per requirement this thread)

(see this link for context logical OR settings)

 

jsietofilejohns.htm:

<html> 
<head> 
 <script language="JavaScript" type="text/javascript">  
	 WshShell = new ActiveXObject("WScript.Shell");
	 WshShell.Run("file:///C:/Program%20Files/Macro%20Express%20Pro/Hello.mxe");
</script> 
</head> 
</html>

There may be other and better ways of doing this. As stated previously I have no idea at the moment how to run an .mex with Command Line parameters. I don't think you can run Command Line from Javascript for security reasons.

Edited by JohnS
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...
 Share

×
×
  • Create New...