I thought having to write each URL in a new macro for each group seemed somewhat archaic, so I came up with this after looking more closely at MonkeeSage's
session macro. I'm not a macros master so there might be better ways to do this but I haven't seen any attempts posted in the forums or macros section. All opened layers are saved as a group in prefs.js. When saved, each group name, in effect, serves as an alias to be typed into the URL Bar combined with an accelerator opening the group. This only works properly in v0.8 beta and possibly MonkeeSage's builds since the updated layers.dll is needed. When v0.8 is released I'll post it in the macros section unless somebody posts a better way of doing it.
In macros:
SaveAsGroup {
menu = "Save As Group";
$group = pluginmsgex(layers,"GetLayersInWindow","",STRING);
$name = prompt("Save Group Name As:", "Group Name?", "");
$name == "" ? "" : setpref(STRING, "kmeleon.group." . $name, $group);
$tip = "' in the URL Bar and press Shift+Enter to open this group.";
$name == "" ? "" : alert("Type '" . $name . $tip,"Group Saved As: " . $name);
}
AddToGroup {
menu = "Add URL To Group";
$name = prompt("Enter name of Group to add this URL to:", "Group Name?", "");
$name == "" ? "" : getpref(STRING, "kmeleon.group." . $name);
$group = getpref(STRING, "kmeleon.group." . $name);
$name == "" ? "" : setpref(STRING, "kmeleon.group." . $name, $group . $URL . "\t");
$name == "" ? "" : alert("URL added to Group: " . $name, "Group Updated");
}
OpenGroup{
id(ID_SELECT_URL);
id(ID_EDIT_COPY);
$name = getclipboard();
$group = getpref(STRING, "kmeleon.group." . $name);
$index = index($group, "\t\t");
$index == -1 ? pluginmsg(layers, "ReplaceLayersInWindow", $group) : pluginmsg(layers, "ReplaceLayersInWindow", substr($group, 0, $index));
statusbar("Loading Group");
}
In menus:
# Under
&Bookmarks {, or
F&avorites {, or
&Layers {, or
Ho&tlist {
macros(SaveAsGroup)
macros(AddToGroup)
In Accelerators:
ALT S = macros(SaveAsGroup)
ALT A = macros(AddToGroup)
SHIFT VK_RETURN = macros(OpenGroup)