K-Meleon
 

Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
Bugs
Development

SourceForge Logo
Spam Chongqed

 

 

 

 

 

 

K-Meleon

Documentation - Macros and Macro Scripting - E-Mail A Web Page

Introduction

This document explains how to create a macro that will e-mail the current web page.

Defining the Macro

You can add macros directly in K-Meleon. Select Edit - Preferences - Configs and then select the tab labeled "Macros". Scroll to the bottom of the file and add the following code:

emaillink {
menu=Email &Link
open(javascript:{var subject=document.title;var body=location.href;self.location='mailto:user@user.com?subject='+subject+'&body='+body;});
}
This code does two things. First, it defines a menu item, "Email &Link" for later use. It also defines the macro that will execute when you select that menu item. In this case, the macro "emaillink" uses Javascript to open up your e-mail application and create an e-mail that includes the URL for the web page that you are viewing.

Click on the "OK" button to save your changes. A dialog will appear asking you if you wish to save your changes to "macros.cfg". Select "Yes" to save the changes. Now that we've defined the macro, we need to have a way to execute it.

This should show you a link Email Link, and when you go to a page and select this from File menu, you will be able to email link of that page and have the page title as the subject of that email.

Adding a Menu Entry for the Macro

When creating macros, you have the option of binding the macro to a toolbar button, accelerator keys, creating a menu entry or all three. In this example, we'll just create a menu entry for our macro. Again, select Edit - Preferences - Configs and then select the tab labeled "Menus". We'll be adding our macro to the "File" menu. You can actually add it to any menu you wish or create a whole new menu for your macro. It's your choice!

Under the "&File" entry, add the following code somewhere in the list of menu entries:

macros(emaillink);
This adds a menu entry to your File menu titled "Email &Link". When you select "File", this entry will appear in the menu. When you select the entry, you will be able to email a link to that page and have the page title as the subject of that email. Of course, you need to have an e-mail application configured on your computer to facilitate that e-mail process.

Click on the "OK" button to save your changes. A dialog will appear asking you if you wish to save your changes to "menus.cfg". Select "Yes" to save the changes.

Exit K-Meleon and restart the browser (if you have the symbiotic loader installed, you may have to re-boot). Select the File menu and you should see your new entry in the list of menu items. When you are ready to e-mail a web page, select the item from the list.

Coding and text by sesh with additional text by Andrew Mutch and Po.

Last updated: January 5, 2002
Created: January 5, 2002

(c) 2000-2001 kmeleon.org. All rights reserved.
design by splif.