Bugs :  K-Meleon Forum
You can talk about issues with k-meleon here. But please, for confirmed bugs, use the bug tracker to report and give feedback on bugs.  
Paradoxes Macro.
Posted by: desga2
Date: July 27, 2008 07:46AM

Hi, i don't know exactlly if this is a bug or feature.
I'm making a single Multiclip Macro code:
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- Multiclip Extension for K-Meleon -----------------------------------------------------
#
# Dependencies	: -
# Resources	: -
# Preferences	: -
#
# -------------------------------------------------------------------------------------------------

$Multiclip="";

Multiclip{
$SelectedText==""?&Multiclip_paste:$Multiclip=$SelectedText;
id("ID_EDIT_SELECT_NONE");
}

#Multiclip_copy{
#$Multiclip=$SelectedText;
#id("ID_EDIT_SELECT_NONE");
#}

Multiclip_paste{
$tempclip=getclipboard();
setclipboard($Multiclip);
id("ID_EDIT_PASTE");
setclipboard($tempclip);
}

# ----- PRIVATE

_Multiclip_SetAccels{
setaccel("CTRL M", "macros(Multiclip)");
}

$OnInit=$OnInit."_Multiclip_SetAccels;";

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

This macro works perfect in 1.1.X, but not in 1.5.
I like explain it, not works in URL bar of 1.5 version (specifically), but works in other web page text box objects.

Practical example:

1) Copy this macro in a macro file (Multiclip.kmm) in your macro folder and start K-Meleon 1.5RC.

2) Open readme.html file, for example, select some text and copy it using this new macro in Multiclip with Ctrl+M accelerator.

3) Now try to paste Multiclip content in URL bar with Ctrl+M accelerator. This not work sad smiley

4) Open about:config URL, for example, and try to paste now the Multiclip content in Filter with Ctrl+M accelerator. Here works fine smiling smiley

If you try this in 1.1.X version works in both URL bar and others web page text box objects.

K-Meleon in Spanish



Edited 2 time(s). Last edit at 07/27/2008 07:50AM by desga2.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: JamesD
Date: July 28, 2008 12:52AM

@ desga2

Yes, I see what you mean. Multiclip cannot copy from nor paste to the URL bar in KM 1.5beta2. It does work well between tabs but does not allow paste into part of preferences. I tried to cntl M into EDIT - PREFERENCES - BROWSING - WHEN OPENING NEW WINDOWS/TABS for the Load this page field and got nothing.

I do not know of the reason for this.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: desga2
Date: July 28, 2008 01:30AM

@ JamesD;
Thanks for your test.
Can you remmember our discussion about Autocopy in this thread?

I developement a multiclip macro (more evolved that this single macro code but based in it)

I think that macro variables are enough to copy all web page text (32 KB).
My main problem is that mouse accelerators not works, for example;
RButton+LButton
RButton+MButton
MButton+RButton

I have pending do some test with JavaScript events: onmouseup, onselect, ...

K-Meleon in Spanish

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: JamesD
Date: July 28, 2008 03:00AM

@ desga2

Yes, I remember that thread. Seeing your post reminded me that I needed something to copy all the parts of an address from one tab to another. I need street, city, state and postal zipcode. I did not want to go back and forth four times between the tabs. I started some work but I have a problem. I am trying to use accelerator keys from the number pad and I am not getting any action. This is the code. I press CNTL SHIFT ZERO but I do not ExtraCopy to run. I get no alert. I know that I have got to remove the underscore in 1 to 5, but 0 does not have one. Any ideas why no action for CNTL SHIFT ZERO?

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

# ---------- ExtraCopy macro for K-Meleon -----------------------------------------------------
#
# Dependencies	: -
# Resources		: -
# Preferences	: -
#
# -------------------------------------------------------------------------------------------------
$_ExtraCopyItems = 0 ;
$_ExtraCopyObj="";
$_ExtraCopyView="" ;
$_ExtraCopyLen1=0 ;
$_ExtraCopyLen2=0 ;
$_ExtraCopyLen3=0 ;
$_ExtraCopyLen4=0 ;
$_ExtraCopyLen5=0 ;

