there's an extension called text archive which saves selected text portions in individual txt files.. the files are opened in kmeleon for reviewing but not in a text editior..you can easily open the file from their folder in your text editor of choice.
opens selected text in notepad2(included) for editing.
notepad2 is an excellent editor as it accomodates both basic simple needs and script/coding requirements. if you don't like notepad2, you can use your editor of choice fby renaming your editor exe to notepad2.exe and copying it to k-meleon\tools\archivedit\ (replace original notepad2.exe)
opens selected text in notepad2(included) for editing.
Thank you.
I've copied the content of the archive into K-Meleon installation directory, and I can see it among installed Macro Extensions. How am I expected to run it?
it's weird because it is working fine here and this isn't even line 7 in the script.. the kmeleon path is not required and even if it would have been passed from the macro and not written in the script.
try this one..written from scratch instead of modifying text archiver:
Could you please give me some directions to improve it further?
I've checked the .kmm file along with Macro Reference, but I don't understand how I could show the "Archive edit" menu item whenever I'm in a text area, no matter if there is selected text or not. If that cannot be achieved, always having the menu item shown would be enough. Moreover I'd like, once the file is modified and saved by the editor, to put the content back into the original text area and activate the foreground window.
i'll look into expanding it to add the contextmenu in other areas, however pasting back the edited text is not likely to happen.. they's no connection between the text editor and the kmeleon text field so kmeleon can't detect when you were really done editing and paste back the text for you (does the ff extension do that?)
an autoit script can monitor the text editor till its closed and paste back the text bu that means:
1- the autoit script has to copy the text continoustly while you're editing becuase it doesn't know when will you close the window (bad memory management)
2- autoit does not know where to paste the text in kmeleon, may paste in wrong fields causing problems
3- you might finish editing but decide to leave the text editor window open, autoit will not know it's time to paste back the text.
too many variables= too many potential bugs
what i think you need is a bbcode editor either implemented inside with a macro for that theres bbcode macro by desga (search the forum or macro resources) or opened externally: just download or use your bbcode editor of choice, tell us about it and we can make it open with a macro from within kmeleon. you can also try panzerpad plus extension available at the extensions page kmext.sf.net
opens selected text in notepad2(included) for editing.
notepad2 is an excellent editor as it accomodates both basic simple needs and script/coding requirements. if you don't like notepad2, you can use your editor of choice fby renaming your editor exe to notepad2.exe and copying it to k-meleon\tools\archivedit\ (replace original notepad2.exe)
It does not work with notepad++, portable Km 1.53.
well..i'm not really surprised, not all programs can work by changing their paths and renaming the exec binary.. especially when they rely on other files like libraries or configurations, probably notepad++ is one of them.
it's supposed to be for basic text editing and notepad2 does a great job for that plus it's fairly more than adequate for most script editing.
for more professional scripts editing; there's the code tester extension which shell executes the code with its corresponding program as setup on the user's system. it can even embed the code (like js or php) in an html file if the user chooses that option.
Quote disrupted
i'll look into expanding it to add the contextmenu in other areas, however pasting back the edited text is not likely to happen.. they's no connection between the text editor and the kmeleon text field so kmeleon can't detect when you were really done editing and paste back the text for you (does the ff extension do that?)
Yes. I think it loops until you save the file and close it. Since Firefox macros are Javascript, you can loop using "setTimeout", that is: without blocking (I should check source code, but I haven't Firefox here). Could a K-Meleon macro loop without blocking?
I agree that a solution based on an external applications would be tricky.
Quote disrupted
i'll look into expanding it to add the contextmenu in other areas...
Oh, no, thanks! External editing is only needed when in text areas. My only gripe was that I had to select some text for the context menu to show the macro. However, that's not important. I think that binding an accelerator to the macro would be enough.
it's alright, i just added the command in same text field but when there is no selected text, it will automatcially select the text so you don't have to select text first.
i'll have to install that extension in firefox and understand how that loop works.. grr i hate javascript
Quote disrupted
well..i'm not really surprised, not all programs can work by changing their paths and renaming the exec binary.. especially when they rely on other files like libraries or configurations, probably notepad++ is one of them.
Well, I can always copy entire portable notepad++ into .kmm. Then it will work.
Edited 2 time(s). Last edit at 09/14/2009 04:03PM by panzer.
yes that would probably work, copy notepad++ files to k-meleon\tools\archivedit folder and rename notepad++ to notepad2.. if you want to keep its name then edit in the autoitscript (archivedit.au3) change this statement:
$txteditor=(@scriptdir & "\notepad2.exe")
to
$txteditor=(@scriptdir & "\notepad++.exe")
and compile with autotit compiler
you will need atleast autoit 3.3.0
you can also keep notepad++ in it location and edit string to notepad++
$txteditor=("c:\where\notead++\isinstalled\path\notepad++.exe")
and compile script as archivedit.exe (replacing the original one)
i add ini reading/writing functions when there's need to but this was originally just to answer's sperminito's request which personally i believe for his needs; desga's bbcode macro would;ve served better or even an external bbcode editor.. i use bbcode write by 'ahk german user' from ahk forums but we try to accommodate new users as much as possible so they don't feel the need to use that other gecko browser.. notepad2 is perfect for basic txt editing and even not-so-intense scripting , it also supports syntax schemes.
as for translation locales.......... well. you have to blame desga
it all started with a very simple autoit script i wanted for restarting km then things got out of hand after that and i never thought about locales and didn't even know theycan be included externally for autoit until quite recently i thought people just edit the source and compile or just use english. now i'm testing locales using jamesd km lister method and profile backup extension which does not have a lot to translate but i don't know german or french that good and i don't know spanish at all(except for pajero) and there are so many scripts now, most don't have many things to translate but even their accompanying km macros do not support locales.. all will need to be rewritten to include the locales.. it's going to take a while but eventually it will be done.. i hope
Quote From Notepad++ website
Here's a little Notepad++ launcher which allows you to replace Notepad completely by Notepad++.
Installation Instruction:
* Backup your original Notepad.exe (we never know...).
* Copy notepad.exe which comes with this package into 4 directories (in given order) :
1. c:\windows\servicepackfiles\i386
2. c:\windows\system32\dllcache
3. c:\windows\system32
4. c:\windows
When you replace notepad.exe in c:\windows\system32 and c:\windows, a "Windows File Protection" message box appears, click Cancel. Then another message box appears, click OK.
* Modify you registry (if you use installer to install your Notepad++, you don't need to do this step): Create key \HKEY_LOCAL_MACHINE\SOFTWARE\Notepad++, then add your Notepad++ full path as the default value of this key. In my case, it's C:\Program Files\Notepad++.
Thank you very much, Disrupted, your updated plugin, which works as advertised!
My understanding is that the macro works by copying the text into clipboard, then running the editor and pasting text into it. It seems that you can't do better with what is available in K-Meleon's macro language. I've checked around the site, but it seems to me that K-Meleon's macro language lacks both a way to write non-blocking loops and a way to write files and detect modifications (maybe the latter absence is for security reasons, I've noticed that you can read a file, but not write one).
As for module configuration, my understanding is that K-Meleon targets users at ease with fiddling a bit with scripts.
actually you can do lots of things with km macro language.. it's more advanced than you think and supports injecting jscript which makes it possible to convert some of ff extensions.. the problem is, that some(or many) js in ff extensions are coded to call certain services for ff which are not available in kmeleon..the trick is, recode the js functions to work properly in kmeleon which is not an easy task for a non-js dev. i'm not good at js, that's why i prefer writing equivalents with autotit because it's a language i can code in without having to pull my hair out.
i installed your addon in firefox and actually it's not very hard but again detested javascript..the main idea is; it creates a file(similar to what i did in autoit) and then waits for that file to be saved(this i did not do) so i took the concept and implemented it using autoit without the need for the js code.. i think it works pretty much the same as in ff now.
the context menu for selected text has been removed, you can only launch directly from text field without the need to select anything and select archivedit command
the text will be copied to a text file and opened in notepad2 now renamed to kmaredit.exe, the section(field) where the text edited will be copied to will change background colour to yellow so user kmows where the edited text will go
to ensure the user doesn't close kmeleon or do anything to mess up the procedure like switching tabs (foolproof), the kmeleon window gets disabled temporarily while kmaredit.exe is running, a popup notification will show at the bottom of the screen during edit mode notfying the user that km will be enabled when kmaredit is closed.. also for windows 2k and above, the km window will be set to a slight transparency so user knows it's disabled when transparent.
edit the text and close kmaredit or save and close.. in the end kmaredit must be closed so autoit knows it's time to paste the edited text.
the drawback compared to the previous script is you can nlonger use your editor of choice and must only kmareditor.. don't rename the editor and put it in archivedit folder, only use the supplied kmareditor (notepad2)