while 을 이용하여 미주번호를 찾아간 후, 미주번호 뒤에 점(.)을 입력하려 하는데, 무한 루프가 돌아가네요
다음 코드를 이용해 보았습니다.
function OnScriptMacro_script37()
{
HAction.GetDefault("Goto", HParameterSet.HGotoE.HSet);
with (HParameterSet.HGotoE) {
HSet.SetItem("DialogResult", 32);
SetSelectionIndex = 5;
}
while(HAction.Execute("Goto", HParameterSet.HGotoE.HSet)) {
HAction.Run("MoveRight");
SetTextFile(".", "UNICODE", "insertfile");
}
}
function OnScriptMacro_script37()
{
HAction.Run("MoveTopLevelBegin");
A=GetPosBySet();
AList = A.Item("List");
APara = A.Item("Para");
APos = A.Item("Pos");
while (true) {
HAction.GetDefault("Goto", HParameterSet.HGotoE.HSet);
with (HParameterSet.HGotoE) {
HSet.SetItem("DialogResult", 32);
SetSelectionIndex = 5;
}
HAction.Execute("Goto", HParameterSet.HGotoE.HSet);
B=GetPosBySet();
BList = B.Item("List");
BPara = B.Item("Para");
BPos = B.Item("Pos");
if(AList == BList && APara == BPara && APos == BPos) {
break;
}
HAction.Run("MoveRight");
SetTextFile(".", "UNICODE", "insertfile");
}
}
위의 두 코드 모두 정상적으로 작동하지 않습니다.
어떻게 해야 할까요?
미주번호 찾아가기.hwp (18.5 KB)