General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Pages: 12Next
Current Page: 1 of 2
How do you launch your custom macros?
Posted by: anontemp123
Date: April 26, 2016 05:15AM

Menu? Toolbar buttons? Right-click menu? Some other way? Curious to see what everyone's preference is.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: foliator
Date: April 26, 2016 04:47PM

The easiest way, at least for me, is to assign a shortcut key to the macro by editing accel.cfg in my profile.

Example: ALT VK_SPACE = macros(ToggleJC)

That macro toggles both JavaScript and Cookies, then reloads the page. The VK_ prefix is for a virtual (non-alphanumeric) key. Alphanumeric keys are simpler and can be written like this:

ALT J = macros(ToggleJS)
ALT C = macros(ToggleCookies)
etc.

Sometimes I also create a toolbar button for a macro, having studied the contents of the default toolbar.cfg. To use a custom icon for the button, I place the small image in .ico or .png format in my default skins folder. Designing toolbar buttons takes a bit of trial and error, and a good deal of patience. smiling smiley

By the way, I've assigned so many of those keyboard shortcuts that I created a list of them in an HTML file, which I can call up in a new tab for quick reference.

---
Gerry



Edited 1 time(s). Last edit at 04/26/2016 04:50PM by foliator.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: anontemp123
Date: April 26, 2016 05:37PM

Is there a way to list all keyboard shortcuts? Those that K-Meleon has defined and those that are custom-defined? Primarily I'm concerned with redefining a shortcut combination that already exists.



Edited 1 time(s). Last edit at 04/26/2016 05:37PM by anontemp123.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: foliator
Date: April 26, 2016 06:00PM

Quote
anontemp123
Is there a way to list all keyboard shortcuts? Those that K-Meleon has defined and those that are custom-defined? Primarily I'm concerned with redefining a shortcut combination that already exists.

Well, you could look at the default accel.cfg here:

K-Meleon\browser\defaults\settings\accel.cfg

You could copy and paste its contents to a separate text file for quick reference, which is pretty much what I did when creating my list. Then I added my own assignments to that list, sorted it, and added the necessary tags and formatting to convert it to HTML format. HTML wasn't actually necessary, because I could have simply opened the plain text file in a browser tab. Being fussy, however, I wanted something more pleasant to look at, so I created a table and a custom background color, etc.

Your custom accel.cfg should be inside your profile folder; those shortcut assignments usually override the default ones.

Another approach is to open this:
K-Meleon\browser\defaults\commands.html#l_defaccel
.. which will show you the defaults.

There's another section in the file to show you the syntax for the special keys:
K-Meleon\browser\defaults\commands.html#l_teclas

---
Gerry

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: siria
Date: April 26, 2016 06:45PM

Basically yes, but accels.cfg is not a complete list. Some macros create more shortcuts, inside their kmm. Do a text search inside the macros folder for "setaccel"...

Shortcuts are fine, but if they get so many that you need to create a html page to remember, then simply add them to an own menu! Don't be scared off by some macro menus looking complicated, those are only special cases. A simple, basic, NEW User Menu like your html list actually is fun and easy! smiling smiley Same "difficulty" level as adding to accels.cfg.

There are 2 ways: either create it in menus.cfg or by a macro kmm. Both are easy to create with a little template. Honestly can't tell what is easier of them.
Decide how you want to call the new menu. "My Menu"? Just "LIST"? Anything you want.
Decide where you want it: Perhaps in the main menu line, next to "Help"? Or as submenu of an existing one?
Or perhaps would like that menu to pop up by calling 1 shortcut for it?
Or would like to add it as right-click on an already existing button?
Lots of possibilities... :cool:



Edited 1 time(s). Last edit at 04/26/2016 07:12PM by siria.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: siria
Date: April 26, 2016 07:07PM

Okay, here's the most minimalistic way, considering you have your list already finished in accels.cfg

=> Just copy that block over to the END of the default "menus.cfg"
=> Replace the shortcuts on the left side with a description that will appear as menuline
=> Add the top and bottom lines to create this menu

Example:

MyMenu{
Block Cookies=macros(pref_ToggleCookies)
View Co&okies=ID_COOKIES_VIEWER
Black-White-List=ID_COOKIE_PERM
Cookies Configuration=macros(kmPrefs(privacy))
Clear &Cookies=privacy(ClearCookies)
}

!Main{
:MyMenu
}


Done! :cool:
That will create a new menu named "MyMenu" in the "Main" menu line (File/Edit/View etc.)
If KM is set to show shortcuts in the menus, yours will appear automatically in it too.