ExtraCopy{
alert("cntl shift 0 pressed" , "Action" , INFO) ;
$SelectedText==""? 0 : &_ExtraCopyLoad  ;
id("ID_EDIT_SELECT_NONE");
}

_ExtraCopyLoad{
$_ExtraCopyItems==0 ? &_ExtraCopyLoad_1 : &_ExtraCopyLoad_5 ;
}

_ExtraCopyLoad_1{
$_ExtraCopyItems=1;
$_ExtraCopyView = "[" . $_ExtraCopyItems . "] " . substr($SelectedText,1,10) ;
$_ExtraCopyLen1 = length( $SelectedText );
$_ExtraCopyObj= "[" . $_ExtraCopyItems +1 . "] " . $SelectedText;
id("ID_EDIT_SELECT_NONE");
}

_ExtraCopyLoad_5{
$_ExtraCopyItems=$_ExtraCopyItems + 1 ;
$_ExtraCopyView = "[" . $_ExtraCopyItems . "] " . substr($SelectedText,1,10) . " " . $_ExtraCopyView;
$_ExtraCopyObj= "[" . $_ExtraCopyItems . "] " . $SelectedText . " " . $_ExtraCopyObj;
statusbar($_ExtraCopyView) ;
$_ExtraCopyItems == 2 ? $_ExtraCopyLen2 = length( $SelectedText ): 0;
$_ExtraCopyItems == 3 ? $_ExtraCopyLen3 = length( $SelectedText ): 0;
$_ExtraCopyItems == 4 ? $_ExtraCopyLen4 = length( $SelectedText ): 0;
$_ExtraCopyItems == 5 ? $_ExtraCopyLen5 = length( $SelectedText ): 0;
id("ID_EDIT_SELECT_NONE");
}

#ExtraCopy_paste{
#$tempclip=getclipboard();
#setclipboard($ExtraCopy);
#id("ID_EDIT_PASTE");
#setclipboard($tempclip);
#}

# ----- PRIVATE

_ExtraCopy_SetAccels{
setaccel("CTRL SHIFT VK_NUMPAD0", "macros(ExtraCopy)");
setaccel("CTRL SHIFT VK_NUMPAD1", "macros(_ExtraCopyPaste1)");
setaccel("CTRL SHIFT VK_NUMPAD2", "macros(_ExtraCopyPaste2)");
setaccel("CTRL SHIFT VK_NUMPAD3", "macros(_ExtraCopyPaste3)");
setaccel("CTRL SHIFT VK_NUMPAD4", "macros(_ExtraCopyPaste4)");
setaccel("CTRL SHIFT VK_NUMPAD5", "macros(_ExtraCopyPaste5)");
}

$OnInit=$OnInit."_ExtraCopy_SetAccels;";

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




Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: desga2
Date: July 28, 2008 05:42AM

@ JamesD;

The problem of your macro code is SHIFT key, this isn't recognized with NUMPAD keys, try with CTRL only, ALT only or CTR+ALT combination, with this work to me.
Your problem happend in 1.1.X and 1.5RC.

But i have more problems, look my Multiclip evolution macro code, this work fine in 1.1.X but errors in macro code are showed in 1.5RC:
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- Multiclip Extension for K-Meleon -----------------------------------------------------
#
# Dependencies	: -
# Resources	: -
# Preferences	: -
#
# -------------------------------------------------------------------------------------------------

$MClip0="";
$MClip1="";
$MClip2="";
$MClip3="";
$MClip4="";
$MClip5="";
$MClip6="";
$MClip7="";
$MClip8="";
$MClip9="";
$Multiclip="";

Multiclip{
$Multiclip="MClip".$ARG;
#$SelectedText==""?&Multiclip_paste:$Multiclip=$SelectedText;
$SelectedText==""?&Multiclip_paste:&$Multiclip;
#&$Multiclip;
id("ID_EDIT_SELECT_NONE");
}

#Multiclip_copy{
#$Multiclip=$SelectedText;
#id("ID_EDIT_SELECT_NONE");
#}

