EmEditor (text editor) Forum Index Questions and Answers about Macros
How to use "Object"? | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| Stefan | Posted on: 10/7/2008 1:57 am |
Home away from home ![]() ![]() Joined: 7/14/2008 From: Germany, EU Posts: 285 |
How to use "Object"? Sorry, i don't understand this
and didn't found this answer in the help or on the forum. In help i found WrapMode Property [VBScript] nMode = object.WrapMode object.WrapMode = nMode I try nMode = Object.WrapMode alert nMode But get an error ==> [Object needed: "object"] Question: how can i do this? Something like ==> SET OBJECT = CreateObject("EEMacro.dll") ??? I searched everywhere ... v8 beta4 Thanks for an hint, Stefan. |
| dreftymac | Posted on: 10/7/2008 5:34 am |
Not too shy to talk ![]() ![]() Joined: 10/1/2008 From: Posts: 39 |
Re: How to use "Object"? Greetings Stefan,
This could be documented a little better, because the "object" designation is a little vague. Please take a look at the documentation for "Config Object" In EmEditor help. This explains a little bit more to help you do what you are trying to do. There is an example in the documentation that shows how to loop through editor.Configs, you can modify that example slightly as shown below: cfgs = new Enumerator( editor.Configs ); for( ; !cfgs.atEnd(); cfgs.moveNext() ){ cfg = cfgs.item(); alert( cfg.Name ); alert( cfg.General.WrapMode ); /// <--- this uses the GeneralProp object } This is in Javascript, but there is a VB example in the documentation as well. The documentation could use some improvements, but since this is a closed-source software I don't know if users are allowed to make updates, or whether there is a wiki or something like that. If there is hopefully someone will link to it, as that would help a lot. Cheers, |
| Stefan | Posted on: 10/7/2008 6:35 am |
Home away from home ![]() ![]() Joined: 7/14/2008 From: Germany, EU Posts: 285 |
Re: How to use "Object"? THX dreftymac,
EmEditor Home - EmEditor Help - EmEditor Macro Reference > Configs Collection Configs collection provides a collection of Config objects. This part works (I don't know where this 'General' comes from now ...?) I see MsgBoxes like Bat, C' and C++,.... and ones and zeros, depending to the current state of the settings - - - But the example in the help i didn't bring to work. I try a lot of possibilities like SET cfg = CreateObject("editor.Configs") alert cfg.General.WrapMode _ - - - I want to do this with the command: Any one can enlighten us |
| dreftymac | Posted on: 10/7/2008 7:16 am |
Not too shy to talk ![]() ![]() Joined: 10/1/2008 From: Posts: 39 |
Re: How to use "Object"? In Java_script:
This is not documented very well, but if you do a little digging, you will see in EmEditor Home - EmEditor Help - History - Version 7 "The Config property was added to the Document Object. " further down you will see that Configs is attached to the Editor Object. The *General* corresponds to the *GeneralProp* Object. It appears to be a naming convention used by the developer. *FoobarProp* Object in the docs => just *Foobar* in your code The developer also uses "object" as a general convention in the documentation without always spelling out what the specific object actually is. That's fine if your goal is to get the documentation done quicker, but not so great if you're trying to learn from the docs :) |
| Yutaka | Posted on: 10/7/2008 9:06 am |
Webmaster ![]() ![]() Joined: 9/28/2006 From: Redmond Posts: 2423 |
Re: How to use "Object"? Quote:
I am sorry the document is not clear. This portion was meant to show the syntax. More examples were needed. Here is how you might want to accomplish your task:
|
| Stefan | Posted on: 10/7/2008 9:46 am |
Home away from home ![]() ![]() Joined: 7/14/2008 From: Germany, EU Posts: 285 |
Re: How to use "Object"? Thanks Yutaka, that works
I see an messagebox with an number of the current wrap setting. If i switch the wrap mode and execute the macro again i see the corresponding number to that mode. - - - With i am able to switch the mode (and how the text is wrapped) by macro. - - - Now i try to (understand this and) code this in VBS. THX |
| Stefan | Posted on: 10/8/2008 1:04 am |
Home away from home ![]() ![]() Joined: 7/14/2008 From: Germany, EU Posts: 285 |
Re: How to use "Object"? OK, with your all help i was able to code this in VBS.
Now i can automate the steps to split lines with an macro. Unfortunately the save-settings-process take seconds to do. So splitting even 10 lines only takes 2 seconds. (I also notice the settings-dialog from menu takes up to 5 sec. on different PC to appear) (tested with EmEditor Professional 8.00 beta 4) Here is my working but basic macro to split lines with pure editor commands: Attention: There is no error handling right now. Use on Test files only! Split-Wrap-Reformat.vbee |
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |






