Extensions :  K-Meleon Forum
All about K-Meleon extensions. 
Running a program from HTML problem
Posted by: Binary
Date: February 20, 2010 11:49AM

Hello!

When I try to run a local program by clicking a link from an html file this error message appears:

"g:\notepad.exe could not be opened,because an unknown error occurred. Try saving to disk first and then opening the file."



In Internet Explorer works but in K meleon doesn't work.
Is there a way to make it work?

Thanks!

Options: ReplyQuote
Re: Running a program from HTML problem
Posted by: disrupted
Date: February 20, 2010 12:35PM

no way, you can never do that in any gecko browser or a proper browser.
geckos will never allow opening executables directly from links.. this is a security measure. ie ..things are different and not secure even if it's a local file.

why do you want to open notepad from a link? you can launch anything from inside kmeleon through macros and do not need an html-based launcher.

post the path to the program you're trying to run and you'll get a custom macro

Options: ReplyQuote
Re: Running a program from HTML problem
Posted by: Binary
Date: February 21, 2010 01:14AM

I use very few programs and what I wanted to do is replacing Windows Explorer with K-meleon as a GUI for simplicity and speed.
The Home page on k-meleon had several links that lunch the programs that I used the most.( And yes replacing Windows Explorer with almost anything works )
This is what I had in mind.


The paths that I used are:

\G:\Explorer++.exe.lnk\
\G:\Internet.lnk\
\G:\Foxit Reader.exe.lnk\
\G:\Ultra Defrag.lnk\
\G:\ImgBurn.exe.lnk\
\G:\smplayer_portable.exe.lnk\
\G:\Notepad++.lnk\

... Notepad was just an example.

I'm not familiar with macros in k-meleon , if I could lunch my programs from a menu or buttons that would be even better smiling smiley . Is that what you had in mind?

Options: ReplyQuote
Re: Running a program from HTML / start programs from browser / menu icons buttons
Posted by: siria
Date: February 21, 2010 02:28AM

Sounds like you're trying to replace the Quick Launch bar with browser buttons and menu??
Technically no problem (if you know a bit macro coding cool smiley, but luckily disrupted already volunteered to help grinning smiley).
Just a tip, while waiting, if you'd also like pretty icons in the new menu, or buttons, you can already start collecting your icons into a bmp-line, like the bmp's in the skin folders smiling smiley Rather easy if you copy one of those (perhaps menu.bmp), open the copy in MS Paint, then copy the icons e.g. from the quicklaunch bar. The size for menu icons must be the same as in other menus (16x16 or 24x24px? check menu.bmp), the size for buttons is free, since you probably use an own toolbar for them anyway. The icon background gets transparent if you use that magic pink from the other toolbars.
To make it easier to keep the right width I usually add a 2 pixel high line with width markings at the bottom, which is "off-size" (16x18px) and so doesn't show later. Example: http://kmeleon.sourceforge.net/forum/read.php?10,97029

But replacing the FILE explorer with a browser, that's too weird, do you find that really easier?? surprised smiley
How do you do anything like deleting, creating, renaming, sorting by date etc.???

Options: ReplyQuote
Re: Running a program from HTML / start programs from browser / menu icons buttons
Posted by: Binary
Date: February 21, 2010 04:34AM

Thanks for the tip!

Quote

Technically no problem (if you know a bit macro coding cool smiley, but luckily disrupted already volunteered to help grinning smiley).

Anything will do it , and I don't mind getting my hands "dirty".

Quote

But replacing the FILE explorer with a browser, that's too weird, do you find that really easier?? surprised smiley

Yep! smiling smiley

I already did that with several file managers , and other programs like console programs , web browsers and other stuff.

But I got 2 operating systems installed , just in case... smiling smiley

Im bored of the old "start menu , windows , task bar etc." look of windows and unfortunately all operating systems look alike . I spend a lot of time wrestling with the GUI instead of getting my job done fast.


Quote

How do you do anything like deleting, creating, renaming, sorting by date

I can delete , move and rename any file on my HDD from the window that pops up when I chose "File > Open" in K-meleon.

When I really need to open programs that are not on my list or open Control Panel I use Explorer++ (file manager) for that.

Options: ReplyQuote
Re: Running a program from HTML / start programs from browser / menu icons buttons
Posted by: disrupted
Date: February 21, 2010 04:40AM

hello binary, those are shortcuts not the actual paths but it's no problem, you will need to edit a few things yourself and that;s good cause this way you can learn macro easily and then share your macros with everybody

first download this 7z package:
http://kmext.sourceforge.net/tests/alexapplauncher.7z

you can extract it with 7z program etc. extract it in your kmeleon install folder

