Archive for the 'TeamViewer' Category

06/19 TeamViewerを起動してIDとパスワードを取得する

リモート操作アプリケーション「TeamViewer」を起動してIDとパスワードを取得するAppleScriptです。パラメータとして、相手側マシン上でTeamViewerが起動してID等を取得するのを待つ時間を秒で指定します。

tv1.jpg

リモート操作アプリケーション「TeamViewer」は、iChatでリモート操作できないようなネットワーク環境のマシンでもリモート操作できるなど、かなり「つぶし」の効くソフトです。

たいへん便利なのですが、相手側のマシン上でTeamViewerを起動し、IDとパスワードをメールや電話などで教えてもらう必要があります。この点がけっこう面倒で……それをiChat経由で本Scriptを相手マシンに送り付けてIDとパスワードを調査できれば、それを元にTeamViewerですぐにリモート接続可能になります。

iChatの文字チャット経由で本Scriptを送り付けて実行させれば、相手側マシンではTeamViewerが起動し、そのIDとパスワードをiChat経由で受信することができ、リモートメンテナンスを効率的に行えることでしょう。

スクリプト名:TeamViewerを起動してIDとパスワードを取得する
set aRec to getTeamViewerInfo(30) of me
–> {idInfo:”594 395 137″, passInfo:”9568″}

–TeamViewerを起動して、IDとパスワードを取得する
–ただし、GUI Scriptingをイネーブルにしておくことが必要
on getTeamViewerInfo(waitSeconds)
  repeat waitSeconds times
    activate application “TeamViewer”
    
tell application “System Events”
      tell process “TeamViewer”
        tell window “TeamViewer”
          set idText to value of (static text 1 of group 1)
          
set passText to value of (static text 2 of group 1)
        end tell
      end tell
    end tell
    
    
–両方取得できたらループから抜ける
    
if (idText is not equal to “”) and (passText is not equal to “”) then
      exit repeat
    end if
    
    
delay 1
  end repeat
  
  
return {idInfo:idText, passInfo:passText}
end getTeamViewerInfo

▼新規書類に ▼カーソル位置に ▼ドキュメント末尾に