Kimbal Robinson's answer 작동하지만이 파일을 사용하는 단점이있다. 느린데 (메모리 만 사용하는 것에 비해), 나중에 파일을 삭제해야합니다 (/ tmp에두면 보통 자동으로 삭제됩니다).
대안은 클립 보드를 통해 데이터를 전송하는 것이다 :
Dim myCommand As String
myCommand = "echo hello world"
Shell ("bash", 1, "-c "" " & myCommand & " | xclip -selection clipboard"" ", true)
' setting the 4th parameter to true ensures that the Shell function will wait until '
' the command terminates before returning '
' then paste the content of the clipboard '
Dim dh As Object
dh = createUnoService("com.sun.star.frame.DispatchHelper")
dh.executeDispatch(StarDesktop.CurrentFrame, ".uno:Paste", "", 0, Array())
이것은 현재 문서의 현재 지점에서 명령어의 결과를 붙여 것이다.
명령에서 여러 줄을 입력하면 "텍스트 가져 오기"대화 상자가 나타납니다 (이를 방지하는 방법을 모르겠습니다).