External Applications

5 replies [Lasta afiŝo]
Joined: 07/27/2007
Afiŝoj: 32
User offline. Last seen 2 jaroj %count semajnoj ago.

Behavior

Action Behavior

Left

Opens menu of applications (and/or URL's)

Revizioj

修訂版本 操作
03/30/2009 - 21:00 由 admin 發表

added version that supports submenus and links.

目前的修訂版本
03/19/2009 - 10:36 由 admin 發表

Update URL/App version again. Didn't take the first time.

03/16/2009 - 10:32 由 mike 發表

Added the URL link version

03/04/2009 - 17:47 由 mike 發表

update compatibility field

02/28/2009 - 17:55 由 makondo 發表

Moved Post

Kodo

javascript: Copy To Clipboard
/*Code*/

Init

javascript: Copy To Clipboard
var apps=new Array;
//------menu items--------
var expImg=this.image;
var calImg=this.image;
var ieImg=this.image;
var npImg=this.image;
var cmdImg=this.image;
var TBImg=this.image;
var cpImg=this.image;
var epImg=this.image;
 
apps.push(['Explorer',expImg,'c:/windows/explorer.exe']);
apps.push(['Calculator',calImg,'C:/WINDOWS/system32/calc.exe']);
apps.push(['Cmd Prompt',cmdImg,'C:/WINDOWS/system32/cmd.exe']);
apps.push('separator');
apps.push(['IE',ieImg,'c:/Program files/Internet Explorer/IEXPLORE.EXE']);
apps.push(['Notepad',npImg,'c:/windows/notepad.exe']);
apps.push(['Control Panel',cpImg,'C:/WINDOWS/system32/control.exe']);
apps.push(['Thunder bird',TBImg,'D:/softwares installed here/Thunder Bird 1.5/thunderbird.exe']);
apps.push(['Edit Plus',epImg,'C:/Program Files/EditPlus 2/editplus.exe']);
 
//------menu items-------
var nMItem=function(label,img,path,args,obj){
  var m=document.createElement('menuitem');
  m.setAttribute('label',label);
  m.f=obj.startProcess.bind(obj);
  m.setAttribute('oncommand','this.f("'+path+'","'+args+'")');
  m.setAttribute('class','menuitem-iconic');
  m.setAttribute('image',img);
  m.tooltipText = label;
  return m;
}
this.startProcess=function(path,args){
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);
 file.initWithPath(path.replace(/\//g,'\\\\')); 
 file.launch();
}
 
this.orient="horizontal";
var mP=document.createElement('menupopup');
for (var i=0;i<apps.length;i++){
 if (apps[i] =='separator'){
  mP.appendChild(document.createElement('menuseparator'));
 }else{
  if (!apps[i] [3]) apps[i] [3]='';
  mP.appendChild(nMItem(apps[i] [0],apps[i] [1],apps[i] [2],apps[i] [3],this));
 }
}
this.appendChild(mP);
this.type='menu';
 
/*---------------------- Show Focus Block Start ------------------------*/
 
this.style.opacity = '.65';
this.setAttribute('onmouseover', 'custombuttons.ButtonBrt(event);' );
this.setAttribute('onmouseout', 'custombuttons.ButtonDim(event);' );
 
/*----------------------- Show Focus Block End -------------------------*/
/*--------------- Custom Buttons2 Attributes Block Start ----------------*/
this.setAttribute('author','deepakjoshi04');
this.setAttribute('version','null');
this.setAttribute('homepage', 'http://custombuttons2.com/forum/buttons/buttons-database/external-applications.html');
this.setAttribute('dependency','null');
this.setAttribute('status','null');
this.setAttribute('public',true);
this.setAttribute('help','0,null');
// this.tooltipText += '';
 
/*---------------- Custom Buttons2 Attributes Block End -----------------*/

Helpo

null

Detaloj

Button Categories: 
Replaces Extension(s): 
Top
Joined: 04/11/2009
Afiŝoj: 3
User offline. Last seen 1 jaro %count semajnoj ago.

This is a great button. Is it possible to tweak it to allow for Thunderbird commands, for example SelectFolder or goDoCommand. I've no idea how.

Thanks,

WB

Custom Buttons² v.3.0.0

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20

Posted with the theme Pluralism

Top
bildo de jonconnelly
Joined: 03/18/2009
Afiŝoj: 4
User offline. Last seen %count semajnoj 1 tago ago.

So the line of code to launch notepad for example is:

apps.push(['Notepad',npImg,'c:/windows/notepad.exe']);

Now npImg is a variable that calls up the icon, but each one external app variable is the same, with this.image as the value, ie

var npImg=this.image;

How do I go about and set the variable to a locally stored image? It seems to always use the base64 image for the primary custom button.

Custom Buttons² v.3.0.1

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 (.NET CLR 3.5.30729) FirePHP/0.2.4

Posted with the theme Pluralism

Top
bildo de mike
Joined: 02/01/2009
Afiŝoj: 326
User offline. Last seen %count semajnoj %count horoj ago.

You should be able to do:

javascript: Copy To Clipboard
var newimg = "base64img....";
apps.push(['Notepad',newimg,'c:/windows/notepad.exe']);

just data:uri encode (base64) your image by using the field in the button editor and copying the string out of it.

Custom Buttons² was not found: find out why...

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042513 Ubuntu/8.04 (hardy) Firefox/3.0.10

Posted with the theme Pluralism

Top
Joined: 08/09/2008
Afiŝoj: 5
User offline. Last seen %count semajnoj %count tagoj ago.

I had this problem in the past and I dont know how it was resolved but it is happening again and it's really annoying...

I installed this button and then I want to change the apps it opens. I know exactly how to do this and it is really simple. I used to have it working with all different apps so I really do find it easy and I am 100% that I am not actually breaking anything in the code as I am only changing the apps path string. I am also making sure the /slashes/ are the correct way round!
Yet after I change it, the button does nothing. Absolutely zero when it is clicked.
So I restart FF. What I get after that, and from no won, is that the button is dulled a bit and again, no response comes from clicking.
I cannot even SHIFT-CLICK sometimes either so I really get no response!
Can anyone help me here???

Custom Buttons² v.3.1.0

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( )

Posted with the theme Pluralism

Top
bildo de jw25
Joined: 08/17/2008
Afiŝoj: 69
User offline. Last seen 1 horo %count sek ago.

Post the code here or post the button in the graveyard so we can look at it and possibly find the trouble.

Custom Buttons² v.3.1.0

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Ant.com Toolbar 2.0.1 Firefox/3.0.3, ( .NET CLR 3.5.30729)

Posted with the theme Pluralism

Top