General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: JamesD
Date: December 22, 2008 08:13PM

I have code that shows a menu for a new macro that is working just fine in 1.5.2 RC2 but I don't see my menu item when I use the macro with 1.1.6. Nothing shows in the error console. As far as I can tell the menus.cfg files from each version have no changes in KMDocs part of the help menu. Any ideas why it does not create a menu item in 1.1.6?

This is the code::
_Training_BuildMenu{
$_Training_Num = 1 ;
# add another option to Help menu
$Training_Popm = "Training" ;
setmenu("KMDocs",popup,$Training_Popm,2);
setmenu($Training_Popm,"macro","Overview","_Training_OverView");
setmenu($Training_Popm,"macro","PromptForFolder","_Training_FolderCode");
setmenu($Training_Popm,"macro","Gensub","_Training_GensubCode");
setmenu($Training_Popm,"macro","$Arg","Training_ArgCode(menu)");
macros(Training_Chapters) ;
macros(_Training_accelerators) ;
}


Options: ReplyQuote
Re: Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: desga2
Date: December 22, 2008 08:29PM

First, in K-Meleon 1.1.6 never can show macro errors in Error Console because this feature in implemented in 1.5.1 and later.

Second no changes in Help menu, but this code never work because you have a mistake: tongue sticking out smiley
_Training_BuildMenu{
$_Training_Num = 1 ;
# add another option to Help menu
$Training_Popm = "Training" ;
setmenu("KMDocs",popup,$Training_Popm,2);
setmenu($Training_Popm,"macro","Overview","_Training_OverView");
setmenu($Training_Popm,"macro","PromptForFolder","_Training_FolderCode");
setmenu($Training_Popm,"macro","Gensub","_Training_GensubCode");
setmenu($Training_Popm,"macro","$Arg","Training_ArgCode(menu)");
macros(Training_Chapters) ;
macros(_Training_accelerators) ;
}

Are you sure this line of code work in 1.5.x?
setmenu($Training_Popm,"macro","$Arg","Training_ArgCode(menu)");

Try with something like this:
setmenu($Training_Popm,"macro",$Arg,"Training_ArgCode(menu)");

Or this:

setmenu($Training_Popm,"macro",$Arg,"Training_ArgCode(".$menu.")");

But i can help you more without all your macro code. sad smiley

K-Meleon in Spanish



Edited 2 time(s). Last edit at 12/22/2008 08:32PM by desga2.

Options: ReplyQuote
Re: Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: JamesD
Date: December 22, 2008 09:40PM

@ desga2

The "$Arg" is not being used a an argument. It is the caption of a popup menu item. I have been running this in 1.5.2 RC for testing, but I needed to test in 1.1.6 to check the code you provided for KM versions.

There are two kmm files now with more to come as I complete them. All the testing for prompt is not complete.

Training.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- Training.kmm
# ---------- K-Meleon Macro Language Training/Example ---------------
#
# Dependencies        : main.kmm  K-Meleon ver 1.1 or later
# Resources           : -
# Preferences         : -
# Version             : - 0.5   2008-12-17
# --------------------------------------------------------------------------------
#
####  PUBLIC MACROS ----------

Training_ArgCode{
$_Training_ArgVal = $ARG ;
$_Training_ArgVal == "menu" ? &_Training_ArgCodeA : 0 ; 
$_Training_ArgVal == "F8" ? &_Training_ArgCodeB : 0 ;
}

####  PRIVATE MACROS ---------

_Training_OverView{
$_Training_Text01 = "This 'Training' macro is provided to help users understand some statements";
$_Training_Text02 = "in the Macro Language which is a part of K-Meleon.";
$_Training_Text03 = "This macro file controls additional macro files designated as 'Training1[2][3]'.";
$_Training_Text04 = "Not all files are available yet.  They will be added as they become available. ";
alert($_Training_Text01."\n".$_Training_Text02."\n\n".$_Training_Text03."\n".$_Training_Text04, "Overview of 'Training'", "INFO");
$_Training_Text01 = "Each macro statement or concept will be reachable from the Training popup menu. ";
$_Training_Text02 = "Individual units do not follow each other.  You must choose an item from the menu. ";
$_Training_Text03 = "The additional macro files may each be made inactive via the Macro Extension  ";
$_Training_Text04 = "in preferences.  You can do this for units on which you no longer need help. ";
alert($_Training_Text01."\n".$_Training_Text02."\n\n".$_Training_Text03."\n".$_Training_Text04, "Overview of 'Training' (2)", "INFO");
$_Training_Version_Pref="general.useragent.vendorSub";
$_Training_User_Ver=getpref(STRING, $_Training_Version_Pref);
##  $_Training_User_Ver=substr(getpref(STRING, $Training_Version_Pref), 0, 3);
##  double conditional  ==> _KMVersion=="1.5"?$kSessions==true?&_Sessions_BuildMenu_15:0:0;
$_Training_Text01 = "The Macro Language has evolved through each new version of K-Meleon.";
$_Training_Text02 = "Some current language statements may not be not available to the version" ;
$_Training_Text03 = "of the browser that you are using.  Training will tell you if the version" ;
$_Training_Text04 = "you are using does not support a particular statement.";
$_Training_Text05 = "You are current using K-Meleon ";
alert($_Training_Text01."\n".$_Training_Text02."n\n".$_Training_Text03."\n".$_Training_Text04."\n\n".$_Training_Text05.$_Training_User_Ver, "Overview of 'Training' (3)", "INFO");
}

