-
AuthorPosts
-
November 7, 2009 at 2:15 pm #7796
WmMitchell
ParticipantI posted this in the regex group, which might have been a mistake. I think that it might actually be better here.
Iโm not getting consistent results with the S&R macro below. If I donโt put:
document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);a lot in the document to periodically force the cursor to the top of the document being edited, the macro doesnโt replace _all_ items, even though I have put the option eeReplaceAll in every single S&R instance. Even forcing the cursor up to the top of doesnโt make the S&R perform consistently and I have to manually invoke this script 2 or 3 times.
โโโโโโโโโโโโโโโโโโโโ
document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ? โ,โ? โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ? โ,โ? โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ! โ,โ! โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ! โ,โ! โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ: โ,โ: โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ: โ,โ: โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โDr. โ,โDr. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โMr. โ,โMr. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โMrs. โ,โMrs. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โLt. โ,โLt. โ,eeFindNext | eeReplaceAll);document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);
document.selection.Replace(โ1/4โณ,โยผโ,eeFindNext | eeReplaceAll);
document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);
document.selection.Replace(โ1/2โณ,โยฝโ,eeFindNext | eeReplaceAll);
document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);
document.selection.Replace(โ3/4โณ,โยพโ,eeFindNext | eeReplaceAll);
โโโโโโโโโโโโโโโโโโโโI saw an example of a macro in what looks like an old forum for EmEditor and subsituted eeFindNext for eeFindReplaceQuiet, but that didnโt make the macro work repeatedly until all instances found and fixed.
What can be done to ensure the macro โloopsโ through each function until done, pls?
Thanks!
November 8, 2009 at 6:29 pm #7803Yutaka Emura
KeymasterWmMitchell wrote:
I posted this in the regex group, which might have been a mistake. I think that it might actually be better here.Iโm not getting consistent results with the S&R macro below. If I donโt put:
document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);a lot in the document to periodically force the cursor to the top of the document being edited, the macro doesnโt replace _all_ items, even though I have put the option eeReplaceAll in every single S&R instance. Even forcing the cursor up to the top of doesnโt make the S&R perform consistently and I have to manually invoke this script 2 or 3 times.
โโโโโโโโโโโโโโโโโโโโ
document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ? โ,โ? โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ? โ,โ? โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ! โ,โ! โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ! โ,โ! โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ: โ,โ: โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ: โ,โ: โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โDr. โ,โDr. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โMr. โ,โMr. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โMrs. โ,โMrs. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โLt. โ,โLt. โ,eeFindNext | eeReplaceAll);document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);
document.selection.Replace(โ1/4โณ,โยผโ,eeFindNext | eeReplaceAll);
document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);
document.selection.Replace(โ1/2โณ,โยฝโ,eeFindNext | eeReplaceAll);
document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);
document.selection.Replace(โ3/4โณ,โยพโ,eeFindNext | eeReplaceAll);
โโโโโโโโโโโโโโโโโโโโI saw an example of a macro in what looks like an old forum for EmEditor and subsituted eeFindNext for eeFindReplaceQuiet, but that didnโt make the macro work repeatedly until all instances found and fixed.
What can be done to ensure the macro โloopsโ through each function until done, pls?
Thanks!
โeeFindNext | eeReplaceAllโ should be enough, and you shouldnโt use shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);.
Can you simplify your test program and a sample file, and email me at tech@emurasoft.com ? I will try to reproduce your problem, and fix it if it is a bug of EmEditor.
Thank you. -
AuthorPosts
- The forum โQuestions and Answers about Macrosโ is closed to new topics and replies.