send shortcut to desktop
Posted by: froggy
Date: November 29, 2011 07:11AM

I dont see an option (in ver 1.5.3) to "send shortcut to desktop" or equivalent as is an option in IE. Am I not seeing it or is it not there?

I dont want to have to always use CTRL+ALT+I to send page to IE and then "send shortcut to desktop".


Thanks



Edited 1 time(s). Last edit at 11/29/2011 07:11AM by froggy.

Re: send shortcut to desktop
Posted by: JamesD
Date: November 29, 2011 07:43AM

This is very old, but might be what you need.
http://kmeleon.sourceforge.net/wiki/Create+Shortcut

Re: send shortcut to desktop
Posted by: froggy
Date: December 01, 2011 06:40AM

I tried these scripts but I must be doing something wrong. No change in the menu options

Re: send shortcut to desktop
Posted by: JamesD
Date: December 01, 2011 09:31AM

Sorry, my fault. I did not read all the page. I have done a quick fix to the macro. Try this one. I hope I have it right. The right click menu should now have a "Save shortcut to desktop" item. Both files, the kmm and the js should go in the "macros" folder of your profile. The first letter, S, of each file should be in caps.

Shortcut.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2)
# File name: Shortcut.kmm
# ---------- Send shortcuts to desktop ----
#
# Dependencies        : Shortcut.kmm
# Resources           : -
# Preferences         : - 
# --------------------------------------------------------------------------------

# Send URLs to Windows desktop as Internet Shortcut
_PageToDesktop {
        $TITLE==$URL?$u="":$u=gsub("\"","'",$TITLE);
        exec("wscript.exe \"".$_Shortcut_Path."Shortcut.js\" \"".$URL."\" \"".$u."\"");
}
LinkToDesktop {
        $macro="LnkToDesktop"; &JSEnable;
}
_FrameToDesktop {
        $macro="FrmToDesktop"; &JSEnable;
}
LnkToDesktop {
        $TITLE==$URL?$t="":$t=$TITLE;
        open("javascript:function chkLnk(e){var t='".$LinkURL."',l=e.document.links;for(var j=0;j<l.length;j++)if(l[j].href==t){top.document.title=(l[j].text==l[j].innerHTML)?l[j].text:'';break;}}function chkFrm(e){var f=e.frames;for(var j=0;j<f.length;j++)chkFrm(f[j]);chkLnk(e);}void(chkFrm(top));");
        $TITLE==$URL?$u="":$u=gsub("\"","'",$TITLE);
        open("javascriptsad smileyfunction(){top.document.title='".$t."';})();");
        exec("wscript.exe \"".$_Shortcut_Path."Shortcut.js\" \"".$LinkURL."\" \"".$u."\"");
}
FrmToDesktop {
        $TITLE==$URL?$t="":$t=$TITLE;
        open("javascript:function chkTtl(e){if(unescape(e.document.location.href)==unescape('".$FrameURL."'))top.document.title=e.document.title;}function chkFrm(e){var f=e.frames;for(var j=0;j<f.length;j++)chkTtl(f[j]);chkTtl(e);}void(chkFrm(top));");
        $TITLE==$URL?$u="":$u=gsub("\"","'",$TITLE);
        open("javascriptsad smileyfunction(){top.document.title='".$t."';})();");
        exec("wscript.exe \"".$_Shortcut_Path."Shortcut.js\" \"".$FrameURL."\" \"".$u."\"");
}


_Shortcut_BuildMenu {
setmenu("Document",macro,"Save shortcut to desktop",_PageToDesktop,-1);
setmenu("FrameSave",macro,"Save shortcut to desktop",_FrameToDesktop,-1);
}

_Shortcut_GetPath {
$__Data=readfile(getfolder(MacroFolder)."\\Shortcut.kmm");
$_Shortcut_Path=getfolder($__Data==""?UserMacroFolder:MacroFolder) . "\\";
}
# The file "Shortcut.js" must be located within your profile directory (where this file resides) !
#---------------------------------------------
$OnStartup=$OnStartup."_Shortcut_GetPath;";
$OnInit=$OnInit."_Shortcut_BuildMenu;";
$macroModules=$macroModules."Shortcut;";


Re: send shortcut to desktop
Posted by: megaduu
Date: December 01, 2011 11:10AM

It works well!

Re: send shortcut to desktop
Posted by: froggy
Date: December 02, 2011 06:26AM

Yes it does. Works perfectly now.
Thanks !

Re: send shortcut to desktop
Posted by: JamesD
Date: December 02, 2011 09:54AM

Very happy to have been of some help.

Re: send shortcut to desktop
Posted by: siria
Date: October 13, 2014 06:06AM

Still based on the old KM1.0 version (&JSenable etc.), and can't work fully.

But kko posted a new KM1.5 version already in the wiki in 2008:
http://kmeleon.sourceforge.net/forum/read.php?1,27152,page=3

Quote
kko
KmmShortcut now works in both km 1.1 and 1.5 (no edition required).

Have now added a remark to the old version wiki page.

K-Meleon forum is powered by Phorum.