_Training_FolderCode{
alert("Allow user to select folder. \n\n No initial folder \n No programed requirement", "Using promptforfolder") ;
$_Training_SubFolder=promptforfolder("Select a folder for use") ;
alert( $_Training_SubFolder, "Folder user selected", "INFO") ;
alert("Allow user to select folder. \n\n Set initial folder to originating folder \n No programed requirement", "Using promptforfolder") ;
$_Training_SubFolder=promptforfolder("Select a folder for use", $_Training_Path) ;
alert( $_Training_SubFolder, "Folder user selected", "INFO") ;
macros(_Training_FolderCode2) ;
}

_Training_FolderCode2{
alert("Allow user to select folder. \n\n Set initial folder to Favorites \n Require Favorites or subfolder", "Using promptforfolder") ;
####   look three places for the favorites directory
$_Training_FavFolder=getpref(STRING,"kmeleon.plugins.favorites.directory");
$_Training_FavFolder==""?$_Training_FavFolder=readreg("HKCU","Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Favorites"):0;
$_Training_FavFolder==""?$_Training_FavFolder=readreg("HKLM","Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Favorites"):0;
####   $_Training_FavFolder should have the path for the favorites folder   c:\something\favorites
####   call _Training_RnameTrue_loop until $_Training_SubFolder is no longer a "?"
$_Training_SubFolder="?";   while($_Training_SubFolder=="?") &_Training_NameTrue_loop;
$_Training_SubFolder == "" ? alert($_Training_FavFolder, "The selected folder", "INFO") : alert($_Training_FavFolder."\\".$_Training_SubFolder, "The selected folder", "INFO") ;
}

_Training_NameTrue_loop{
$_Training_SubFolder=promptforfolder (_("Specify where to add the new shortcut. Select your Favorites folder or one of its subfolders:"),$_Training_FavFolder);
$_Training_SubFolder=$_Training_SubFolder=="" ? "" : index($_Training_SubFolder,$_Training_FavFolder) == 0 ? substr($_Training_SubFolder,length($_Training_FavFolder)+1) : "?";
}

_Training_GensubCode{
$_Training_Text01 = "$SUB = gensub( r, s, h, t );" ;
$_Training_Text02 = "Searches the target string t for matches of the string r." ;
$_Training_Text03 = "If h is a string beginning with 'g' or 'G', then all matches" ; 
$_Training_Text04 = "of r are replaced with s. Otherwise, h is a number indicating" ; 
$_Training_Text05 = "which match of r to replace. The modified string is returned." ;
alert($_Training_Text01."\n".$_Training_Text02."\n".$_Training_Text03."\n".$_Training_Text04."\n".$_Training_Text05, "gensub statement", "INFO");
$_Training_Target = "copper is a color for corporate" ;
alert($_Training_Target, "The target string (t)") ;
$_Training_Match = "co" ;
$_Training_Replace = "To" ;
alert("The match string (r) is  '".$_Training_Match."'\n\n The replacement string (s) is  '".$_Training_Replace."'", "The match and replace strings", "INFO");  
$_Training_GOut = gensub($_Training_Match, $_Training_Replace, "G" ,$_Training_Target) ;
$_Training_Text01 = "$_Training_GOut = gensub($_Training_Match, $_Training_Replace, 'G' ,$_Training_Target) ;" ;
alert($_Training_GOut."\n\n".$_Training_Text01, "Global replacement", "INFO") ;
$_Training_GOut = gensub($_Training_Match, $_Training_Replace, "1" ,$_Training_Target) ;
$_Training_Text02 = "$_Training_GOut = gensub($_Training_Match, $_Training_Replace, '1' ,$_Training_Target) ;" ;
alert($_Training_GOut."\n\n".$_Training_Text02, "First replacement only", "INFO") ;
}