MClip1{
$MClip1=$SelectedText;
}
MPaste1{
setclipboard($MClip1);
}
MClip2{
$MClip2=$SelectedText;
}
MPaste2{
setclipboard($MClip2);
}
MClip3{
$MClip3=$SelectedText;
}
MPaste3{
setclipboard($MClip3);
}
MClip4{
$MClip4=$SelectedText;
}
MPaste4{
setclipboard($MClip4);
}
MClip5{
$MClip5=$SelectedText;
}
MPaste5{
setclipboard($MClip5);
}
MClip6{
$MClip6=$SelectedText;
}
MPaste6{
setclipboard($MClip6);
}
MClip7{
$MClip7=$SelectedText;
}
MPaste7{
setclipboard($MClip7);
}
MClip8{
$MClip8=$SelectedText;
}
MPaste8{
setclipboard($MClip8);
}
MClip9{
$MClip9=$SelectedText;
}
MPaste9{
setclipboard($MClip9);
}
MClip0{
$MClip0=$SelectedText;
}
MPaste0{
setclipboard($MClip0);
}

Multiclip_paste{
$tempclip=getclipboard();
#setclipboard($Multiclip);
$MCtemp="MPaste".$ARG;
&$MCtemp;
id("ID_EDIT_PASTE");
setclipboard($tempclip);
}

Multiclip_Viewer{
$MC_check=0;
$MC_value=prompt("Enter Multi Clip to view (a number key [0-9]):", "Multiclip Viewer");
$MC_value>="0"?$MC_check=($MC_check + 1):0;
$MC_value<="9"?$MC_check=($MC_check + 1):0;
$MCtemp="MViewer".$MC_value;
$MC_check=="2"?&$MCtemp:0;
}

MViewer1{
$MC_value=prompt("You can modify it, to save press OK or CANCEL to not save changes.", "Multiclip Viewer 1", $MClip1)
$MC_value==""?0:$MClip1=$MC_value;
}
MViewer2{
$MC_value=prompt("You can modify it, to save press OK or CANCEL to not save changes.", "Multiclip Viewer 2", $MClip2)
$MC_value==""?0:$MClip2=$MC_value;
}
MViewer3{
$MC_value=prompt("You can modify it, to save press OK or CANCEL to not save changes.", "Multiclip Viewer 3", $MClip3)
$MC_value==""?0:$MClip3=$MC_value;
}
MViewer4{
$MC_value=prompt("You can modify it, to save press OK or CANCEL to not save changes.", "Multiclip Viewer 4", $MClip4)
$MC_value==""?0:$MClip4=$MC_value;
}
MViewer5{
$MC_value=prompt("You can modify it, to save press OK or CANCEL to not save changes.", "Multiclip Viewer 5", $MClip5)
$MC_value==""?0:$MClip5=$MC_value;
}
MViewer6{
$MC_value=prompt("You can modify it, to save press OK or CANCEL to not save changes.", "Multiclip Viewer 6", $MClip6)
$MC_value==""?0:$MClip6=$MC_value;
}
MViewer7{
$MC_value=prompt("You can modify it, to save press OK or CANCEL to not save changes.", "Multiclip Viewer 7", $MClip7)
$MC_value==""?0:$MClip7=$MC_value;
}
MViewer8{
$MC_value=prompt("You can modify it, to save press OK or CANCEL to not save changes.", "Multiclip Viewer 8", $MClip8)
$MC_value==""?0:$MClip8=$MC_value;
}
MViewer9{
$MC_value=prompt("You can modify it, to save press OK or CANCEL to not save changes.", "Multiclip Viewer 9", $MClip9)
$MC_value==""?0:$MClip9=$MC_value;
}
MViewer0{
$MC_value=prompt("You can modify it, to save press OK or CANCEL to not save changes.", "Multiclip Viewer 0", $MClip0)
$MC_value==""?0:$MClip0=$MC_value;
}

# ----- PRIVATE

_Multiclip_BuildMenu{
# Tools menu
setmenu("Misc",macro,_("Multiclip ..."),Multiclip_Viewer);
}

_Multiclip_SetAccels{
#setaccel("CTRL M", "macros(Multiclip)");
$_i=0; while($_i!=10) &_Multiclip_SetAccelsLoop;
}

