Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Stefan

Pages: 1 2 [3] 4 5 ... 49
Scripting, Scripts and Macros / Re: 1.50: scripting first test
« on: August 03, 2011, 10:21:09 am »
Alex> id="test" - I noticed that your dialog is bigger
That was the only dialog and the only ID "test" in that script.
But today the dialog looks normal, as expected.
HE has waited for me over night with that script open, and i didn't modified the dialog,..
only the output code as your reply shows, started the script and... the buttons are at the bottom now.


- - -

Thanks for your explanation, i got it working:

- implicit

Code: Javascript
  1. // initialize the output vars, and set default values if wanted:
  2. var ID_itb="not used by user";
  3. var ID_ita="";
  5. // build up your dialog and store it in var vMyDialog:
  6. var vMyDialog = '@<dialog title="Insert text" id="test"> \
  7. <paragraph text="Enter the text to be inserted before and/or after each selected line"/><spacer/> \
  8.   <group><paragraph text="Before:" minwidth="6" align="left"/><edit id="ID_itb" minwidth="35"/></group> \
  9.   <group><paragraph text="After:" minwidth="6" align="left"/><edit id="ID_ita" minwidth="35" /></group> \
  10.   <group uniform="true" align="right|bottom"> \
  11.            <button title="&amp;OK" returnval="ok" default="true"/> \
  12.            <button title="&amp;Cancel" returnval="cancel"/> \
  13.   </group> \
  14. </dialog>@';
  16. // execute the dialog:
  17. var vErrorcode = dialog(vMyDialog);
  19. // if [OK] is clicked...
  20. if (vErrorcode==1){
  21.         // write to HEs standard output:
  22.         var vHEOutput = Application.Output();
  23.         vHEOutput.clear();
  24.         vHEOutput.writeln("HippoEDIT version: " + Application.Version);
  25.         vHEOutput.writeln("Returned error code: " + vErrorcode);
  26.         vHEOutput.writeln("Text to be inserted before: " + ID_itb);
  27.         vHEOutput.writeln("Text to be inserted after: " + ID_ita);
  28. }

Execute this script and just pressing [OK] results into:
Code: [Select]
HippoEDIT version: 1.50.721
Returned error code: 1
Text to be inserted before: not used by user
Text to be inserted after:

- explicit

Code: Javascript
  1. // build up your dialog and store it in var vMyDialog:
  2. var vMyDialog = '@<dialog title="Insert text" id="test"> \
  3. <paragraph text="Enter the text to be inserted before and/or after each selected line"/><spacer/> \
  4.   <group><paragraph text="Before:" minwidth="6" align="left"/><edit id="ID_itb" minwidth="35"/></group> \
  5.   <group><paragraph text="After:" minwidth="6" align="left"/><edit id="ID_ita" minwidth="35" /></group> \
  6.   <group uniform="true" align="right|bottom"> \
  7.            <button title="&amp;OK" returnval="ok" default="true"/> \
  8.            <button title="&amp;Cancel" returnval="cancel"/> \
  9.   </group> \
  10. </dialog>@';
  12. // create new instance of an settings storage object:
  13. var vMyOutputStorage = CreateStorage();
  14. // set default values (if wanted):
  15. vMyOutputStorage.write("ID_itb", "default value for \"before\"");
  16. //vMyOutputStorage.write("ID_ita", "default value for \"after\"");
  18. // execute the dialog and use OutputStorage to store the user input:
  19. var vErrorcode = dialog(vMyDialog, vMyOutputStorage);
  21. // if [OK] is clicked...
  22. if (vErrorcode==1){
  23.         // get the user input:
  24.         var vITB ="ID_itb");      if (vITB==""){vITB="'Before' is not used by user";}
  25.         var vITA ="ID_ita");      if (vITA==""){vITA="'After' is not used by user";}
  27.         // write to HEs standard output:
  28.         var vHEOutput = Application.Output();
  29.         vHEOutput.clear();
  30.         vHEOutput.writeln("HippoEDIT version: " + Application.Version);
  31.         vHEOutput.writeln("Returned error code: " + vErrorcode);
  32.         vHEOutput.writeln("Text to be inserted before: " + vITB);
  33.         vHEOutput.writeln("Text to be inserted after: " + vITA);
  34. }