_Training_ArgCodeA{
$_Training_Text01 = "setmenu($_Training_Popm,'macro','$Arg','Training_ArgCode(menu)');" ;
alert("A choice was made within the Training_ArgCode macro \n based on the argument passed from the setmenu statement. \n\n The argument was 'menu'.\n\n" . $_Training_Text01 , " $ARG - argument in setmenu statement", "INFO"); 
alert("After you click OK for this message, \n\n please press the CTRL + SHIFT + F8 together.", "To test another method", "INFO");
}

_Training_ArgCodeB{
$_Training_Text01 = "setaccel( 'CTRL SHIFT VK_F8' ,'macros(Training_ArgCode(F8))');"; 
alert("A choice was made within the Training_ArgCode macro \n based on the argument passed from the setaccel statement. \n\n The argument was 'F8'.\n\n" . $_Training_Text01, " $ARG - argument in setaccel statement", "INFO"); 
alert("Training actually finished running before you pressed CTRL + SHIFT + F8. \n Your keypresses restarted Training_ArgCode and and passed 'F8' \n as an argument.", "$ARG examples finished", "INFO"); 
}

_Training_BuildMenu{
$_Training_Num = 1 ;
# add another option to Help menu
$Training_Popm = "Training" ;
setmenu("KMDocs",popup,$Training_Popm,2);
setmenu($Training_Popm,"macro","Overview","_Training_OverView");
setmenu($Training_Popm,"macro","PromptForFolder","_Training_FolderCode");
setmenu($Training_Popm,"macro","Gensub","_Training_GensubCode");
setmenu($Training_Popm,"macro","$Arg","Training_ArgCode(menu)");
macros(Training_Chapters) ;
macros(_Training_accelerators) ;
}

_Training_accelerators{
setaccel( "CTRL SHIFT VK_F8" ,"macros(Training_ArgCode(F8))"); 
}

Training_Chapters{
while($_Training_Num < 20) &_Training_Chapters_Loop ;
}
_Training_Chapters_Loop{
$_Training_File = "Training". $_Training_Num . ".kmm" ;
$_Training_ChapExist = readfile($_Training_Path."\\".$_Training_File );
$_Training_File_Menu = "Training". $_Training_Num . "_BuildMenu" ;
$_Training_ChapExist != "" ? macros($_Training_File_Menu) : 0 ;
$_Training_Num = $_Training_Num + 1 ;
}

_Training_GetPath{
## Training.kmm will be located in one of two possible locations
## If readfile finds nothing at MacroFolder then the location is UserMacroFolder
$_Training_Data=readfile(getfolder(MacroFolder)."\\Training.kmm");
$_Training_Path=getfolder($_Training_Data==""?UserMacroFolder:MacroFolder);
}

# -------  Startup Order of Precedence
# -------         Init
# -------         Setup
## $_Training_Path is required to execute _Training_Chapters 
## which is called from _Training_BuildMenu 

$OnInit=$OnInit."_Training_GetPath;";
$OnStartup=$OnStartup."_Training_BuildMenu;";
$macroModules=$macroModules."Training;";

################  END OF TRAINING.KMM  ###############################

Training1.kmm
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- Training1.kmm
# ---------- K-Meleon Macro Language Training/Example ---------------
# ---------- CHAPTER 1
#
# Dependencies : main.kmm Training.kmm K-Meleon ver 1.1 or later
# Resources : -
# Preferences : -
# Version : - 0.1 2008-12-17
# --------------------------------------------------------------------------------

Training1_PromptCode{
#-- $VALUE = prompt( MESSAGE [, TITLE [, DEFAULT]] );
#$_Training1_Result_Bounds = 0 ;
$_Training1_Result = prompt("Select a whole number from zero to ten", "prompt example", 5);
$_Training1_Result != "" ? alert($_Training1_Result, "Your answer from prompt") : alert("Cancel", "Your answer from prompt");
macros(_Training1_PromptValid) ;
$_Training1_Text01 = "The prompt statement is used to send a message to the user. \n" ;
$_Training1_Text02 = "The user must interact with the message display box in order \n" ;
$_Training1_Text03 = "for the macro to continue. \n The user's interaction is returned " ;
$_Training1_Text04 = "to the macro where the results \n can be acted upon. \n\n ";
$_Training1_Text05 = "$VALUE = prompt( MESSAGE [, TITLE [, DEFAULT]] ); \n\n ";
$_Training1_Text06 = "The prompt requesting a number looks like this: \n\n Result = prompt('Select a number between zero and ten', 'prompt example', 5);";
alert($_Training1_Text01.$_Training1_Text02.$_Training1_Text03.$_Training1_Text04.$_Training1_Text05.$_Training1_Text06,"prompt example", "INFO");
}

