K-Meleon

DEP

KMeleonWiki > Resources > MacroLibrary > Download Express

Submitted by: Johnny Bravenboer

Notes:

This macro adds the options to download both links and selected text with the Download Express download manager.

To the Edit menu this macro will add an option to manually send a link to the Download Express program, which by default will be the selected text.

Also added to the Edit menu is access to the Download Express Download List and Options dialogs.


Open your User Macro Folder (Edit > Configuration > User-Defined Macros) or your Macro Folder (Edit > Configuration > Macros) and create the following text file:

DEP.kmm

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

# ---------- Download Express -------------------------------------------------------------------------------
#
# Dependencies : main.kmm
# Resources       : -
# Preferences    : -
#
# ------------------------------------------------------------------------------------------------------------------

# OPEN LINK WITH DEP
DEP_URL{
  menugrayed = (hostname($LinkURL) == "");
  exec(readreg("HKCU", "Software\\MetaProducts\\Download Express\\ProgramPath") . " /PAUSEDURL=" . $LinkURL);
}

# SEND SELECTED TEXT TO DEP
DEP_SELTEXT{
  menugrayed=(hostname($SelectedText)=="");
  exec(readreg("HKCU", "Software\\MetaProducts\\Download Express\\ProgramPath") . " /PAUSEDURL=" . $SelectedText);
}

# MANUALLY SEND A LINK TO DEP
DEP_MANUAL{
  $deplink = prompt("Enter link to be downloaded by Download Express:", "Enter a Link", $SelectedText);
  $deplink != ""? exec(readreg("HKCU", "Software\\MetaProducts\\Download Express\\ProgramPath") . " /PAUSEDURL=" . $deplink):;
}

# OPEN THE DEP PROJECT LIST
DEP_LIST{
  exec(sub("dep.exe", "projectslist.exe", readreg("HKCU","Software\\MetaProducts\\Download Express\\ProgramPath")));
}

# OPEN DEP OPTIONS
DEP_OPTIONS{
  exec(readreg("HKCU","Software\\MetaProducts\\Download Express\\ProgramPath")." /Options");
}

# ----- PRIVATE

_DEP_BuildMenu{
  setmenu(LinkSave, macro, "Save Link with D&ownload Express", DEP_URL);
  setmenu(SelectedText, macro, "Send Selected Text to Download &Express", DEP_SELTEXT);
  setmenu(Preferences, separator, -1);
  setmenu(Preferences, macro, "Enter L&ink to Download with Download Express", DEP_MANUAL);
  setmenu(Preferences, macro, "Download Express Project &List", DEP_LIST);
  setmenu(Preferences, macro, "Download Express &Options", DEP_OPTIONS);
}


$OnInit=$OnInit."_DEP_BuildMenu;";

# ------------------------------------------------------------------------------------------------------------------
$macroModules=$macroModules."DEP;";


Comments & Questions

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.