Execute this script and just pressing [OK] results into:
Code: [Select]
HippoEDIT version: 1.50.721
Returned error code: 1
Text to be inserted before: default value for "before"
Text to be inserted after: 'After' is not used by user

Where is the thump-up smiley?  ;D

Scripting, Scripts and Macros / Re: 1.50: scripting first test
« on: August 02, 2011, 11:04:05 pm »
I downloaded HeApi.chm but I can't read it
1. Right click on the file, and click on Properties.
2. Under the General tab,
click on the Unblock button beside the message, "This file came from another computer and might blocked to help protect  this computer."
and click on OK.

Scripting, Scripts and Macros / Re: 1.50: scripting first test
« on: August 02, 2011, 10:34:46 am »
Alex>About your examples:
Alex>- you (because I know your preferences) can also use VBS for scripting
I try to use (learn) JS too.

Alex>- id property for dialog, used for persistence of size and dialog position,
I do not see any mistake i have done. What should i change?

Alex>- you can play with required fields, if they do not filled, "positive" buttons will be disabled.
Alex>- you can also mark paragraph as required, than it will have red asterisk.
Alex>- if you create a xml dialog, try to use special syntax ('@ - @'), which will enable specialized parser for it.
Yes, already seen.

Alex>Yon need to use predefined "ok" "apply" as returnvals to make it working.
"My" returnvals are "Ok" and "Cancel" as copied from your script. Only i changed the button labels (title).
What do you mean? Have i make it wrong?

Alex>- for getting results from dialog, you can use as SettingsStorage object (CreateStorage), as automatic way,
Alex> in which HE reads variables from script by id and updates them on "positive" dialog end.
How? How can i get the value of ID "itb" ?

Code: Javascript
  1. var myDialog = '@<dialog title="Insert text" id="test"> \
  2. <paragraph text="Enter the text to be inserted before and/or after each selected line"/><spacer/> \
  3.   <group><paragraph text="Before:" minwidth="6" align="left"/><edit id="itb" minwidth="35"/></group> \
  4.   <group><paragraph text="After:" minwidth="6" align="left"/><edit id="ita" minwidth="35" /></group> \
  5.   <group uniform="true" align="right|bottom"> \
  6.            <button title="&amp;Lets go" returnval="ok" default="true"/> \
  7.            <button title="&amp;No thanks" returnval="cancel"/> \
  8.   </group> \
  9. </dialog>@';
  11. // write something to standard output:
  12. var HEOutput = Application.Output();
  13. HEOutput.writeln("HippoEDIT version: " + Application.Version);
  15. // get the user input into "varMyOutputStorage " and write to output "HEOutput":
  16. var varMyOutputStorage = CreateStorage();
  17. HEOutput.writeln("My dialog returns: " + dialog(myDialog, varMyOutputStorage));

My output:
Code: Text
  1. HippoEDIT version: 1.50.721
  2. My dialog returns: 1