inside the package you will find 2 files inside 2 folders:
this file called alexapps.kmm should be saved in kmeleon\macros folder
and the bitmap axapp.bmp should be saved inside a folder called default inside the skins folder.

extracting with 7z will automatically send those files to their proper folders or you can use the extensions manager

after extracting, open alexapps.kmm in notepad, it's a simple text file.
it will look like this:

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# --------alex app launcher: shortcuts to applications

alexapp01{
exec("\"c:\\windows\\notepad.exe[/color]"");
}

alexapp02{
exec("\"C:\\Program Files\\Internet Explorer\\IEXPLORE.exe[/color]"");
}

alexapp03{
exec("\"C:\\Program Files\\Windows Media Player\\wmplayer.exe[/color]"");
}

alexapp04{
exec("\"c:\\windows\\notepad.exe\"");
}

alexapp05{
exec("\"c:\\windows\\notepad.exe\"");
}

alexapp06{
exec("\"c:\\windows\\notepad.exe\"");
}

alexapp07{
exec("\"c:\\windows\\notepad.exe\"");
}

alexapp08{
exec("\"c:\\windows\\notepad.exe\"");
}

alexapp09{
exec("\"c:\\windows\\notepad.exe\"");
}

alexapp10{
exec("\"c:\\windows\\notepad.exe\"");
}

alexapps_BuildMenu{
setmenu("&Tools",inline,alex_apps,3);
setmenu(alex_apps,popup,"App Launchers");
setmenu("App Launchers",macro,"Application 1",alexapp01);
setmenu("App Launchers",macro,"Application 2",alexapp02);
setmenu("App Launchers",macro,"Application 3",alexapp03);
setmenu("App Launchers",macro,"Application 4",alexapp04);
setmenu("App Launchers",macro,"Application 5",alexapp05);
setmenu("App Launchers",macro,"Application 6",alexapp06);
setmenu("App Launchers",macro,"Application 7",alexapp07);
setmenu("App Launchers",macro,"Application 8",alexapp08);
setmenu("App Launchers",macro,"Application 9",alexapp09);
setmenu("App Launchers",macro,"Application 10",alexapp10);
}

alexapps_BuildToolbar{
$alexappstip=_("quick launchers");
pluginmsg(toolbars,"AddToolbar","App Launchers,16,16","");
$extman=(pluginmsg(toolbars,"AddButton","App Launchers,alexapps,macros("."alexapp01"."),"."App Launchers".",".$alexappstip.",16,16,"."axapp.bmp[1],axapp.bmp[0]",""));
}

$OnInit=$OnInit."alexapps_BuildMenu;";
$OnSetup=$OnSetup."alexapps_BuildToolbar;";
# ----------------------------------------------
$macroModules=$macroModules."alexapps_launcher;";


this macro will create 2 tthings:
1- a pop menu inside the tools menu called 'app launchers'
2- a toolbar button that when right clicked will open that same app launchers menu

the red and blue parts are the ones you will need to edit, they are just an example template here

the red parts are the paths to your programs
for e.g c:\\windows\\notepad.exe can be replaced with a path to any program you like
like g:\\orbit downloader\\ordbit.exe
etc

just edit all the paths after the exec command with the paths your preferred programs, you have up to 10 programs

remeber, just edit the paths, do not remove any quotes
the macro paths is similar to registry path so you have to use double slashes not one slash

e.g.:
g:\orbit downloader\ordbit.exe < this is wrong
g:\\orbit downloader\\ordbit.exe <this is correct

the final string should look like this
exec("\"g:\\orbit downloader\\ordbit.exe\"");

the blue parts are the menu names that will appear inside the menu. there are restrictions here and you can enter any name you like..just make sure that ever one has a different name and don't forget the double quotes to contain the name

e.g.
"my notepad"
application 1 corresponds to the first shortcut and so on


Options: ReplyQuote
Re: Running a program from HTML / start programs from browser / menu icons buttons
Posted by: Binary
Date: February 21, 2010 06:02AM

Thanks disrupted! It works! smiling smiley

Options: ReplyQuote
Re: Running a program from HTML / start programs from browser / menu icons buttons
Posted by: disrupted
Date: February 21, 2010 03:14PM

you're very welcome binary..remeber to check jamesd learning macros
http://kmeleon.sourceforge.net/wiki/KmmTraining
they are excellent starters for users who want to learn macro language

Options: ReplyQuote
Re: Running a program from HTML / start programs from browser / menu icons buttons
Posted by: SoerenB
Date: February 21, 2010 05:18PM

This should be moved to the Extensions forum.

Cheers
SoerenB

Options: ReplyQuote


K-Meleon forum is powered by Phorum.