If, let's say, you want to add this example menu as right-click on the cookies-button, edit toolbars.cfg and add after |:
macros(pref_ToggleCookies)|MyMenu

Description line: adding "&" will underline next character, makes it usable for keyboard navigation. If someone uses that.

Why I'm writing to add it to the "default" cfg instead the one in the profile is due to an old bug with modifying the Main menu, if there's a macro using the rebarmenu plugin. That conflicts somehow. But this may not apply in your case, or well possible this bug doesn't exist anymore in newer KM versions, but don't know. Anyway, can't harm to try either way.



Edited 1 time(s). Last edit at 04/26/2016 07:20PM by siria.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: anontemp123
Date: April 26, 2016 08:42PM

Thanks. Having a lot of fun trying the different techniques.

How can I unassociate a shortcut? For example, I use CTRL+ENTER in hotmail to send, but KM 75.1 intercepts it and opens a new tab instead.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: siria
Date: April 26, 2016 08:53PM

Did a little file search for VK_return, and found it in the macro "domcomplete". Disable the setaccel line there by starting it with #

PS: mods can change usernames in this forum, if some day you'd like a more personal one ;-)



Edited 1 time(s). Last edit at 04/26/2016 08:55PM by siria.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: foliator
Date: April 27, 2016 01:33AM

@siria: Thanks for the info on building menus. I've already added quite a few personalized things to the context menu section of menu.cfg, where it starts with

# ----- Documents

DocumentPopup{


These will show up when right-clicking the body of any page, but of course not if I'm pointing at a specific element, such as a URL or an image. For instance,

:Compact Menu
:&Bookmarks
:&Privacy
C&lear History=macros(kPrivacy_ClearAll)
Toggle JavaScript=macros(ToggleJS)
Toggle Cookies=macros(ToggleCookies)
Toggle Both=macros(ToggleJC)
Kill Flash Objects=macros(JS_killFlash)
-
Read E-&mail=macros(Mail_ReadMail)


I never use the main menu; I use only the compact menu, and anything I needed that wasn't there, I've added to it. As you can see from the example, I can get the compact menu to pop up via right-click on a blank area of any page. Same goes for the bookmarks menu.

Lots of fun! It's almost like developing my own custom browser -- "with a little help from my friends", to quote the Beatles! grinning smiley

---
Gerry

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: anontemp123
Date: April 27, 2016 02:40AM

Quote
siria
Did a little file search for VK_return, and found it in the macro "domcomplete".

Interesting. Would you know where in the Preferences you can set the domcomplete preferences? I.e., where can you set the values for kmeleon.plugins.macros.domComplete[0-2].prefix?

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: siria
Date: April 27, 2016 04:21AM

F2 > Browsing > Finding websites (near bottom)

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: anontemp123
Date: April 27, 2016 05:18AM

Thanks! So kmeleon.plugins doesn't necessarily mean it's under K-Meleon Plugins in Preferences. It could be an "internal" plugin. Got it.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: rodocop
Date: April 27, 2016 06:48AM

Let's clarify this:

'kmeleon.plugins.macros' - defines that some option relates to macrolanguage extensions (or macros).

And the handling of macros themselves is implemented through k-plugin macros.dll (definitely listed under K-Meleon Plugins in Preferences)/

No mystique 'internal plugins' ;-)



Edited 1 time(s). Last edit at 04/27/2016 06:48AM by rodocop.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: anontemp123
Date: April 27, 2016 03:44PM

Quote
rodocop
No mystique 'internal plugins' ;-)

So there are mystique 'internal macros' then?

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: foliator
Date: April 27, 2016 04:31PM

Quote
anontemp123

So there are mystique 'internal macros' then?

I've always considered the contents of "main.kmm" to be a kind of internal macro, since it's included in the original distribution package and seems to handle a lot of things not covered by the other macros. In looking at its contents, I think it coordinates various functions of the other macros. For example, it's responsible for updating the status of privacy settings, so that a message is displayed on the status bar when you toggle one of the privacy settings.

But then I'm going way over my head here.

---
Gerry



Edited 1 time(s). Last edit at 04/27/2016 04:32PM by foliator.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: siria
Date: April 27, 2016 07:20PM

Huh, what 'mystique' things are you guys wondering about? *riddling*

Just because some of the macros (= *.kmm files in the macros folder) are configured in the Preferences in other tabs than the kplugins tab??
That's quite normal for the native, included out-of-box macros. They are handling lots of basic and important functions. And are fully accessible like all other macros too, in the macros folder.

