[MacEd] Tip to create buttons for a macro.

Biju G C bijumaillist at yahoo.com
Thu Dec 18 21:17:35 EST 2003


Install "External Application Buttons" a extension  by Torisugari 
http://texturizer.net/thunderbird/extensions/#externalapp
http://texturizer.net/firebird/extensions/#externalapp

locate externalapp.jar file

edit \content\externalapp\externalapp.js in externalapp.jar


==== find for =============

	launch :function(path,argumentstext){
		try{
			if(path=="") return false;

			var file = Components.classes['@mozilla.org/file/local;1']
							.createInstance(Components.interfaces.nsILocalFile);
			var process = Components.classes['@mozilla.org/process/util;1']
							.getService(Components.interfaces.nsIProcess);

==== find for end =============


insert following after "if(path=="") return false;"

			if (path.replace(/^\s*/,'').search(/macro:/i) == 0)
			{ 
			 try{
				eval(path.replace(/^\s*/,'').substr(6));
			 }catch(e){ alert(e);}
			 return true;
			}



================== modified code ==============
	launch :function(path,argumentstext){
		try{
			if(path=="") return false;
			
                        if (path.replace(/^\s*/,'').search(/macro:/i) == 0)
			{ 
			  try{
                              eval(path.replace(/^\s*/,'').substr(6));
			  }catch(e){ alert(e);}
			  return true;
			}

			var file = Components.classes['@mozilla.org/file/local;1']
							.createInstance(Components.interfaces.nsILocalFile);
			var process = Components.classes['@mozilla.org/process/util;1']
							.getService(Components.interfaces.nsIProcess);

================== modified code ends ==============



Now "External Application Buttons" a extension  ready to run Macros

So add a new "Ext App" button using the extension.
It will ask for a application path.
Provide an application to get a "good Icon"
it will create a button.

now modify the button propeties

Application path as "macro:alert('hello');"

click the button to see whether it is working!!
If it is working

modify Application path as "macro:MacroMenu.oncommand(30);"

to call Macro number 30

*** You are not limited to call MacroEditor Macro.          *** 
*** You can do any function calls available on that window  *** 



________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html


More information about the MacroEditor mailing list