Extensions :  K-Meleon Forum
All about K-Meleon extensions. 
Duplicate This Tab
Posted by: Niceeight
Date: December 08, 2017 01:00AM

Hello! I'm a new fan of K-Meleon and I greet everyone.
Now i tried add the extension Duplicate this tab of Firefox (https://addons.mozilla.org/en-US/firefox/addon/duplicate-this-tab/) but not working.
My question is: can I use this extension? Or, best, i can create a macro with this function? I'd like to understand how to create macros for customize K-Meleon according to my needs.
I use K-meleon 76 PRO
Thans and regards!



Edited 1 time(s). Last edit at 12/08/2017 01:01AM by Niceeight.

Options: ReplyQuote
Re: Duplicate This Tab
Posted by: siria
Date: December 08, 2017 01:36AM

Hi and welcome! Yes that definitely sounds like a little macro job, just opening URLs in tab or windows.
The FF addon page says it does:
1) duplicate tab
2) duplicate tab to new window
3) detach tab
4) merge windows

1) right-click on the Go-Button and click "Open in new page"
2) not yet
3) right-click on a tab and "Detach Tab", OR menu File (if hidden: Alt+F) then "Detach Tab"
4) not yet

New:
2) easy, if you need this can create a little macro using "opennew($URL)"
4) not quite as easy, but feasable - if it's important to you? A macro would have to collect all URLs in current window, then jump to the "next" window (but not chosable which one!), then open the URL-list again (loading from web again or cache, depending on your settings)


(sig) Brandnew K-Meleon 77 in development now!
(based on Goanna engine, own subforum, try TEST BUILDs)
K-Meleon FAQ (link missing in forum sidebar)
New to K-Meleon? What do you like? What not?

Options: ReplyQuote
Re: Duplicate This Tab
Posted by: rodocop
Date: December 08, 2017 02:35AM

1) drag-n-drop your tab to the right empty space on tabbar - this duplicates the tab.


Latest Release KM75.1 Latest dev KM76RC ||| Visit The K-Meleon Place and join me there!
Old good stuff: KM-1.6db+NS © dugbugoffice // KM-16-S2014 © Fred // KM-1.6beta2.6 © JamesD // KM Twin+ © rodocop // KM 1.8.24.22 © adodupan

RECOMMENDED! K-Meleon 76 Pro ==» Download portable: 7zip or EXE =//= Discuss on forum
K-Meleon 75.1 Pro: Download =//= Discuss || Portable Flash plugin (x86/x64 DLLs)



Edited 1 time(s). Last edit at 12/08/2017 02:35AM by rodocop.

Options: ReplyQuote
Re: Duplicate This Tab
Posted by: Niceeight
Date: December 08, 2017 02:56AM

Thankyou rodocop for drag and drop trick.
First I not see "Open in new page" because I use the Default skin and go button there is not.
For duplicate tab to new window i'm not sure how to create a macro.
I create a new file with this name: duplicate.kmm and put it in macro folder.
I write in the file this:
Duplicate{
"opennew($URL)"
}

Nothing changed after the browser restart. I think I did not understand how to create the macro ...



Edited 1 time(s). Last edit at 12/08/2017 02:59AM by Niceeight.

Options: ReplyQuote
Re: Duplicate This Tab
Posted by: siria
Date: December 08, 2017 04:31AM

=========== mini-version:

DuplicatePage_dupwin{
opennew($URL);
}

_DuplicatePage_BuildMenu{
setmenu("_Go_Open",macro,"Duplicate Tab To New Window","DuplicatePage_dupwin",1);
setmenu("New",macro,"Duplicate Tab To New Window","DuplicatePage_dupwin",2);
}

$OnInit=$OnInit."_DuplicatePage_BuildMenu;";
$macroModules=$macroModules."DuplicatePage;";


=========== long-version:

# UTF-8 K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/macrolanguage2)
# check syntax: menu Tools / Error Console -> KMM (chrome://console2/content/console2.xul)

# ------------------ DuplicatePage.kmm ------------------------------
# Version: 1 / 2017-12-07
# Menu: right-click on Tab / or on Go-Button / or in menu File
# Forum : http://kmeleonbrowser.org/forum/read.php?9,143575
# ----------------------------------------------------------------------------

DuplicatePage_duptab{
opentab($URL);
}

DuplicatePage_dupwin{
opennew($URL);
}

_DuplicatePage_BuildMenu{
# in submenu "New" of parent menu "TabButtonPopup" (created in menus.cfg)
setmenu("New",macro,"Duplicate Tab","DuplicatePage_duptab",2);
setmenu("New",macro,"Duplicate Tab To New Window","DuplicatePage_dupwin",3);
# Go-button context menu (created in main.kmm)
setmenu("_Go_Open",macro,"Duplicate Tab","DuplicatePage_duptab",1);
setmenu("_Go_Open",macro,"Duplicate Tab To New Window","DuplicatePage_dupwin",2);
}

$OnInit=$OnInit."_DuplicatePage_BuildMenu;";
$macroModules=$macroModules."DuplicatePage;";


=========== Go-button invisible?
If it's hidden, toggle the toolbar named "Go Buttons"
Or, to change single buttons, click Edit > Configuration > Toolbars (first make a backup copy of that file!)



Edited 1 time(s). Last edit at 12/08/2017 04:40AM by siria.

Options: ReplyQuote
Re: Duplicate This Tab
Posted by: Niceeight
Date: December 09, 2017 12:52AM

Oh thanks. Fantastic! Now I'm starting understand how to use the macro. I modified the macro for my experience:

