2012-11-12 1 views
0

, https://apple.stackexchange.com/questions/70585/applescript-opens-new-window-for-everything-when-run.자동화를 사용하여 새로운 트윗을 보내는 방법? 이 게시물과 관련된

선택한 텍스트를 강조 표시하고이 서비스를 실행할 수 있는지 궁금합니다. 새로운 트윗 텍스트 상자에 선택한 텍스트를 사용할 수 있습니까?

여기에 현재 코드입니다 : 당신은 자동화의 변수로 선택한 텍스트를 전달하고 텍스트 필드의 내용을 설정하는 UI 스크립팅을 사용할 수 있습니다

activate application "Tweetbot" 
tell application "System Events" 
    tell process "Tweetbot" 
     repeat until exists 
      delay 0.4 
     end repeat 
     set frontmost to true 
     delay 0.2 
     keystroke "n" using command down 
    end tell 
end tell 

http://i.stack.imgur.com/aahdK.png

http://i.stack.imgur.com/pHtkX.png

답변

1

.

on run {input, parameters} 
    activate application "Tweetbot" 
    tell application "System Events" to tell process "Tweetbot" 
     keystroke "n" using command down 
     set value of text area 1 of scroll area 1 of window 1 to (input as text) 
    end tell 
end run 

당신이 명령 이외의 보조 키가있는 바로 가기로 스크립트를 실행하는 경우, click menu item "New Tweet" of menu 1 of menu bar item "Tweet" of menu bar 1keystroke "n" using command down를 교체하려고합니다.

+0

감사합니다. 이 일을 ... – AlwynIsPat

관련 문제