Scripting, Scripts and Macros / Re: 1.50: scripting first test
« on: August 01, 2011, 10:40:21 am »
My first own dialog (well just copy and paste and a little modified.

(Note: the alert() at the end of the code  is just non-working dummy code)

Scripting, Scripts and Macros / Re: 1.50: scripting first test
« on: July 31, 2011, 07:43:02 pm »
Thank you for your great work Alex!

This looks rather like an complicated syntax. I was more thinking about an simple 'one-line' syntax.
But as every time: if you do it you do it well.  Taking an closer lock the syntax seams as easy as HTML code.

I think with this HE scripting all will be possible.
I mean, other editors have scripting features too, but without an handy UI like you build for HE they are
limited to simple actions mostly and tricky to use for more feature-rich needs. We all know this simple InputBox questions,
most three or four in an row to prompt the user for his options only to script an simple text modification. With HippoEDIT
scripting GUI features the user can build very professional locking (and working) tools for his own needs without HE itself
will become an 'all-features-in-one-app-monster'.

Let's see how long it needs till THIS feature will seen in other editors too like so many in the past.

I can see the power of the programming language style syntax and have to play around to get used to it.

Here are some impressions for those who are not so familiar with scripting or don't want to download and test an alpha build,
 (but don't be afraid, since the scripts are already wrote, your part only is to execute them)

General Discussion / Re: Install syntax schemes
« on: July 25, 2011, 01:12:39 am »
How do you install downloaded syntax schemes?

Hi kAlvaro, welcome to the community.

Please let me explain more precise, even if you already know this, just in case others need more help on this topic.

How to install syntax highlighting bundles for different programming languages.

You don't have to "install" this files, just copy the *.XML files to your data\syntax folder.

First, if you not already know, go to HippoEDIT help menu and open "About HippoEDIT",
there you can see where your "Syntax"- folder is located, this folder is inside the "Settings folder".

(BTW: HippoEDIT stores configuration in different files. All paths are at default relative to HippoEDIT user directory.
Location of the HippoEDIT user data directory depends on installation type you have selected: for portable it equals to installation directory,
if installed for current user only it should be in %AppData%\HippoEDIT, or if installed for all users it should be in All Users\Application Data\HippoEDIT.)

Then point your browser to

There are two ways to use the files from the download side, depending if you
just download the XML-files one-by one, or the whole zip archive (the "bundle").

Way 1:
If you click at an 'Syntax Name' then an new page will be open
where you can right click the single files and choose "Save Target as..."
Save this files to the "Syntax" -folder inside your "Settings folder", e.g.  "....\HippoEDIT\Data\Syntax\".

Way 2:
If you chose to download the ZIP archive by clicking at the "arrow" icon
then save this archive to an folder which you will find later again.

Use the WindowsTM own build-in ZIP support (or an third party tool) to unpack this archive.
Please note that this archive may already contain the sub-folders "data\syntax".
Go inside this folders and copy the files to your "Syntax" folder inside your "Settings folder", e.g.  "....\HippoEDIT\Data\Syntax\".

No matter which way you have choosen, close and reopen HippoEDIT to see the new added syntax files under menu "View > Syntax".

HTH?  ;)

This thread will be moved to FAQ section later the week.

HippoEDIT vs Other text editors / Re: HippoEDIT vs AkelPad
« on: June 21, 2011, 10:47:46 pm »
That post says nothing.
Would you please contribute by providing a few pro and cons?
Just that what you see: what is better or not so good on AkelPad as on HippoEDIT? Or vice versa.

Add-ons, Tools, Plugins / Re: Lorem Ipsum Generator Tool
« on: June 16, 2011, 02:53:03 pm »
He, thanks for your contribution. I need such random text often too.

Some facts on the file:

Lorem Ipsum Generator
486 KB
12. Juni 2011
c) 2011 Software with Brains, LLC
License: free for anyone

Settings: not stored
Registry: not used
OS modifications: nothing detected
Screenshot: see attachment

fbce973b78015611bbb25fff370603fe * (221 KB)
711de4f8a2dae72fa72bdec2ad0526b4 *LoremIpsum.exe (486 KB)

Virus free:

Usage: just unzip and execute. Chose amount of paragraphs and copy to clipboard. Then past into HippoEDIT.

You can add this app as an tool into HE to launch it as needed. But since the output is always the same with no changes and provides no different output layouts, you can also use HippoEDITs code template (or f.ex. simply an text file to call as tool) with such content.
Or you can use an online tool as which provides more output layouts (like PSPad editor does too btw)

What is Lorem Ipsum?
Lorem Ipsum is simply dummy text like:

Lorem ipsum dolor sit amet,
Integer turpis neque, fermen
Pellentesque habitant morbi
Aenean commodo eros a nibh
Quisque ac augue auctor eros
Donec augue dolor, lobortis

Why do we use it?
Just to have some content for manipulation-tests, or to use as preview-content with web sides.


