Hello,
first I want to say that I am German. But I try to write in English, so that more people can read and help me.
Before I have seen K-Meleon I used IE7.
So I want to use the IE7 Favorites.
This works great.
But When I klick on "Favoriten - Seite hinzufügen" there comes no dialog where I can say how the favorites Name is and where the favorites should be save (in which folder).
I would like to know if the orginal version works for you, or if not you might try the international version. I was waiting for feedback before putting in the MacroLibrary. I am sorry that I don't have any translation for it as I speak only English.
Hi,
I have tested it.
How must I save the file ANSI, UTF-8 ???
Die link will not be saved !!!
It comes a message "Windows Script Host" "1".
Then comes a message with the path to my default folder
How can I translate this into german?
I have in the folder "C:\Programme\K-Meleon\locales\de-DE" the file "FavRenAdd.kml"
with the content
Quote
Specify where to add the new shortcut. Select your Favorites folder or one of its subfolders:=Geben Sie an, wo die neue Verknüpfung erstellt werden soll. Wählen Sie Ihren Favoritenordner oder einen seiner Unterordner aus:
Rename the Favorite Title here=Ändern Sie hier den Titel des Favoriten
Did you mean to cancel?=Wollten Sie abbrechen?
Affirm cancel=Abbruch bestätigen
&Rename-Add=&Umbenennen-Hinzufügen
But only "&Rename-Add" will be translated. The other things are always in english.
I am sorry I did not have the translate function correct before. I only know English so this is very new for me.
@desga2
These are the lines I am going to change. There may be more here than are in the translate code. I added another menu location and I don't think we had alert box titles there before. Does it appear that I have now used the translate function correctly?
alert(_("Unable to create favorite - data too long!\n\nThe data was copied to the clipboard."),_("Failure to complete"),EXCLAIM);
$_FavRenAdd_SubFolder=promptforfolder (_("Specify where to add the new shortcut. Select your Favorites folder or one of its subfolders:"),$_FavRenAdd_FavFolder);
$_FavRenAdd_value=prompt($_FavRenAdd_CurrTitle,_("Rename the Favorite Title here"),$_FavRenAdd_CurrTitle);
$FavRenAdd_Button=confirm(_("Did you mean to cancel?"),_("Affirm cancel") ,YESNO,QUESTION);
$kFavorites=="true"?setmenu("F&avorites",macro,_("&Rename-Add"),_FavRenAdd_RenameAdd,1):0;
$kFavorites=="true"?setmenu("DocumentSave",macro,_("&Rename-Add to Favorites"),_FavRenAdd_RenameAdd,1):0;
When you tried the international version, did you replace both the kmm file and the js file? It seems to work OK for me. I have updated the translate function in this copy. The js file is below the kmm file
FavRenAdd.kmm
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- FavRenAdd.kmm
# ---------- K-Meleon Macro Language Rename/Add page to Favorites ---------------
# ---------- INTERNATIONAL VERSION
#
# Dependencies : - main.kmm, Favorites plugin active, JScript, Windows Scripting Host
# Resources : - Registry keys "HKCU\\Software\\KMELEON\\FavRenAdd\\URLname"
# and "HKCU\\Software\\KMELEON\\FavRenAdd\\URLdisc"
# Preferences : -
# Version : - 3.0 2008-07-30
# --------------------------------------------------------------------------------
#
_FavRenAdd_RnameTrue{
#### look three places for the favorites directory
$_FavRenAdd_FavFolder=getpref(STRING,"kmeleon.plugins.favorites.directory");
$_FavRenAdd_FavFolder==""?$_FavRenAdd_FavFolder=readreg("HKCU","Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Favorites"):0;
$_FavRenAdd_FavFolder==""?$_FavRenAdd_FavFolder=readreg("HKLM","Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Favorites"):0;
#### $_FavRenAdd_FavFolder should have the path for the favorites folder c:\something\favorites
#### call _FavRenAdd_RnameTrue_loop until $_FavRenAdd_SubFolder is no longer a "?"
$_FavRenAdd_SubFolder="?"; while($_FavRenAdd_SubFolder=="?") &_FavRenAdd_RnameTrue_loop;
$_FavRenAdd_Title = substr($_FavRenAdd_value,1);
macros(_FavRenAdd_Sanitize_Title) ;
$_FavRenAdd_PathName = $_FavRenAdd_FavFolder."\\".$_FavRenAdd_SubFolder."\\".$_FavRenAdd_Title.".url" ;
$_FavRenAdd_Ext_Interger = 1;
while ($_FavRenAdd_Ext_Interger > 0 ) &_FavRenAdd_Duplicates_loop ;
## enclosure of a parameter in double quotes is only necessary when the parameter can contain whitespace
## therefor the 1, 2, and 3 in the next "exec" lines do not have double quotes
## first check the line lengths
$_fmax=258 ; $_FavRenAdd_ExVal = 0 ;
$_fcmd = "(wscript.exe \"".$_FavRenAdd_Path."\" 1 \"".$_FavRenAdd_PathName.")" ;
length($_fcmd)>$_fmax ? &_FavRenAdd_Error1:0;
$_fcmd = "(wscript.exe \"".$_FavRenAdd_Path."\" 2 \"".$_FavRenAdd_CurURL.")" ;
length($_fcmd)>$_fmax ? &_FavRenAdd_Error2:0;
$_FavRenAdd_ExVal < 2 ? &_FavRenAdd_RunScript:0;
}
_FavRenAdd_RunScript{
exec("wscript.exe \"".$_FavRenAdd_Path."\" 1 \"".$_FavRenAdd_PathName."\"");
exec("wscript.exe \"".$_FavRenAdd_Path."\" 2 \"".$_FavRenAdd_CurURL."\"");
exec("wscript.exe \"".$_FavRenAdd_Path."\" 3 \""execute"\"") ;
}
_FavRenAdd_Error1{
alert(_("Unable to create favorite - data too long! Line length, "). length($_fcmd). _(" and line are displayed\n\n"). $_fcmd, _("String length too long!"), EXCLAIM) ;
$_FavRenAdd_ExVal = $_FavRenAdd_ExVal + 2;
}
_FavRenAdd_Error2{
alert(_("Unable to create favorite - data too long! Line length, "). length($_fcmd). _(" and line are displayed\n\n"). $_fcmd, _("String length too long!"), EXCLAIM) ;
$_FavRenAdd_ExVal = $_FavRenAdd_ExVal + 3;
}
_FavRenAdd_Sanitize_Title{
$_FavRenAdd_RevTitle = gsub( "?"," ",$_FavRenAdd_Title);
$_FavRenAdd_RevTitle = gsub( ":"," ",$_FavRenAdd_RevTitle);
$_FavRenAdd_RevTitle = gsub( "*"," ",$_FavRenAdd_RevTitle);
$_FavRenAdd_RevTitle = gsub( "<"," ",$_FavRenAdd_RevTitle);
$_FavRenAdd_RevTitle = gsub( ">"," ",$_FavRenAdd_RevTitle);
$_FavRenAdd_RevTitle = gsub( "/"," ",$_FavRenAdd_RevTitle);
$_FavRenAdd_RevTitle = gsub( "|"," ",$_FavRenAdd_RevTitle);
$_FavRenAdd_RevTitle = gsub( "\\","",$_FavRenAdd_RevTitle);
$_FavRenAdd_Title = gsub( "\"","^",$_FavRenAdd_RevTitle);
}
_FavRenAdd_Duplicates_loop{
$_FavRenAdd_Exists=readfile($_FavRenAdd_PathName);
$_FavRenAdd_Exists=1.$_FavRenAdd_Exists ;
$_FavRenAdd_Len2=length($_FavRenAdd_Exists);
$_FavRenAdd_Len2 == 1 ? $_FavRenAdd_Ext_Interger=0 : &_FavRenAdd_Extend;
}
_FavRenAdd_Extend{
$_FavRenAdd_Wrk_Int = $_FavRenAdd_Ext_Interger - 1 ;
$_FavRenAdd_Ext_Interger == 1 ? $_FavRenAdd_PathName = gsub(".url" , "[".$_FavRenAdd_Ext_Interger."].url",$_FavRenAdd_PathName):0;
$_FavRenAdd_Ext_Interger > 1 ? $_FavRenAdd_PathName = gsub("[".$_FavRenAdd_Wrk_Int."].url" , "[".$_FavRenAdd_Ext_Interger."].url" , $_FavRenAdd_PathName):0;
$_FavRenAdd_Ext_Interger = $_FavRenAdd_Ext_Interger + 1 ;
}
_FavRenAdd_RnameTrue_loop{
$_FavRenAdd_SubFolder=promptforfolder(_("Specify where to add the new shortcut. Select your Favorites folder or one of its subfolders:"),$_FavRenAdd_FavFolder);
$_FavRenAdd_SubFolder=$_FavRenAdd_SubFolder=="" ? "" : index($_FavRenAdd_SubFolder,$_FavRenAdd_FavFolder) == 0 ? substr($_FavRenAdd_SubFolder,length($_FavRenAdd_FavFolder)+1) : "?";
}
_FavRenAdd_RenameAdd{
$_FavRenAdd_CurrTitle = $TITLE;
$_FavRenAdd_CurURL = $URL;
$_FavRenAdd_value=prompt($_FavRenAdd_CurrTitle,_("Rename the Favorite Title here"),$_FavRenAdd_CurrTitle);
### cancel from prompt will return a length of zero to which we add one
$_FavRenAdd_value = 1.$_FavRenAdd_value;
$_FavRenAdd_Len=length($_FavRenAdd_value);
### if the length is 1 cancelled was pressed on the prompt box
$_FavRenAdd_Len == 1 ? &_FavRenAdd_Cancelled :&_FavRenAdd_RnameTrue ;
}
_FavRenAdd_Cancelled{
$FavRenAdd_Button=confirm(_("Did you mean to cancel?"),_("Affirm cancel") ,YESNO,QUESTION);
$FavRenAdd_Button == "YES" ? 0 : &_FavRenAdd_RenameAdd ;
}
_FavRenAdd_ModMenu{
### add another option to Favorites menu if favorites plugin is active
$kFavorites=="true"?setmenu("F&avorites",macro,_("&Rename-Add"),_FavRenAdd_RenameAdd,1):0;
### show in Document Popup ;
$kFavorites=="true"?setmenu("DocumentSave",macro,_("&Rename-Add to Favorites"),_FavRenAdd_RenameAdd,1):0;
}
_FavRenAdd_GetPath{
### FavRenAdd.js is supposed to be located in the same folder as FavRenAdd.kmm (this file).
### If it isn't, Windows Script Host will notify the user.
$_FavRenAdd_Data=readfile(getfolder(MacroFolder)."\\FavRenAdd.kmm");
$_FavRenAdd_Path=getfolder($_FavRenAdd_Data==""?UserMacroFolder:MacroFolder)."\\FavRenAdd.js";
}
$OnStartup=$OnStartup."_FavRenAdd_GetPath;";
$OnInit=$OnInit."_FavRenAdd_ModMenu;";
$macroModules=$macroModules."FavRenAdd;";
FavRenAdd.js
/* FavRenAdd.js by JamesD, version 3.01 2008-07-30
INTERNATIONAL VERSION
This script is a helper application for the K-Meleon Macro Module FavRenAdd.kmm that
enables you to rename a favorite, select a folder, and write the favorite to that folder.
Windows Script Host 1.0 (or better) required!
WSH is part of Microsoft Internet Explorer 5.0 and newer. Latest version of WSH is
available at http://msdn.microsoft.com/scripting/
*/
if(WScript.Arguments.count()==2)
{
var WshShell = new ActiveXObject("WScript.Shell")
if (WScript.Arguments(0) == 1)
{
WshShell.RegWrite ("HKCU\\Software\\KMELEON\\FavRenAdd\\URLname", WScript.Arguments(1), "REG_SZ");
}
if (WScript.Arguments(0) == 2)
{
WshShell.RegWrite ("HKCU\\Software\\KMELEON\\FavRenAdd\\URLdisc", WScript.Arguments(1), "REG_SZ");
}
if (WScript.Arguments(0) == 3)
{
WScript.Sleep(1000);
var $_FavRenAdd_PathName = WshShell.RegRead ("HKCU\\Software\\KMELEON\\FavRenAdd\\URLname") ;
var $_FavRenAdd_CurURL = WshShell.RegRead ("HKCU\\Software\\KMELEON\\FavRenAdd\\URLdisc") ;
var oShellLink = WshShell.CreateShortcut($_FavRenAdd_PathName);
oShellLink.TargetPath = $_FavRenAdd_CurURL;
oShellLink.Save();
WshShell.RegDelete ("HKCU\\Software\\KMELEON\\FavRenAdd\\URLname") ;
WshShell.RegDelete ("HKCU\\Software\\KMELEON\\FavRenAdd\\URLdisc") ;
}
}
else
{
objArgs = WScript.Arguments ;
WScript.Echo(WScript.Arguments.Count());
for (i=0; i<objArgs.length; i++)
{
WScript.Echo(objArgs(i))
}
}
But when I look under "Favoriten in K-Meleon the saved link didn`t exist.
I must clode K-Meleon and shot all processes called k-meleon.exe away.
Then I start K-Meleon and I can see the link.
Whats going wrong there?
When I start the PC (and the K-Meleon Loader) ist comes an error MSGbox with 5 rows.
The first is this
"Error in davrenadd.kmm
C:\...\favrenadd.kmm at line 41 expected but found <name>"
The other 4 rows are nearly the same.
Whats going wrong there?
How must I save the two files ANSI, UTF-8???
First item is that FavRenAdd works outside of KM. Information is sent to the js file and that script creates the link. KM's IE Favorites dll only reads your favorites once - when it starts. In order to see and use the new links from FavRenAdd you can use the "Edit" item in the favorites menu. That option reads the favorites in real time. The only other option is to stop and restart KM.
As for the second item, I don't know why the error. Are you using the version of FavRenAdd in the MacroLibrary or the international version from my earlier post?
Quote Roger When I start the PC (and the K-Meleon Loader) ist comes an error MSGbox with 5 rows.
The first is this
"Error in davrenadd.kmm
C:\...\favrenadd.kmm at line 41 expected but found <name>"
The other 4 rows are nearly the same.
Whats going wrong there?
How must I save the two files ANSI, UTF-8???
The lines 38 thru 42 should look like the following.
I don't know why you are getting the error. I have the international version running on my KM 1.1.6 and I do not get any error. Which version of KM are you using? Maybe it would be good to try to save the FavRenAdd.kmm file again. The first line to save begins with "# K-Meleon Macros (http://kmeleon" and the last line to save begins with "$macroModules=$macroModules".
It is best to save files needed for KM in the UTF8 without BOM format.
No need to be sorry to be new. We were all new at some time. We all try to help answer questions when we can.
Disregard previous post. Not your fault. I moved international version to my KM 1.5 and I get the error. I will do some testing and get a repost as quick as I can.
Congratulations, you have just become a beta tester and have completed your first bug report. I forgot to test in KM 1.5 and that version has a more strict macro language.
To fix your FavRenAdd.kmm file you can replace just a few lines of code.
Because I have a mental block, I guess, when it comes to the \" and " combinations.
I will try out the simple version use that for the copy for the MacroLibrary. I am waiting to see how it does for Roger before I put it in the MacroLibrary.
Hi,
thanks now i works.
I have edit the lines from your post from 13. August 2008 15:44.
Yes I use KM 1.5.0
One problem exist.
But when I look under "Favoriten in K-Meleon the saved link didn`t exist.
I must clode K-Meleon and shot all processes called k-meleon.exe away.
Then I start K-Meleon and I can see the link.
What must I exactly change?
See my post of August 12 for reason you do not see new links until you restart KM.
I will investigate the possible fixes for this problem that JujuLand and desga2 suggested in posts of the same date. I am having a computer hardware problem now, so it may take some time before I can get to work on this.
I am glad to hear that FavRenAdd international version is working for you. Thanks for your patience and help.
@ JamesD:
If you look in "menus.cfg" file in \defaults\settings folder you can found that Favorites in menus are included with command "favorites()".
Are you tried with something similar to:
Hi, one question
when I add a favorite then the box will be displayed an I type a name for the favorite und press ok.
Then comes the dialog where I must say where the favorite should be saved.
But when I click there on cancelled the url will be saved nevertheless in the favorite folder.
Can you please fix this?
Thanks