DuplicatePage_newtab{
opentab($URL);
}
DuplicatePage_newwin{
opennew($URL);
}
_DuplicatePage_BuildMenu{
setmenu("_Go_Open",macro,"Duplica scheda","DuplicatePage_newtab",1);
setmenu("New",macro,"Duplica Scheda","DuplicatePage_newtab",2);
setmenu("_Go_Open",macro,"Duplica Scheda in nuova finestra","DuplicatePage_newwin",1);
setmenu("New",macro,"Duplica Scheda in nuova finestra","DuplicatePage_newwin",2);
}

$OnInit=$OnInit."_DuplicatePage_BuildMenu;";
$macroModules=$macroModules."DuplicatePage;";

I'm Italian...
But if I would like have this function with right click anywhere on the page and not on the tab how can I do it?

Options: ReplyQuote
Re: Duplicate This Tab
Posted by: siria
Date: December 09, 2017 01:22AM

Quote
Niceeight
if I would like have this function with right click anywhere on the page and not on the tab how can I do it?

That menu is called "DocumentPopup" (created in menus.cfg)
Or use one if its submenus, then it may show up in other menus as well.

Options: ReplyQuote
Re: Duplicate This Tab
Posted by: Niceeight
Date: December 09, 2017 02:24AM

Ah ok. So I can create the macro for all menu in menu.cfg for exemple SelectedText, Toolbars or other...
Thankyou very much and if I need help again, likely, I ask again.
Hello!

Options: ReplyQuote
Re: Duplicate This Tab / [HOWTO] first macro
Posted by: siria
Date: December 09, 2017 02:51AM

Quote
Niceeight
Ah ok. So I can create the macro for all menu in menu.cfg for example SelectedText, Toolbars or other...

Exactly smiling smiley
And also the menus created by main.kmm in the macros folder.

If you want to modify a menu and know already its displayed name, for example "&File" or "&Edit" or "&View" or "Page &Properties", then you can use it directly, no need to look it up first. Just note that underlined characters in the name must be preceded with a "&"

You even can add a menu to "Main", that is the main menu bar.

In theory you can use all other macro created menus too, but the prob is, their order at startup matters. The menu-creating macro must be executed first, but that's just luck, the order is rather random. There are little tricks, but guess for now this is enough.
Have fun grinning smiley

Options: ReplyQuote
Re: Duplicate This Tab / [HOWTO] first macro
Posted by: Niceeight
Date: December 09, 2017 03:14AM

Yes yes, for now this is enough. Thankyou for your advice. I will make good use of it. For now create a macro for translate the page and the selected text without going through the submenus. For the order I use the number at the end of the line and it seems to be working...bah!
This is the macro "TranslateThis":

TranslateThisPage_newtab{
opentab("https://translate.google.com/translate?ie=UTF-8&act=url&u=".$URL);
}
TranslateThisLink_newtab{
#opentab("https://translate.google.com/?langpair=auto%7Cit&text=".$SelectedText);
opentab("https://translate.google.com/#auto/it/".$SelectedText);
}
_TranslateThisPage_BuildMenu{
setmenu("_Go_Open",macro,"Traduci Pagina","TranslateThisPage_newtab",2);
setmenu("New",macro,"Traduci Pagina","TranslateThisPage_newtab",3);
setmenu("DocumentPopup",macro,"Traduci Pagina","TranslateThisPage_newtab",1);
setmenu("DocumentPopup",macro,"Traduci Pagina","TranslateThisPage_newtab",2);
setmenu("SelectedText",macro,"Traduci Selezionato","TranslateThisLink_newtab",3);
setmenu("SelectedText",macro,"Traduci Selezionato","TranslateThisLink_newtab",4);
}
$OnInit=$OnInit."_TranslateThisPage_BuildMenu;";
$macroModules=$macroModules."TranslateThis;";


See You!

Options: ReplyQuote
Re: Duplicate This Tab / first macro
Posted by: siria
Date: December 09, 2017 04:08AM

Looks good so far, I see you're having fun grinning smiley
Only 2 menu lines are double...

Options: ReplyQuote
Re: Duplicate This Tab / first macro
Posted by: George_Hall
Date: December 09, 2017 04:46AM

There is also the Duplicate Tab macro http://kmext.sourceforge.net/extensions/dublicatetab.7z at K-Meleon Extensions Central http://kmext.sourceforge.net under Enhancements Extensions http://kmext.sourceforge.net/ext7.htm

It allow to duplcate a tab by right clicking on a single tab.

It was also mentioned previously by rodcop in the K-Meleon Forums

Re: TABS --- Macros for Groups of, Prior, and Last
http://kmeleonbrowser.org/forum/read.php?9,137101,137105#msg-137105

I even mentioned Duplicate Tab under a different Topic related to sessions

http://kmeleonbrowser.org/forum/read.php?4,133055,133138#msg-133138



Edited 1 time(s). Last edit at 12/09/2017 04:53AM by George_Hall.

Options: ReplyQuote
Re: Duplicate This Tab
Posted by: siria
Date: December 09, 2017 06:43AM

Thanks for the links George, not sure if he already noticed the handy kmext-archive smiling smiley

Just in this special case here, he wanted to duplicate it in a new WINDOW too, so did need a new macro anyway. So it was easier to just put both (tab+window) into the same macro, considering the basic function consists just of ultrasimple 1-liners (opentab()/opennew()), instead of juggling with 2 separate kmm-files.
And also because he's actually volunteering to learn macros, yay!! grinning smiley

Quote
Niceeight
Or, best, i can create a macro with this function? I'd like to understand how to create macros for customize K-Meleon according to my needs.


Options: ReplyQuote


K-Meleon forum is powered by Phorum.