_Multiclip_SetAccelsLoop{
setaccel("ALT ".$_i,"macros(Multiclip(".$_i."))"); $_i=$_i+1;
}

$OnInit=$OnInit."_Multiclip_BuildMenu;_Multiclip_SetAccels;";

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

You can use my Multiclip to do that you liked.
Errors i have in 1.5RC are by lines of cade as this:
$MCtemp="MPaste".$ARG;
&$MCtemp;
In 1.1.X i can do callers to functions from a variable (with function name in var) with this method, but in 1.5RC i can't do it because the syntax more strict not let me. In this way we lose functionality if there isn't other way to do this in 1.5RC.

-NOTE: I use number keys intead numpad in my original code macro, but you can change it for NUMPAD keys changed this code line:
setaccel("ALT ".$_i,"macros(Multiclip(".$_i."))"); $_i=$_i+1;
by this other:
setaccel("ALT VK_NUMPAD".$_i,"macros(Multiclip(".$_i."))"); $_i=$_i+1;

K-Meleon in Spanish



Edited 3 time(s). Last edit at 07/28/2008 05:48AM by desga2.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: JamesD
Date: July 28, 2008 09:47AM

@ desga2

I will try to test multiclip tomorrow. Cannot keep my eyes open any longer tonight. This is the code I done for ExtraCopy. I don't think I am getting any errors now.


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

# ---------- ExtraCopy macro for K-Meleon -----------------------------------------------------
#
# Dependencies	: - main.kmm
# Resources		: - ExtraCopy.htm
# Preferences	: -
#
# -------------------------------------------------------------------------------------------------
ExtraCopyDelete{
$_ExtraCopyItems = 0 ;
$_ExtraCopyObj1="";
$_ExtraCopyObj2="";
$_ExtraCopyObj3="";
$_ExtraCopyObj4="";
$_ExtraCopyObj5="";
$_ExtraCopyView="" ;
statusbar($_ExtraCopyView) ;
}

ExtraCopy{
$SelectedText==""? 0 : &_ExtraCopyLoad  ;
}

_ExtraCopyLoad{
$_ExtraCopyItems==5 ? alert("Maximun items limit exceeded", "Item Count", STOP) : 0 ;
$_ExtraCopyItems==4 ? &_ExtraCopyLoad_5 : 0 ;
$_ExtraCopyItems==3 ? &_ExtraCopyLoad_4 : 0 ;
$_ExtraCopyItems==2 ? &_ExtraCopyLoad_3 : 0 ;
$_ExtraCopyItems==1 ? &_ExtraCopyLoad_2 : 0 ;
$_ExtraCopyItems==0 ? &_ExtraCopyLoad_1 : 0 ;
}

_ExtraCopyLoad_1{
$_ExtraCopyItems=$_ExtraCopyItems + 1;
$_ExtraCopyView = "  [" . $_ExtraCopyItems . "] " . substr($SelectedText,0,20) ;
$_ExtraCopyObj1= $SelectedText;
statusbar($_ExtraCopyView) ;
id("ID_EDIT_SELECT_NONE");
}

_ExtraCopyLoad_2{
$_ExtraCopyItems=$_ExtraCopyItems + 1;
$_ExtraCopyView = $_ExtraCopyView . "  [" . $_ExtraCopyItems . "] " . substr($SelectedText,0,20) ;
$_ExtraCopyObj2= $SelectedText;
statusbar($_ExtraCopyView) ;
id("ID_EDIT_SELECT_NONE");
}

_ExtraCopyLoad_3{
$_ExtraCopyItems=$_ExtraCopyItems + 1;
$_ExtraCopyView = $_ExtraCopyView . "  [" . $_ExtraCopyItems . "] " . substr($SelectedText,0,20) ;
$_ExtraCopyObj3= $SelectedText;
statusbar($_ExtraCopyView) ;
id("ID_EDIT_SELECT_NONE");
}

_ExtraCopyLoad_4{
$_ExtraCopyItems=$_ExtraCopyItems + 1;
$_ExtraCopyView = $_ExtraCopyView . "  [" . $_ExtraCopyItems . "] " . substr($SelectedText,0,20) ;
$_ExtraCopyObj4= $SelectedText;
statusbar($_ExtraCopyView) ;
id("ID_EDIT_SELECT_NONE");
}