FAQ / Re: HELP: settings directly in ini-files
« on: June 16, 2011, 01:56:03 pm »

- New flag is added to settings.xml which controls commenting style. Details....

Quote from: request (slightly modified wording)
when commenting out a large block of code, blank lines are skipped over (leaving them uncommented)
Would it be possible that all lines in a block being commented out regardless of their content (blanks or not)? 

For example:
// Lorem ipsum dolor sit amet
// Lorem ipsum dolor
// Lorem ipsum dolor sit
// Lorem ipsum dolor

instead off:
// Lorem ipsum dolor sit amet
// Lorem ipsum dolor

// Lorem ipsum dolor sit
// Lorem ipsum dolor

I understood the reason, have not thought about this when implementing the feature... Skipping of lines was even more work, than not skipping :)
I can provide an XML flag, that control this, with default to old behavior. If more people will like it, default can be changed or flag will come to UI settings.

  To enable commenting of empty lines too, add into <Formatting> section (of data\settings.xml) following key:

Code: XML
  1. <Formatting>
  2.         <CommentEmptyLines>true</CommentEmptyLines>
  3. </Formatting>

Just an update to add an new screen shot how the implemented dialog could look. (see picture No. 3 in first post)

And added a few more screenshot how this is implemented with other editor:
(Hmmm: Restrictions: 5 per post, maximum total size 256KB, maximum individual size 192KB, OK, let's see)

OK, i have too many pics to add, so i have added some to the original post and some to THIS post:


AH, if doc is dirty open new tab which inherits the reuse-flag?
Nice one :thumpsup:

Alex>not clear a scenario,...,in tab which is invisible, will be silently replaced
No. The reuse-option would be only active if that special reuse-flagged tab is the active one.
My point is to use only one tab and only if this is the active one.
If an other tab is active i didn't want to use this reuse feature.
If i need this reuse feature i would go to my reuse-flagged tab or flag an another tab for reuse.
OK, for "how to build this into the gui" i can imagine the "Reuse" item is NOT greyed-out, but just set the current tab to reuse (maybe with an confirm dialog like "already tab #3 is flagged")

Once you are ready to implement such feature please provide an intern test build so we have an better impact of the work flow.


The VS style "reuse tab if not dirty,  else open new tab"
would work but is not 100% satisfying for me because i will get new tabs often then too. But it's OK.

An implementation to enable this NON-tab-wise but for each tab would be not-good for me because
most tabs i simple didn't want to be reused, so i have to always enable and disable that feature for my work.

My idea was to have an dedicated tab to use for this lock and reuse thinggy
and all other tabs works as normal (as this feature is not enabled).

If i want to read a few files without to open a lot of new tabs i would activated "my" locked tab.

Maybe at the end its all about how easy i can enable/disable this feature, then VS-style reuse tab would fit too.
Again, i didn't expect this feature right now... after 1.5 is OK too! :D

Smth like this: Please, find another tab which is marked as reused, this can not be.
It should be an exclusive switch, which removes "lock" from one tab and set it to new one...
Ah, i see where you came from. That's why i thought about some kind of flag for the tab like an little icon (which you don't provide right now, i remember. But perhaps smtg like "untitled1 (Locked)") to easily spot the locked tab.

For me, global flag, with opening of new tab, if current is modified, looks more logical and clear..
Still no time to imaging how this works, sorry, later i will, stay tuned.
(i have my opinion of course already, but i will take the change to imagine how this will work before i answer)

And BTW, i didn't expect anything of my suggestions implemented for 1.4* . Maybe 1.52. I just post what i see missing from my POV.

OTOH, if it is easy for you to implement the VS style.... would it be too much to do this .... and talk about my idea later on for 1.6?
Having both options.

give me the weekend


With screen shot: is it Total Commander? I see some function called "lock" exist, but I would like to check how it is implemented - logic.
Yes, Total Commander.
With file manager this "lock" has an other meaning:
* Lock >  prevent from closing and open new tab for "change directory" command
* Lock, allow browsing > prevent from closing

Pages: 1 2 [3] 4 5 ... 49