Development :  K-Meleon Forum
K-Meleon development related discussions. 
Macro Functions
Posted by: Rick Diaz
Date: August 19, 2002 08:29PM

Is there somewhere where I could find all the Macro functions?

Thanks,
Rick

Options: ReplyQuote
Re: Macro Functions
Posted by: Robert
Date: August 20, 2002 05:16PM

I know the following (065 beta):

#
$
menu=name;
open(url);
opennew(url);
openbg(url);
exec(kommando parameter);
setpref(type, pref, value);
togglepref(type, pref, values...);
getpref(type, pref, value);
id(Kommando_ID);
plugin(file, command);
statusbar(text);

Does exist more?

Options: ReplyQuote
Re: Macro Functions
Posted by: po
Date: August 21, 2002 09:27AM

also :

getclipboard()
setclipboard()

Options: ReplyQuote
Re: Macro Functions
Posted by: po
Date: August 21, 2002 09:31AM

oops... that should be

setclipboard(string)

and i think getpref() only has the first two arguments. smiling smiley

Options: ReplyQuote
Re: Macro Functions
Posted by: Robert
Date: August 21, 2002 02:49PM

> and i think getpref() only has the first two arguments. smiling smiley

Yes, of course :-)

Options: ReplyQuote
Re: Macro Functions
Posted by: Jason Foss
Date: August 21, 2002 09:53PM

This is what I get from the source. Not sure what pluginmsg and pluginmsgex does. I have used most of the others and they seem to all work. This is the latest version of the plugin of course. smiling smiley

Jason


open
opennew
openbg
setpref
getpref
togglepref
exec
id
plugin
statusbar
alert
confirm
prompt
getclipboard
setclipboard
macros
pluginmsg
pluginmsgex

Options: ReplyQuote
Re: Macro Functions
Posted by: Robert
Date: August 22, 2002 08:33PM

macros (macroname);
Executes a macro.

alert (message [,title]);
A dialog-box with an OK-button.

$temp=confirm (message [, title]);
A dialog with an OK- and Cancel-Button, returns 'OK' or 0.
But how I can use $temp? There are no commands like 'if' and 'goto'!

prompt (???)

How I can use the prompt command?

Options: ReplyQuote
Re: Macro Functions
Posted by: Jason Foss
Date: August 23, 2002 12:25AM

Actually it appears its confirm("message","title","buttons","icon") and depending on what buttons are used, it can return any of the following.

OK
YES
NO
ABORT
RETRY
IGNORE
0


prompt() actually does not do anything at this point.


Since as you mention there is no way to really use them at this point there probably isn't much point in going into detail. I guess you probably could pass this value to a command with exec(), or to a plugin with pluginmsg or pluginmsgex, but personally I am not sure what you can really accomplish this way. smiling smiley

My guess he has plans to add if..else etc in the future. (At least I hope)

Jason

Options: ReplyQuote
Re: Macro Functions
Posted by: po
Date: August 23, 2002 12:41AM

conditional statements are planned at some point, hence all the stuff that exists but isn't really useful for anything yet... don't know if it's going to make it into the next release or not, though.

Options: ReplyQuote
Re: Macro Functions
Posted by: Robert
Date: August 23, 2002 04:42PM


Since as you mention there is no way to really use them at this point there probably isn't much point in going into detail. I guess you probably could pass this value to a command with exec()...


...or with macros():

test {
$goto=confirm("Realy?", "Confirm!")
macros("test".$goto)
}

testOK {
alert("makro testok", "macro")
}

test0 {
alert("makro test0", "macro")
}

My guess he has plans to add if..else etc in the future. (At least I hope)

I hope so too.

Options: ReplyQuote
Re: Macro Functions
Posted by: po
Date: August 25, 2002 06:12AM

good news... it looks like conditional statements are shaping up for the next release, but the ability to toggle toolbar buttons (as in 'checkbox' mode) was also somewhat unceremoniously added recently, and the two in combination seem like they're going to make beautiful music together...

thanks, developer people, for making our macro dreams come true. smiling smiley

Options: ReplyQuote
Re: Macro Functions
Posted by: Robert
Date: August 25, 2002 11:30PM

Po wrote:

thanks, developer people, for making our macro dreams come true. smiling smiley

Yes.

Options: ReplyQuote
Re: Macro Functions
Posted by: Sesh
Date: August 28, 2002 12:27AM

Since we are discussing about macros functions, I have some problems with current string concatenation in macros.I posted it on another form here on kmeleon
http://kmeleon.sourceforge.net/forum/read.php?f=4&i=2410&t=2410.

Here is a short summary of what is happening.

I created a macro to do split browsing similar to the one in konqueror under kde. The following macro splits the screen and you can browse the same site side by side.

split_screen{
menu=&Split screen
$split="javascript:{var message=\"<html> <frameset cols=\\"50%,*\\"> <frame src=\\"\"+location.href+\"\\"> <frame src=\\"\"+location.href+\"\\"> </frameset></html>\";document.write(message);}";
open($split);
}

As you can see I am simulating a split browser using frames. I wanted to attach this macro to link pop up and I wanted current link selected to be shown in the split browser. So I exactly used above macro except that I used getclipboard() function to get current link. Here is how it looks

split_screen{
menu=&Split screen
id(ID_COPY_LINK_LOCATION);
$split="javascript:{var message=\"<html> <frameset cols=\\"50%,*\\"> <frame src=\\"\"+location.href+\"\\"> <frame src=\\"\"" . getclipboard() . "\"\\"> </frameset></html>\";document.write(message);}";
open($split);
}

This is supposed to open current selected link in a split browser in the right side frame. But it gives me a bunch of errors.


-Sesh .J

Options: ReplyQuote


K-Meleon forum is powered by Phorum.