_ExtraCopyLoad_5{
$_ExtraCopyItems=$_ExtraCopyItems + 1;
$_ExtraCopyView = $_ExtraCopyView . "  [" . $_ExtraCopyItems . "] " . substr($SelectedText,0,20) ;
$_ExtraCopyObj5= $SelectedText;
statusbar($_ExtraCopyView) ;
id("ID_EDIT_SELECT_NONE");
}

ExtraCopyPaste1{
$ExtraCopyClip=getclipboard();
setclipboard($_ExtraCopyObj1);
id("ID_EDIT_PASTE");
setclipboard($ExtraCopyClip);
}

ExtraCopyPaste2{
$ExtraCopyClip=getclipboard();
setclipboard($_ExtraCopyObj2);
id("ID_EDIT_PASTE");
setclipboard($ExtraCopyClip);
}

ExtraCopyPaste3{
$ExtraCopyClip=getclipboard();
setclipboard($_ExtraCopyObj3);
id("ID_EDIT_PASTE");
setclipboard($ExtraCopyClip);
}

ExtraCopyPaste4{
$ExtraCopyClip=getclipboard();
setclipboard($_ExtraCopyObj4);
id("ID_EDIT_PASTE");
setclipboard($ExtraCopyClip);
}

ExtraCopyPaste5{
$ExtraCopyClip=getclipboard();
setclipboard($_ExtraCopyObj5);
id("ID_EDIT_PASTE");
setclipboard($ExtraCopyClip);
}

ExtraCopyStatus{
statusbar($_ExtraCopyView) ;
}

ExtraCopyInfo{
$_ExtraCopyPath = getfolder(UserMacroFolder) . "\\ExtraCopy.htm" ;
## for KM version 1.5
$kTabs?opentab( $_ExtraCopyPath ):opennew( $_ExtraCopyPath );
##  for older version without tabs
##opennew( $_ExtraCopyPath );
}

# ----- PRIVATE

_ExtraCopy_SetAccels{
setaccel("CTRL ALT VK_NUMPAD0", "macros(ExtraCopy)");
setaccel("CTRL ALT VK_NUMPAD1", "macros(ExtraCopyPaste1)");
setaccel("CTRL ALT VK_NUMPAD2", "macros(ExtraCopyPaste2)");
setaccel("CTRL ALT VK_NUMPAD3", "macros(ExtraCopyPaste3)");
setaccel("CTRL ALT VK_NUMPAD4", "macros(ExtraCopyPaste4)");
setaccel("CTRL ALT VK_NUMPAD5", "macros(ExtraCopyPaste5)");
setaccel("CTRL ALT VK_SUBTRACT", "macros(ExtraCopyStatus)");
setaccel("ALT VK_DECIMAL", "macros(ExtraCopyDelete)");
setaccel("ALT VK_ADD", "macros(ExtraCopyInfo)");
macros(ExtraCopyDelete) ;
}

$OnInit=$OnInit."_ExtraCopy_SetAccels;";

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

This is the source for my help file called ExtraCopy.htm This file should be put in the user macro folder also.

<html>
<!-- Generated by AceHTML Freeware http://freeware.acehtml.com -->
<!-- Creation date: 7/27/2008 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<meta name="description" content="ExtraCopy keys">
<meta name="generator" content="AceHTML 5 Freeware">
</head>
<body>
<div align=\"center\"><H1> ExtraCopy Keys </H1></div>
<div align="left">
<li> CTRL ALT VK_NUMPAD0  equals Copy  </li>
<li> CTRL ALT VK_NUMPAD1  equals Paste1</li>
<li> CTRL ALT VK_NUMPAD2  equals Paste2</li>
<li> CTRL ALT VK_NUMPAD3  equals Paste3</li>
<li> CTRL ALT VK_NUMPAD4  equals Paste4</li>
<li> CTRL ALT VK_NUMPAD5  equals Paste5</li> 
<li> CTRL ALT VK_SUBTRACT equals Status</li>
<li> ALT VK_DECIMAL       equals Delete</li>
<li> ALT VK_ADD           equals Info  </li>
</div>
</body>
</html>


Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: desga2
Date: July 28, 2008 04:55PM

