2016-05-31 1 views

답변

2

최저 나는 올 수 : http://knowbrainer.com/forums/forum/messageview.cfm?catid=4&threadid=2739&discTab=true&messid=11427&parentid=11409&FTVAR_FORUMVIEWTMP=Single

Function CheckNewPara() 
    Clipboard$() 
    SendKeys "+{Left}^c", True ' copy previous character 
    Select Case Clipboard$() 
      Case "" ' if the prior character is nothing 
        CheckNewPara = "" ' add no space 
      Case Chr(13)&Chr(10), Chr(9), ")" ' if the prior character is a Lf-CR, tab or) 
        SendKeys "{Right}", True 
        CheckNewPara = "" ' add no space 
      Case "." ' if the prior character is a period 
        SendKeys "{Right}", True 
        Clipboard$() ' check for No. 
        SendKeys "+{Left 3}^c", True ' copy prior three characters 
        SendKeys "{Right}", True 
          If Clipboard$() = "No." Then 
            CheckNewPara = " " ' add one space after No. 
          Else 
            CheckNewPara = " " ' add two spaces after period 
          End If 
      Case "?", "!" 
        SendKeys "{Right}", True 
        CheckNewPara = " " ' add two spaces after other ends of sentence 
      Case Else 
        SendKeys "{Right}", True 
        CheckNewPara = " " ' add one space in the usual case 
    End Select 
    Clipboard$() 
End Function 
당신은 http://knowbrainer.com/forums/forum/messageview.cfm?FTVAR_FORUMVIEWTMP=Linear&catid=4&threadid=2739&discTab=true에서 전체 주제를 보라

모든 컨텍스트를 얻을 수 있지만, 포스트의 코드는 내가해야에 지적 너 시작 했어.

내 최신 버전의 함수는 실제로 이전의 세 문자 (있는 경우 많은 문자가있는 경우)와 다음 두 문자 (또는 그 수가 많은 경우)를 모두 보는 AutoHotKey 스크립트를 호출합니다. any가 있습니다), 문맥에 따라서 공백, 2 개 공백, 또는 아무것도 돌려주지 않습니다. 컨텍스트는 공백을 필요로하지 않는 터미널 문장 부호 (두 개의 공백이 필요함) 또는 파운드/해시 기호 또는 닫힌 괄호 또는 중괄호]]}이거나 다른 기본적으로 한 개의 공백 일 수 있습니다. 나는 또한 드래곤 명령의 결과를 입력하기 전에 그리고/또는 타이핑 한 후에 호출 할 수있다.

HTH, YMMV,