Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #27180
    LTT
    Participant

    I’m afraid SetActivePoint(…, iSel) is not working properly yet.

    Make some selections and test with this macro:

    
    ss = "Active~ ▼ Active ▼ Top - Bottom\n\n";
    for(ii = 1; ii <= document.selection.Count; ii++){
    	xPos = document.selection.GetActivePointX(eePosLogical, ii) + 1;
    	yPos = document.selection.GetActivePointY(eePosLogical, ii) + 1;
    
    //	document.selection.SetActivePoint(eePosLogical, xPos, yPos, true, ii);
    
    	ss += xPos + "," + yPos + " ▲ " +
    		document.selection.GetActivePointX(eePosLogical, ii) + "," +
    		document.selection.GetActivePointY(eePosLogical, ii) + " ▲ " +
    		document.selection.GetTopPointX(eePosLogical, ii) + "," +
    		document.selection.GetTopPointY(eePosLogical, ii) + " - " +
    		document.selection.GetBottomPointX(eePosLogical, ii) + "," +
    		document.selection.GetBottomPointY(eePosLogical, ii) + "\n";
    }
    alert(ss);
    

    ** Error occurs if the SetActivePoint line is enabled.

    #27183
    Yutaka Emura
    Keymaster

    I will fix this issue on the next version. Thanks!

    #27194
    LTT
    Participant

    20.3.901

    Text:
    aaa bbb

    Select “aaa” and “bbb”. (2 selections.)
    Run this macro:
    xPos = document.selection.GetActivePointX(eePosLogical, 1) + 2;
    yPos = document.selection.GetActivePointY(eePosLogical, 1);
    document.selection.SetActivePoint(eePosLogical, xPos, yPos, true, 1);

    ** Error occurs (where the selections should merge).

    #27206
    Yutaka Emura
    Keymaster

    This will be fixed on v20.3.902. Thank you.

    #27349
    LTT
    Participant

    upload.ee/image/12944206/EmEditor_SetActivePoint.png

    Set 2 points (as shown in the upper image).

    Run the macro:
    for(ii = 1; ii <= document.selection.Count; ii++){
    xPos = document.selection.GetActivePointX(eePosLogical, ii) + 1;
    yPos = document.selection.GetActivePointY(eePosLogical, ii) + 1;
    document.selection.SetActivePoint(eePosLogical, xPos, yPos, true, 1);
    }

    What I expect is shown in the lower image. (This can be achieved by manually dragging the border of each point/selection.)

    ** But the result in EmEditor is not correct, and error occurs.

    #27401
    LTT
    Participant

    In case you didn’t notice the last issue.
    The new URL for the image:
    upload.ee/image/13033181/EmEditor_SetActivePoint.png

    #27404
    Yutaka Emura
    Keymaster

    Hi LTT,

    The macro should be written as this:
    (the 5th parameter of SetActivePoint() should be ii)

    for(ii = 1; ii <= document.selection.Count; ii++){
    	xPos = document.selection.GetActivePointX(eePosLogical, ii) + 1;
    	yPos = document.selection.GetActivePointY(eePosLogical, ii) + 1;
    	document.selection.SetActivePoint(eePosLogical, xPos, yPos, true, ii);
    }
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.