I tested your ExtraCopy and next line show a error message "$kTabs" undeclarated to 1.1.X versions bwecause in 1.1.X is used $kLayers:
$kTabs?opentab( $_ExtraCopyPath ):opennew( $_ExtraCopyPath );

I like some of your ideas for ExtraCopy and i want do a new macro extension mixing Multiclip and ExtraCopy. I think that we can named SuperClipCopy.
If you are agree, of course. smiling smiley

K-Meleon in Spanish



Edited 1 time(s). Last edit at 07/28/2008 04:58PM by desga2.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: JamesD
Date: July 28, 2008 06:56PM

@ desga2

Oops. Forgot to change which line is commented. I am only using 1.5 so I don't see this error about &kTabs. Look in the xtraCopyInfo{ module to find fix.

You may use anything you wish from ExtraCopy. Some of my code is based on your Multiclip. I will try Multiclip this morning as soon as I get some breakfast.

One observation from looking at both our codes. Macro language could benefit from array processing.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: JamesD
Date: July 28, 2008 08:43PM

@ desga2

I found the following in Multiclip.


Line 27 error

Multiclip{
$Multiclip="MClip".$ARG;
#$SelectedText==""?&Multiclip_paste:$Multiclip=$SelectedText;
$SelectedText==""?&Multiclip_paste:&$Multiclip; <==== error
#&$Multiclip;
id("ID_EDIT_SELECT_NONE");
}

There is no module with the name $Multiclip. Did you mean to set $Multiclip equal to $SelectedText as in line 26?

Line 102 error

Multiclip_paste{
$tempclip=getclipboard();
#setclipboard($Multiclip);
$MCtemp="MPaste".$ARG;
&$MCtemp; <===== error
id("ID_EDIT_PASTE");
setclipboard($tempclip);
}

There is no module with the name $MCtemp.

Line 113 error

Multiclip_Viewer{
$MC_check=0;
$MC_value=prompt("Enter Multi Clip to view (a number key [0-9]):", "Multiclip Viewer");
$MC_value>="0"?$MC_check=($MC_check + 1):0;
$MC_value<="9"?$MC_check=($MC_check + 1):0;
$MCtemp="MViewer".$MC_value;
$MC_check=="2"?&$MCtemp:0; <===== error
}


There is no module with the name $MCtemp.


the other errors

MViewer2{
$MC_value=prompt("You can modify it, to save press OK or CANCEL to not save changes.", "Multiclip Viewer 2", $MClip2)
$MC_value==""?0:$MClip2=$MC_value;     <====  error
}

There is no semicolon on the line preceding the line with the error.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: JamesD
Date: July 28, 2008 09:21PM

@ desga2

I am still researching the .ARG code. I have never used it before.

Quote

Multiclip{
$Multiclip="MClip".$ARG;
#$SelectedText==""?&Multiclip_paste:$Multiclip=$SelectedText;
$SelectedText==""?&Multiclip_paste:&$Multiclip;
#&$Multiclip;
id("ID_EDIT_SELECT_NONE");
}

MClip is the module you wish to call. That I can see, but where does $ARG get a value? Is $ARG supposed to have the value of $SelectedText?

If I seem to be lost here, it is because I am.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: JamesD
Date: July 29, 2008 12:41AM

I think there is a bug in KM 1.5 The following code is just like the manual yet it gives an error message that there two arguements when 1 expected.

macros(_Snippet_InnerModule, "HIGH COUNTRY" );

_Snippet_InnerModule{
$_data = $ARG ;
alert( $_data, "Arguement passed", INFO);
}

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: JamesD
Date: July 29, 2008 01:28AM

More information now since I downloaded KM 1.1.6 and set it up. I ran the same code and did not get an error, but neither did I get any information passed via the $ARG variable. My alert came up blank.

This code is virtually a copy from the MacroLanguage and kko's external site reference. I don't know if I am doing something wrong or there is a bug. It is more likely to be an error on my part.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: kko
Date: July 29, 2008 01:41AM

I guess it must be