_Training1_PromptValid{
$_Training1_Version_Pref="general.useragent.vendorSub";
$_Training1_User_Ver=substr(getpref(STRING, $_Training1_Version_Pref), 0, 3);
# choice 1.5 series = later version while other = early version
$_Training1_User_Ver == "1.5" ? &_Training1_PromptValidL : &_Training1_PromptValidE ;
}

_Training1_PromptValidL{
$_Training1_RCnt = 0 ;
$_Training1_Result > 10 ? $_Training1_RBI = 1 : 0;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_Result < 0 ? $_Training1_RBI = 1 : 0;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RCnt >= 1 ? alert($_Training1_Result, "Your answer was not an integer within the range.", "EXCLAIM"):0;
}

_Training1_PromptValidE{
alert("we are running _Training1_PromptValidE");
$_Training1_RCnt = 0 ;
$_Training1_ResultLength = length($_Training1_Result);
$_Training1_ResultLength == 1 ? &_Training1_PVE_CaseZero : 0;
$_Training1_RCnt == 1 ? 0 : &_Training1_PVE_CaseZero ;
$_Training1_RCnt >= 1 ? alert($_Training1_Result, "Your answer was not an integer within the range.", "EXCLAIM"):0;
}

_Training1_PVE_CaseNonZero{
$_Training1_RBI = 0 ;
$_Training1_ResultLength == 1 ? $_Training1_Result = "0" . $_Training1_Result :0;
#alert($_Training1_Result. " is the value") ;
$_Training1_RBI = $_Training1_Result > "10" ? 1 : 0;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = 0 ;
$_Training1_RBI = $_Training1_Result < "0" ? 1 : 0;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
#alert($_Training1_RCnt, "RCnt value", "EXCLAIM");
$_Training1_RBI = 0 ;
$_Training1_Result_First = substr($_Training1_Result,0,1);
## Does it sort > 0 and less than 11 ?
$_Training1_RBI=$_Training1_Result_First > "0" ? $_Training1_Result_First < "11" ? 0:1:1 ;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
alert($_Training1_RCnt, "RCnt value", "EXCLAIM");
}

_Training1_PVE_CaseZero{
$_Training1_Result == "0" ? 0 : $_Training1_RCnt = 1 ;
macros(_Training1_PVE_NonZero);
}

Training1_ConfirmCode{
#-- $RESULT = confirm( MESSAGE [, TITLE [, BUTTONS [, ICON]]] );
#-- BUTTONS = RETRYCANCEL | YESNO | YESNOCANCEL | ABORTRETRYIGNORE
#-- ICON = EXCLAIM | INFO | STOP | QUESTION
#-- RESULT = OK | YES | NO |ABORT | RETRY | IGNORE | 0
$_Training1_Text01 = "The confirm statement is used to send a message to the user. \n" ;
$_Training1_Text02 = "The user must interact with the message display box in order \n" ;
$_Training1_Text03 = "for the macro to continue. \n The user's interaction is returned " ;
$_Training1_Text04 = "to the macro where the results \n can be acted upon. \n\n Can you see this message?";
$_Training1_Result = confirm($_Training1_Text01.$_Training1_Text02.$_Training1_Text03.$_Training1_Text04,"confirm statement","YESNO",QUESTION) ;
$_Training1_Result == "NO" ? $_Training1_Result=confirm("You could not see prior message?", "received 'NO' from previous", "YESNO",EXCLAIM) :0 ;
$_Training1_Result == "YES" ? $_Training1_Result=confirm("Good, you did see it.", "received 'YES' from previous", "YESNO","EXCLAIM") :0 ;
$_Training1_Text01 = "are shown below. Some shortning of text was done so they would fit \n\n" ;
$_Training1_Text02 = "Result=confirm('Bunch of text','confirm statement','YESNO','QUESTION'); \n" ;
$_Training1_Text03 = "Result=confirm('You could not see prior message?', 'received 'NO' from previous', 'YESNO','EXCLAIM'); \n" ;
$_Training1_Text04 = "Result=confirm('Good, you did see it.', 'received 'YES' from previous', 'YESNO','EXCLAIM'); \n" ;
$_Training1_Text05 = "Bye the way, your last answer was ".$_Training1_Result. "." ;
alert($_Training1_Text01.$_Training1_Text02.$_Training1_Text03.$_Training1_Text04.$_Training1_Text05, "The previous confirm statements");
$_Training1_Text01 = "$RESULT = confirm( MESSAGE [, TITLE [, BUTTONS [, ICON]]] ); \n" ;
$_Training1_Text02 = "BUTTONS = RETRYCANCEL | YESNO | YESNOCANCEL | ABORTRETRYIGNORE \n" ;
$_Training1_Text03 = "ICON = EXCLAIM | INFO | STOP | QUESTION \n " ;
$_Training1_Text04 = "RESULT = OK | YES | NO |ABORT | RETRY | IGNORE | 0 \n\n";
$_Training1_Text05 = "Do you need to view other combinations of buttons and icons? ";
$_Training1_Result = confirm($_Training1_Text01.$_Training1_Text02.$_Training1_Text03.$_Training1_Text04.$_Training1_Text05, "confirm message box", "YESNO");
$_Training1_Result == "YES" ? macros(_Training1_ConfirmCodeA) : 0 ;
}