Of course they need the macros-plugin to be enabled.
And when clicking the Pref-sheet for KM-Plugins / macro extensions, there is a list of all kmm-macros with checkboxes to disable single ones.
Perhaps a misunderstanding somewhere?

And yes, main.kmm is essential, it also creates some general helper functions or modules which are meant to be used by other macros.



Edited 1 time(s). Last edit at 04/27/2016 07:24PM by siria.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: anontemp123
Date: April 27, 2016 08:27PM

It was a poor attempt at humor. Things are starting to make sense slowly. Even the difference between plug-in and macro was confusing to me at first. Very interesting to see so much core functionality is itself actually implemented with macros.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: foliator
Date: April 27, 2016 09:52PM

Quote
anontemp123
Things are starting to make sense slowly.* Even the difference between plug-in and macro was confusing to me at first. Very interesting to see so much core functionality is itself actually implemented with macros.

The difference between plugins and extensions in Firefox can be just as confusing. Generally a plugin is in the form of a DLL file, whereas FF extensions are XPIs, which are compressed files that can be opened by 7-Zip. Earlier versions of FF allowed modifications to the XPIs, such as modifying the toolbar icons, but I tried that with FF 43 (which I've since stopped using) and it brought up a message that it couldn't verify the extension. Had to restore it from backup.

KM's macros seem somewhat analogous to FF extensions, but macros are far more customizable. Of course, Mozilla is eliminating some confusion (in an annoying kind of way) by dropping support for plugins this year, with the sole exception of the Flash plugin. They announced that officially, but I'm not sure if they've already done it in their latest updates. In FF 43, plugins are already disabled by default until you go to a dialog in the addons manager and explicitly allow them to run.

* If these computer things started making sense too quickly for me I'd begin to worry about my sanity. grinning smiley

---
Gerry

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: JamesD
Date: April 28, 2016 01:11AM

Quote
foliator
If these computer things started making sense too quickly for me I'd begin to worry about my sanity.

No need to worry. If things make sense, either Microsoft or Mozilla will change those parts.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: foliator
Date: April 28, 2016 03:13AM

Quote
JamesD
No need to worry. If things make sense, either Microsoft or Mozilla will change those parts.

grinning smiley

---
Gerry

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: siria
Date: April 28, 2016 06:52AM

LOL! grinning smiley So true!!! grinning smiley A pity it's way more sad than funny sad smiley sad smiley

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: foliator
Date: April 28, 2016 04:19PM

Changes like that make me hesitate to upgrade my software. As for browsers, I intend to stick with KM as long as I can. So far every website I visit functions just fine in KM75, which is based on Gecko 31. I understand 76 beta uses Gecko 38. If it ever got as far as 44, there could be some problems.

Internet Explorer 9, which I stopped using back when I discovered KM, was the newest version of IE that would run on my system, and it had already failed to load at least one of my essential sites, probably due to outdated JavaScript support.

Also, Windows 7 is as far as I want to go with the OS. Windows Update has been intentionally disabled on my computer. If I ever had to buy a new one, I'd need to find a way to downgrade to Windows 7 from 10, since the only new machines available here come with Windows 10 preinstalled.

---
Gerry

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: JamesD
Date: April 28, 2016 05:55PM

foliator

I won't say that it has not been 'interesting' moving from Win 7 (32 bit) to Win 10 (64 bit), but K-Meleon required the least change of any of my programs.

I got around the admin/security mess by creating a folder at the C:\ root named 'KM_PGMS'. I put each KM in its own folder as a sub-folder of 'KM_PGMS'. I run all my KMs as portable with my profile within KM's folder. To make the move I went to each KM in 7, cleared history and cache, and copied the folder to a USB stick. I then copied each KM into my C:\KM_PGMS folder. Since I created C:\KM_PGMS, I have complete authority there. I kept Edge but not IE so my KMs use Favorites and nothing else does.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: JamesD
Date: April 28, 2016 06:03PM

anontemp123

I almost always launch my macros from menus created within the macro. Sometimes I use a button, but even then there is likely to be a right-click menu with the button.

I rarely use or include accel keys in my macros. I add them if I am requested to do so, but that is rare. I am too old to remember the key combinations, but I can read a menu.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: foliator
Date: April 28, 2016 10:18PM

Quote
JamesD
Since I created C:\KM_PGMS, I have complete authority there.

That admin/security thing is an annoyance even in Windows 7. Actually, I've never been thrilled with the multi-user aspects of Windows, either, like having to log in, etc. It annoyed me even in Windows 98, the first multi-user version I used. I'm the only user of this computer; there are no other profiles besides mine. I'm running everything as the administrator.

Nevertheless, Windows 7 basically hijacks programs placed in C:\Program Files, forcing many of them to store their settings under AppData. For that reason I keep all of my portable programs in subfolders of Documents\Apps. I don't run any programs from removable drives, but prefer the control that portability gives me, and the fact that those programs seldom modify the registry, unless I associate them with file types. KM, which I installed from the portable package, is one of the exceptions, of course, since it's set as my default browser.

That "library" feature is something else for which I have no use whatsoever. It had me scratching my head when copying files over from an old Windows XP machine that was on its last legs. I've managed to circumvent the libraries for the most part, but some portable programs look for files inside the libraries when I use the File Open dialogue. All of my libraries are empty, so I always have to navigate up to my user profile folder and down to the actual Documents folder (not "My Documents"). KM, on the other hand, behaves itself admirably. grinning smiley

Quote
JamesD
I kept Edge but not IE so my KMs use Favorites and nothing else does.

I tried using KM's Favorites support, but found bookmarks easier to manage. There's nothing in my Favorites folder now, anyway -- in fact, there's no longer a Favorites folder.

---
Gerry

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: rodocop
Date: April 29, 2016 05:21AM

foliator,

I'm with you in almost all aspects of PC and OS usage.
But I don't see any problem in all that shit like default Windows folders and Libraries.

I simply don't use them. Since I've started work with Windows in 3.1 era (1995) I've used to organize my job in 'independent' way^

- all my work files (docs, images etc.) are stored separately from system drive, user profiles, etc.
- no default paths, suggested by OS used (except for Windows folder and Program Files)
- since portable apps appear (and in earlier times almost all apps were natively portable as it was no registry at all in Windows 3.x - but some apps created some entries in win.ini, autoexec.bat etc) I started to place them in their own place - folder 'portable'
- sure I always run my PC as Admin without all these dumb restrictions which are useless for both novices (as they don't really help against malware) and advanced users (as we can prevent infection under Admin account)

How to prevent all this jumping between file tree branches in Explorer and Open/Save dialogs? Just use one of numerous utilities that add fast access to last used dirs as a special button (or list) in file dialog windows. I use Anvir Task Manager that is the superb swiss knife for process, task and services management, autoruns and more things including that extension for open/save dialogs.

But there is a number of alternatives and other useful extensions for Windows Explorer



Edited 1 time(s). Last edit at 04/29/2016 05:22AM by rodocop.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: foliator
Date: April 29, 2016 03:54PM

Quote
rodocop
... there is a number of alternatives and other useful extensions for Windows Explorer

Well, I seldom use Windows Explorer now for file management. Instead I'm using XYplorer (the freeware version), which lets me hide all those junctions and virtual folders or whatever and see only what I want to see. It also offers folder favorites for fast access. A few other applications (Wordpad, for example) still look in the wrong place for opening files, but most of the time they'll remember where I finally opened them.

Like you, I started with Windows 3.1, but was an enthusiastic DOS user before that. I remember monkeying around with win.ini, system.ini and autoexec.bat. It was so damned easy! One day I was called by a lady in a panic who claimed she had lost all her text on her Win 3.1 machine. She said all the screens that normally showed text were now blank. :O When I got there, I found I couldn't see any of her settings until I went back to DOS and opened one of the .ini files (not sure now if it was system.ini or win.ini). It turned out that someone (maybe one of her kids) had changed her system colors, making the foreground text white, while the background was already white!

After proclaiming me a genius -- which I clearly am not -- she paid me my fee and we were both happy. smiling smiley

---
Gerry



Edited 1 time(s). Last edit at 04/29/2016 03:58PM by foliator.

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: siria
Date: April 29, 2016 07:20PM

LOL! Was that a prank or something?
Anyway, for solving THIS it almost does take a genius grinning smiley

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: foliator
Date: April 29, 2016 10:02PM

Quote
siria
LOL! Was that a prank or something?
Anyway, for solving THIS it almost does take a genius grinning smiley

I'm not sure if it was intentional. Probably one of the kids started playing around with his mother's computer without her knowledge and without a clue about how to use it. That's what happens when you leave a kid home alone. grinning smiley

The other thing I did when I was there was install her new internal modem -- a very simple procedure with those older towers. I never told her that I was completely self-taught on computers.

---
Gerry

Options: ReplyQuote
Re: How do you launch your custom macros?
Posted by: rodocop
Date: April 29, 2016 10:08PM

We all were ones. ;-) (self-taughts)

Options: ReplyQuote
Pages: 12Next
Current Page: 1 of 2


K-Meleon forum is powered by Phorum.