macros(_Snippet_InnerModule("HIGH COUNTRY"));

or even

macros(_Snippet_InnerModule(HIGH COUNTRY));

At least that's how I'm using it. Might be a mistake in the documentation...

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: JamesD
Date: July 29, 2008 02:46AM

I tried both versions of the statement in 1.5beta2 and 1.1.6

The example code and the explanation text seem to contridict each other. Maybe you cannot pass an augument to a macro.
Quote

K-Meleon's keyboard accelerators, its menu system and its plugins (but not the macros plugin itself) can call a macro with an argument:

macros(myMacro,"Hello world!")

A macro called this way, can get the argument reading the $ARG variable:

myMacro{
$data=$ARG;
alert($data);
# Don't use $ARG here
}

when running 1.5beta2

Function _Snippet_InnerModule is not defined.

When using macros(_Snippet_InnerModule("HIGH COUNTRY"));

Function _Snippet_InnerModule is not defined.
) expected but found <name>.
) expected but found <name>.
; expected but found <name>.
; expected but found ).
invalid statement.

When using macros(_Snippet_InnerModule(HIGH COUNTRY));

When running KM 1.1.6

Command not found '_Snippet_InnerModule'

When using macros(_Snippet_InnerModule("HIGH COUNTRY"));

Command not found '_Snippet_InnerModule'

When using macros(_Snippet_InnerModule(HIGH COUNTRY));

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: kko
Date: July 29, 2008 03:11AM

Quote
JamesD
Maybe you cannot pass an augument to a macro.

Of course you can. I'm making heavy use of it. You just need to search the macros folder for files that contain "$arg" - they are all working.

Maybe it only works in conjunction with setmenu() and setaccel() since 1.1.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: desga2
Date: July 29, 2008 05:46AM

@ JamesD:
About $ARG is a "Special Global Variables" to pass arguments to functions.
"Argument given from caller plugin (not from caller macro)"
Look in Macro Documentation and kko's documentation.
(But i think that you read this before) smiling smiley

A simple example is always better, you must look "hotlink.kmm" code in K-Meleon "Macros" subfolder. This is my code start point. (Thanks to kko)

K-Meleon in Spanish

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: JamesD
Date: July 31, 2008 02:08AM

@desga2

I have installed KM 1.1.6 and can see that Multiclip runs there. A change was made to the macro parser for version 1.5 and that will not allow Multiclip to load. I have looked and tested, but I have no anwser for you.

Sorry that I am no help.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: desga2
Date: July 31, 2008 02:32AM

@ JamesD:
No problem, i'm finishing SuperClipCopy macro and this solved all problems, runs fine in 1.1.X and 1.5, except this:
Quote
desga2
3) Now try to paste Multiclip content in URL bar with Ctrl+M accelerator. This not work.
The paste in URL bar problem in 1.5 version from a different accelerator to standard Ctrl+V continue.

@ kko: Know you something about this URL bar problem with macro accelerators?

K-Meleon in Spanish



Edited 1 time(s). Last edit at 07/31/2008 02:32AM by desga2.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: Dorian
Date: July 31, 2008 10:13PM

Quote

&$Multiclip;

I didn't know you could do something like that, but macros($Multiclip) should work.