_Training1_ConfirmCodeA{
#alert("the user wants more");
$_Training1_Result = confirm("Choose an action", "The process stopped", "ABORTRETRYIGNORE", "STOP");
$_Training1_Text01 = "Result = confirm('Choose an action', 'The process stopped', 'ABORTRETRYIGNORE', 'STOP');";
alert("Your reply generated this answer " . $_Training1_Result. "\n\n The code was as follows \n\n". $_Training1_Text01, "confirm with buttons 'ABORTRETRYIGNORE'");
$_Training1_Result = confirm("Do you want to try another answer?", "Replay previous", "YESNOCANCEL");
$_Training1_Text01 = "Result = confirm('Do you want to try another answer?', 'Replay previous', 'YESNOCANCEL');" ;
$_Training1_Result == "YES" ? $_Training1_Text02 = "Other possible answers were NO or 0." :0;
$_Training1_Result == "NO" ? $_Training1_Text02 = "Other possible answers were YES or 0." :0;
$_Training1_Result == 0 ? $_Training1_Text02 = "Other possible answers were NO or YES." :0;
alert("Your reply generated this answer " . $_Training1_Result. "\n\n". $_Training1_Text02."\n\n The code was as follows \n\n". $_Training1_Text01, "confirm - replay previous");
$_Training1_Result == "YES" ? &_Training1_ConfirmCodeA : 0;
}

Training1_AlertCode{
#-- alert( MESSAGE [, TITLE [, ICON]] );
#-- ICON = EXCLAIM | INFO | STOP | QUESTION
$_Training1_Text01 = "The alert statement is used to send a message to the user. \n" ;
$_Training1_Text02 = "The user must interact with the message display box in order \n" ;
$_Training1_Text03 = "for the macro to continue. \n\n This is an alert message." ;
alert($_Training1_Text01.$_Training1_Text02.$_Training1_Text03, "alert message box", "INFO");
$_Training1_Text01 = "alert( MESSAGE [, TITLE [, ICON]] ); \n\n TITLE and ICON are optional. \n" ;
$_Training1_Text02 = "ICON can have one of the following values \n" ;
$_Training1_Text03 = "EXCLAIM | INFO | STOP | QUESTION \n\n EXCLAIM was used in this alert." ;
alert($_Training1_Text01.$_Training1_Text02.$_Training1_Text03, "form of the alert statement", "EXCLAIM");
alert("Neither TITLE nor ICON is used in this alert");
}

Training1_BuildMenu{
# add additional lines to the training menu
setmenu($Training_Popm,"macro","[1] Prompt","Training1_PromptCode");
setmenu($Training_Popm,"macro","[1] Confirm","Training1_ConfirmCode");
setmenu($Training_Popm,"macro","[1] Alert","Training1_AlertCode");
}

$macroModules=$macroModules."Training1;";
################ END OF TRAINING1.KMM ###############################



Options: ReplyQuote
Re: Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: gvgerman
Date: December 23, 2008 03:12AM

@ JamesD

On another macro matter, are you experiencing issues w/ 1.5.2RC and KmmResProfile? When I use it, I get an error message that Windows can not find the path to ResProfile.js

I have both ResProfile.kmm and ResProfile.js located in the macros folder w/in the profile. I am using a local profile, ala Pocket K-Meleon. I've not had issues until recently (I know the macro worked w/ pocket versions prior to 1.5; I don't recall if I ever used the macro w/ 1.5 or later versions).

