Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7782
    betaspin
    Participant

    Two questions:

    Is it possible to record a macro that switches from one window to another, marks and copies some text, then switches back to the initial window and pastes the text (I often need to do this with columns of numbers, and it is very straightforward in emacs)? Oh, and I know that I can write the macro, but it is way slower to do so.

    Also, are there plans to re-compile the spellchecker plugins so that they could work with the 64bit version (would be useful for people like myself who write long LaTeX documents)?

    #7868
    betaspin
    Participant

    I guess that my first question was perhaps not phrased sufficiently clearly. I am much interested in a solution, so let me try to explain what I would like to do again.

    Imagine EmEditor is open with just two files, an empty one, and a second file containing the lines

    abcd
    efgh
    ijkl
    mnop

    I am in position 1 of line 1 of the first empty file and would like to record a macro that copies line by line the contents of the second file into the first one. The keystrokes I need to copy one line are as follows:

    Well, I cannot get EmEditor to record a macro that executes this sequence of keystrokes and any ideas as to how to do this would be much appreciated. I can write a macro that does all this, but I have to do this operation frequently with different chunks of data, sometimes lines and sometimes columns of numbers, and having to write a separate macro each time rather than simply record it would be a waste of time.

    Oh, and something else that I noticed very recently: When I have the “Automatic Workspace” set to any option that includes “Save and Restore”, and have two open files, if I close both files, then exit EmEditor, then start it again, both files are re-opened. I would expect EmEditor to open with a single empty file, as this was the last state in which it was before it was exited. The current behaviour appears to be inconsistent, and I wonder if this could be fixed at some moment.

    #7869
    Yutaka Emura
    Keymaster

    betaspin wrote:
    I guess that my first question was perhaps not phrased sufficiently clearly. I am much interested in a solution, so let me try to explain what I would like to do again.

    Imagine EmEditor is open with just two files, an empty one, and a second file containing the lines

    abcd
    efgh
    ijkl
    mnop

    I am in position 1 of line 1 of the first empty file and would like to record a macro that copies line by line the contents of the second file into the first one. The keystrokes I need to copy one line are as follows:

    Well, I cannot get EmEditor to record a macro that executes this sequence of keystrokes and any ideas as to how to do this would be much appreciated. I can write a macro that does all this, but I have to do this operation frequently with different chunks of data, sometimes lines and sometimes columns of numbers, and having to write a separate macro each time rather than simply record it would be a waste of time.

    Oh, and something else that I noticed very recently: When I have the “Automatic Workspace” set to any option that includes “Save and Restore”, and have two open files, if I close both files, then exit EmEditor, then start it again, both files are re-opened. I would expect EmEditor to open with a single empty file, as this was the last state in which it was before it was exited. The current behaviour appears to be inconsistent, and I wonder if this could be fixed at some moment.

    This macro copies a selection in doc1, and then paste it to doc2. I hope this will help you write more advanced macros.


    doc1 = editor.Documents.Item(1);
    doc2 = editor.Documents.Item(2);

    doc1.Activate();
    s = doc1.selection.Text;
    doc2.Activate();
    doc2.selection.Text = s;

    I cannot reproduce your workspace issue. Are you using the latest version of EmEditor Professional? If so, please write the procedure in details so I might be able to fix it. Thanks!

    #7870
    betaspin
    Participant

    Dear Yutaka,

    Many thanks for the elegant macro. However, this is not what I was after: As I had mentioned earlier on, I can write a macro that copies selected portions of text b/n files; what I was after was a way of recording such a macro. I do not want to have to write a separate macro (or modify an existing one) each time I need to grab similarly shaped pieces of text from one file and put them in some different order into a different file. All that is required is the ability to record the keystrokes that switch between different files; I cannot get these keystrokes recorded with the current version of EmEditor (9.06, 64bit).

    A more detailed description of the “Automatic workspace problem” (again using 9.06 64bit, under Windows 7 Professional 64bit). I start with Customize -> Window -> Automatic workspace set to “None”, and a single empty file “Untitled”. I then switch Customize -> Window -> Automatic workspace to “Save and Restore”, and drop two files onto the EmEditor, these get opened. Then I close both files by pressing the “x” icons on the file tabs, this leaves a single open empty file “Untitled”, after which I close EmEditor. When I re-start EmEditor, it opens up not with an empty “Untitled” file, but with one of the two files that I had dropped onto it earlier on (the one that was closed last).

    Now, if I try to open additional files in EmEditor by executing “emeditor file1”, “emeditor file2”, etc, all of these files are opened in different tabs. If I close all of these tabs and then close EmEditor and start it again, I would expect to get a single empty file “Untitled”. However, EmEditor opens all files that I had closed previously in different tabs.

    Best wishes,
    betaspin

    #7871
    Yutaka Emura
    Keymaster

    betaspin wrote:
    Dear Yutaka,

    Many thanks for the elegant macro. However, this is not what I was after: As I had mentioned earlier on, I can write a macro that copies selected portions of text b/n files; what I was after was a way of recording such a macro. I do not want to have to write a separate macro (or modify an existing one) each time I need to grab similarly shaped pieces of text from one file and put them in some different order into a different file. All that is required is the ability to record the keystrokes that switch between different files; I cannot get these keystrokes recorded with the current version of EmEditor (9.06, 64bit).

    A more detailed description of the “Automatic workspace problem” (again using 9.06 64bit, under Windows 7 Professional 64bit). I start with Customize -> Window -> Automatic workspace set to “None”, and a single empty file “Untitled”. I then switch Customize -> Window -> Automatic workspace to “Save and Restore”, and drop two files onto the EmEditor, these get opened. Then I close both files by pressing the “x” icons on the file tabs, this leaves a single open empty file “Untitled”, after which I close EmEditor. When I re-start EmEditor, it opens up not with an empty “Untitled” file, but with one of the two files that I had dropped onto it earlier on (the one that was closed last).

    Now, if I try to open additional files in EmEditor by executing “emeditor file1”, “emeditor file2”, etc, all of these files are opened in different tabs. If I close all of these tabs and then close EmEditor and start it again, I would expect to get a single empty file “Untitled”. However, EmEditor opens all files that I had closed previously in different tabs.

    Best wishes,
    betaspin

    Unfortunately, EmEditor cannot record such keystrokes involving multiple documents. EmEditor can record only simple keystrokes or commands. However, I might consider that in the future.

    OK. The difference is that I chose “Save, Restore and Keep Undo Information” in the Window tab of the Customize dialog while you chose “Save and Restore”. This is the same specification as before, but I might consider changing this behavior. Thanks for your inputs!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.