Argument for macros only work with accels or menus. If you really need it when calling a macro you can set yourself the $ARG variable (I know, that's really ugly)

Quote

@ kko: Know you something about this URL bar problem with macro accelerators?

Are you sure the accelerator is the problem? Ctrl + enter or ctrl + R work when the urlbar has the focus. Why not ctrl+M.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: JamesD
Date: July 31, 2008 10:46PM

@ Dorian

The macro ExtraCopy ( see earlier post this thread ) will not copy to the URL bar either. I can copy to this text entry box but not to the URL bar.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: Dorian
Date: July 31, 2008 11:07PM

Then I suppose ID_EDIT_PASTE is most likely the culprit.
You should check if other command (like ID_EDIT_COPY) are still working fine



Edited 1 time(s). Last edit at 07/31/2008 11:08PM by Dorian.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: desga2
Date: July 31, 2008 11:17PM

Hi Dorian,
Quote
Dorian
I didn't know you could do something like that, but macros($Multiclip) should work.

Yes it's, i solved this problem using macros($variable) two days ago.
With this i can to call a function contented in a variable. This is very useful in macros type Multiclip where have a lot of similar function for each clip, for example: CopyClip1, CopyClip2, CopyClipX. I can use this name functions as strings in a variable and change the function to call easily with: $variable="CopyClip".$_i
Where $_i is a counter from 0 to 9.

Quote
Dorian
Are you sure the accelerator is the problem? Ctrl + enter or ctrl + R work when the urlbar has the focus. Why not ctrl+M.
Yes it's the problem because in 1.1.X works fine but in URL of 1.5 not works, but it isn't only Ctrl+M accelerator in SuperClipCopy code i'm using Alt+[a numeric key or numpad 0-9] and not works in url bar of 1.5 version.

K-Meleon in Spanish

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: desga2
Date: July 31, 2008 11:57PM

Quote
Dorian
You should check if other command (like ID_EDIT_COPY) are still working fine.

I think that ID_EDIT_COPY in URL bar not works in any version (1.1.X and 1.5).
I tried my Multiclip macro and this not copy from the URL bar in any version, in 1.1.X can paste but not in 1.5. Others global variables as $SelectedText not works in URL bar.

K-Meleon in Spanish

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: kko
Date: August 01, 2008 12:18AM

Quote
desga2
I think that ID_EDIT_COPY in URL bar not works in any version (1.1.X and 1.5).
I tried my Multiclip macro and this not copy from the URL bar in any version, in 1.1.X can paste but not in 1.5. Others global variables as $SelectedText not works in URL bar.

Sorry, I haven't examined the macros yet, so I may be wrong. But what for do you need ID_EDIT_COPY in the URL bar? What about $URLBAR?

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: desga2
Date: August 01, 2008 05:31AM

@ kko;
OK you are rigth i not need that ID_EDIT_COPY works in URL bar because i can use $URLBAR and I may not need that $SelectedText works in URL bar, but ID_EDIT_PASTE must works in URL bar, moreover this works in 1.1.X.

K-Meleon in Spanish

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: kko
Date: August 01, 2008 02:44PM

Quote
desga2
@ kko;
OK you are rigth i not need that ID_EDIT_COPY works in URL bar because i can use $URLBAR and I may not need that $SelectedText works in URL bar, but ID_EDIT_PASTE must works in URL bar, moreover this works in 1.1.X.

What for do you need ID_EDIT_PASTE in the URL bar? What about assigning the new value to $URLBAR? tongue sticking out smiley

(If I remember correctly, $URLBAR was introduced in km 1.0 and that time I made all km 0.9 macros that were using ID_EDIT_COPY/ID_EDIT_PASTE in the URL bar use $URLBAR instead because that is easier and works without problems.)

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: desga2
Date: August 01, 2008 05:25PM

Quote
kko
What for do you need ID_EDIT_PASTE in the URL bar? What about assigning the new value to $URLBAR?

Good i can get URL bar text with $URLBAR and i can replace all $URLBAR text, changed it to "paste" text at begining ($URLBAR=$paste.$URLBAR) and at the end ($URLBAR=$URLBAR.$paste), but if i like paste in middle tongue sticking out smiley (replace part of URL bar text)

My problem is that i can do it with Ctrl+C and Ctrl+V, but not with another accelerator defined by macros. In my example macro code "Multiclip", how i can detect if the user like paste clip in text box or in a URL bar to adapt the macro code with $URLBAR?

As i posted before:
Quote

but ID_EDIT_PASTE must works in URL bar, moreover this works in 1.1.X.

I only like not lost this functionality in 1.5. (If this is possible with out a lot of work)

K-Meleon in Spanish



Edited 1 time(s). Last edit at 08/01/2008 05:27PM by desga2.

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: Dorian
Date: August 10, 2008 04:56AM

Fixed in the release

Options: ReplyQuote
Re: Paradoxes Macro.
Posted by: desga2
Date: August 10, 2008 05:55AM

A lot of thanks Dorian. smiling smiley

K-Meleon in Spanish

Options: ReplyQuote


K-Meleon forum is powered by Phorum.