For the record, regardless of the error message, all files seem to copy to the selected back-up folder except the bookmark file (but I did not do a complete file-for-file comparison).

Beginning w/ 1.5 versions, the profile folder contains the *.default folder. Could this be causing any issue? Any help would be appreciated. If you need any info from me, please let me know.

Thanks, and regards,

Options: ReplyQuote
Re: Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: JamesD
Date: December 23, 2008 03:29AM

For anyone testing Training.kmm and Training1.kmm

You should replace the _Training1_PromptValidL macro in Training1.kmm with the code below. This seems to correctly validate the user input.


_Training1_PromptValidL{
$_Training1_RCnt = 0 ;
$_Training1_RBI = 10 < $_Training1_Result ? 1 : 0;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = 0 > $_Training1_Result ? 1 : 0;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
## / operator produces an integer result
$_Training1_DecChek = $_Training1_Result / 1 ;
$_Training1_CrChek = $_Training1_Result == $_Training1_DecChek ? 0 : 1;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_CrChek ;
$_Training1_Text01 = "\n\n The acceptable values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10." ;
$_Training1_RCnt >= 1 ? alert($_Training1_Result.$_Training1_Text01, "Your answer was not an integer within the range.", "EXCLAIM"):0;
}


Options: ReplyQuote
Re: Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: JamesD
Date: December 23, 2008 03:58AM

@ gvgerman

I just ran ResProfile with it located in user macros and then again with it located in macros. Both times it wrote the files to the folder I selected. I use Favorites so I only have the default bookmarks file, but it did copy that.

There is no default folder. The folders in the profile are Cache, chrome, and macros. At least those are the only ones on my setup. I use a single profile and have only tested on a single profile.

ResProfile.js uses the objfso.copyfolder statement so everything in the profile folder should be copied.

Options: ReplyQuote
Re: Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: gvgerman
Date: December 23, 2008 04:11AM

@ JamesD

Thanks.
I did a clean install and all is working as before - meaning as intended.
I should have tried this first.
Thanks, again,



Edited 2 time(s). Last edit at 12/23/2008 04:12AM by gvgerman.

Options: ReplyQuote
Re: Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: desga2
Date: December 23, 2008 06:59AM

@ gvgerman:
Can your problem is originated by my modified xpcom-core.dll file for K-Meleon portable?

K-Meleon in Spanish

Options: ReplyQuote
Re: Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: JamesD
Date: December 23, 2008 01:10PM

I found the answer. I changed the location for the menu in Training.kmm from KMDocs to &Help. I am not sure why KMDocs does not work in 1.1.6 and I am not planning to spend time to find out.

Just edit Training.kmm and change KMDocs to &Help.

Options: ReplyQuote
Re: Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: JamesD
Date: December 23, 2008 01:58PM

This is an updated Training1.kmm file. I think I now have the validation from prompt working for both 1.1.x and 1.5.x versions.

Training1.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- Training1.kmm
# ---------- K-Meleon Macro Language Training/Example ---------------
# ---------- CHAPTER 1
#
# Dependencies        : main.kmm Training.kmm K-Meleon ver 1.1 or later
# Resources           : -
# Preferences         : -
# Version             : - 0.3   2008-12-23
# --------------------------------------------------------------------------------

Training1_PromptCode{
#--    $VALUE = prompt( MESSAGE [, TITLE [, DEFAULT]] );
#$_Training1_Result_Bounds = 0 ;
$_Training1_Result = prompt("Select a whole number from zero to ten", "prompt example", 5);
$_Training1_Result != "" ? alert($_Training1_Result, "Your answer from prompt") : alert("Cancel", "Your answer from prompt");
macros(_Training1_PromptValid) ;
$_Training1_Text01 = "The prompt statement is used to send a message to the user. \n" ;
$_Training1_Text02 = "The user must interact with the message display box in order \n" ;
$_Training1_Text03 = "for the macro to continue.  \n The user's interaction is returned " ;
$_Training1_Text04 = "to the macro where the results \n can be acted upon. \n\n ";
$_Training1_Text05 = "$VALUE = prompt( MESSAGE [, TITLE [, DEFAULT]] ); \n\n ";
$_Training1_Text06 = "The prompt requesting a number looks like this: \n\n Result = prompt('Select a number between zero and ten', 'prompt example', 5);";
alert($_Training1_Text01.$_Training1_Text02.$_Training1_Text03.$_Training1_Text04.$_Training1_Text05.$_Training1_Text06,"prompt example", "INFO");
}

_Training1_PromptValid{
$_Training1_Version_Pref="general.useragent.vendorSub";
$_Training1_User_Ver=substr(getpref(STRING, $_Training1_Version_Pref), 0, 3);
# choice 1.5 series = later version while other = early version
$_Training1_User_Ver == "1.5" ? &_Training1_PromptValidL : &_Training1_PromptValidE ;
}

_Training1_PromptValidL{
$_Training1_RCnt = 0 ;
$_Training1_RBI = 10 < $_Training1_Result ? 1 : 0;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = 0 > $_Training1_Result ? 1 : 0;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
## / operator produces an integer result
$_Training1_DecChek = $_Training1_Result / 1 ;
$_Training1_CrChek = $_Training1_Result == $_Training1_DecChek ? 0 : 1;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_CrChek ;
$_Training1_Text01 = "\n\n The acceptable values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10." ;
$_Training1_RCnt >= 1 ? alert($_Training1_Result.$_Training1_Text01, "Your answer was not an integer within the range.", "EXCLAIM"):0;
}

_Training1_PromptValidE{
$_Training1_RCnt = 0 ;
$_Training1_RBI = $_Training1_Result == 0 ? 0 : 1 ;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = $_Training1_Result == 1 ? 0 : 1 ;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = $_Training1_Result == 2 ? 0 : 1 ;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = $_Training1_Result == 3 ? 0 : 1 ;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = $_Training1_Result == 4 ? 0 : 1 ;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = $_Training1_Result == 5 ? 0 : 1 ;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = $_Training1_Result == 6 ? 0 : 1 ;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = $_Training1_Result == 7 ? 0 : 1 ;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = $_Training1_Result == 8 ? 0 : 1 ;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = $_Training1_Result == 9 ? 0 : 1 ;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_RBI = $_Training1_Result == 10 ? 0 : 1 ;
$_Training1_RCnt = $_Training1_RCnt + $_Training1_RBI ;
$_Training1_Text01 = "\n\n The acceptable values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10." ;
$_Training1_RCnt > 10 ? alert($_Training1_Result.$_Training1_Text01, "Your answer was not an integer within the range.", "EXCLAIM"):0;
}

Training1_ConfirmCode{
#--    $RESULT = confirm( MESSAGE [, TITLE [, BUTTONS [, ICON]]] );
#--    BUTTONS = RETRYCANCEL | YESNO | YESNOCANCEL | ABORTRETRYIGNORE
#--    ICON = EXCLAIM | INFO | STOP | QUESTION
#--    RESULT = OK | YES | NO |ABORT | RETRY | IGNORE | 0
$_Training1_Text01 = "The confirm statement is used to send a message to the user. \n" ;
$_Training1_Text02 = "The user must interact with the message display box in order \n" ;
$_Training1_Text03 = "for the macro to continue.  \n The user's interaction is returned " ;
$_Training1_Text04 = "to the macro where the results \n can be acted upon. \n\n Can you see this message?";
$_Training1_Result = confirm($_Training1_Text01.$_Training1_Text02.$_Training1_Text03.$_Training1_Text04,"confirm statement","YESNO",QUESTION) ;
$_Training1_Result == "NO" ? $_Training1_Result=confirm("You could not see prior message?", "received 'NO' from previous", "YESNO",EXCLAIM) :0 ;
$_Training1_Result == "YES" ? $_Training1_Result=confirm("Good, you did see it.", "received 'YES' from previous", "YESNO","EXCLAIM") :0 ;
$_Training1_Text01 = "are shown below.  Some shortning of text was done so they would fit \n\n" ;
$_Training1_Text02 = "Result=confirm('Bunch of text','confirm statement','YESNO','QUESTION'); \n" ;
$_Training1_Text03 = "Result=confirm('You could not see prior message?', 'received 'NO' from previous', 'YESNO','EXCLAIM'); \n" ;
$_Training1_Text04 = "Result=confirm('Good, you did see it.', 'received 'YES' from previous', 'YESNO','EXCLAIM'); \n" ;
$_Training1_Text05 = "Bye the way, your last answer was  ".$_Training1_Result. "." ;
alert($_Training1_Text01.$_Training1_Text02.$_Training1_Text03.$_Training1_Text04.$_Training1_Text05, "The previous confirm statements");
$_Training1_Text01 = "$RESULT = confirm( MESSAGE [, TITLE [, BUTTONS [, ICON]]] ); \n" ;
$_Training1_Text02 = "BUTTONS = RETRYCANCEL | YESNO | YESNOCANCEL | ABORTRETRYIGNORE \n" ;
$_Training1_Text03 = "ICON = EXCLAIM | INFO | STOP | QUESTION \n " ;
$_Training1_Text04 = "RESULT = OK | YES | NO |ABORT | RETRY | IGNORE | 0 \n\n";
$_Training1_Text05 = "Do you need to view other combinations of buttons and icons? ";
$_Training1_Result = confirm($_Training1_Text01.$_Training1_Text02.$_Training1_Text03.$_Training1_Text04.$_Training1_Text05, "confirm message box", "YESNO");
$_Training1_Result == "YES" ? macros(_Training1_ConfirmCodeA) : 0 ;
}

_Training1_ConfirmCodeA{
#alert("the user wants more");
$_Training1_Result = confirm("Choose an action", "The process stopped", "ABORTRETRYIGNORE", "STOP");
$_Training1_Text01 = "Result = confirm('Choose an action', 'The process stopped', 'ABORTRETRYIGNORE', 'STOP');";
alert("Your reply generated this answer " . $_Training1_Result. "\n\n The code was as follows \n\n". $_Training1_Text01, "confirm with buttons 'ABORTRETRYIGNORE'");
$_Training1_Result = confirm("Do you want to try another answer?", "Replay previous", "YESNOCANCEL");
$_Training1_Text01 = "Result = confirm('Do you want to try another answer?', 'Replay previous', 'YESNOCANCEL');" ;
$_Training1_Result == "YES" ? $_Training1_Text02 = "Other possible answers were  NO or 0." :0; 
$_Training1_Result == "NO" ? $_Training1_Text02 = "Other possible answers were  YES or 0." :0;
$_Training1_Result == 0 ? $_Training1_Text02 = "Other possible answers were  NO or YES." :0;
alert("Your reply generated this answer " . $_Training1_Result. "\n\n". $_Training1_Text02."\n\n The code was as follows \n\n". $_Training1_Text01, "confirm - replay previous");
$_Training1_Result == "YES" ? &_Training1_ConfirmCodeA : 0;
}

Training1_AlertCode{
#--  alert( MESSAGE [, TITLE [, ICON]] );
#--  ICON = EXCLAIM | INFO | STOP | QUESTION  
$_Training1_Text01 = "The alert statement is used to send a message to the user. \n" ;
$_Training1_Text02 = "The user must interact with the message display box in order \n" ;
$_Training1_Text03 = "for the macro to continue.  \n\n This is an alert message." ;
alert($_Training1_Text01.$_Training1_Text02.$_Training1_Text03, "alert message box", "INFO");
$_Training1_Text01 = "alert( MESSAGE [, TITLE [, ICON]] ); \n\n TITLE and ICON are optional. \n" ;
$_Training1_Text02 = "ICON can have one of the following values \n" ;
$_Training1_Text03 = "EXCLAIM | INFO | STOP | QUESTION \n\n EXCLAIM was used in this alert." ;
alert($_Training1_Text01.$_Training1_Text02.$_Training1_Text03, "form of the alert statement", "EXCLAIM");
alert("Neither TITLE nor ICON  is used in this alert");
}

Training1_BuildMenu{
# add additional lines to the training menu
setmenu($Training_Popm,"macro","[1]   Prompt","Training1_PromptCode");
setmenu($Training_Popm,"macro","[1]   Confirm","Training1_ConfirmCode");
setmenu($Training_Popm,"macro","[1]   Alert","Training1_AlertCode");
}

$macroModules=$macroModules."Training1;";
################  END OF TRAINING1.KMM  ###############################


Options: ReplyQuote
Re: Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: gvgerman
Date: December 23, 2008 03:30PM

@ desga2

Quote
desga2
@ gvgerman:
Can your problem is originated by my modified xpcom-core.dll file for K-Meleon portable?

The profile back-up macro works with either xpcom-core file, yours or the original. A clean install fixed all.

Options: ReplyQuote
Re: Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: JamesD
Date: December 23, 2008 06:27PM

I finally found the problem. It turns out that I had the buildmenu in the onstartup. It needed to be in the oninit. The menu icons are back!!

That's from http://kmeleonbrowser.org/forum/read.php?3,86984

Turns out that the fix there also fixed the placement in the menu.

Now have Training showing under FAG and the icons are showing.

Options: ReplyQuote
Re: Any change to help menu from 1.1.6 to 1.5.2 RC2?
Posted by: JamesD
Date: December 25, 2008 01:30PM

Thanks to everyone who helped. I now have Training in the MacroLibrary http://kmeleon.sourceforge.net/wiki/KmmTraining

Merry Christmas

JamesD

Options: ReplyQuote


K-Meleon forum is powered by Phorum.