[강좌] AppleScript - Transmit Keep-alive Script
이름: capri91 [수정] 2006-06-02 19:40:19
안녕하세요. 김성한입니다.

Transmit는 직관적인 인터페이스에 필요한 기능이 모두 들어있는 멋진 FTP/SFTP 프로그램이라고 생각됩니다. 그런데 keep-alive 기능은 아무리 찾아봐도 보이질 않더군요. 원격으로 접속해서 에디팅 작업을 자주 하는 편인데 매번 접속이 끊어져서 불편합니다. 그래서 applescript로 간단한 Transmit Keep-alive Script를 작성해 보았습니다.

(*
Transmit Kepp-alive Script
by capri91, 2006/06/02

To use script:
Set "RefreshTime" to "the number of seconds to refresh".
Save file as the "application bundle" file format and check the "Stay Open" option.
Add the application to the Dock and launch the application.
If you want to open the application automatically, check the "Open at Login" option.
*)

property RefreshTime : 600

on idle
    tell application "System Events"
        set isTransmitRunning to (name of processes) contains "Transmit"
    end tell
    if isTransmitRunning then
        my keep_alive()
    end if
    return RefreshTime
end idle

on keep_alive()
    set SessionMsg to ""
    tell application "Transmit"
        set SuppressAppleScriptAlerts to true
        repeat with i from 1 to (count of documents)
            tell document i
                repeat with j from 1 to (count of sessions)
                    tell session j
                        if (is connected) then
                            refresh list their stuff files
                            set SessionMsg to SessionMsg & return & "Refresh Session: " & name
                        end if
                    end tell
                end repeat
            end tell
        end repeat
    end tell
    -- my result_msg(SessionMsg)
end keep_alive

on result_msg(SessionMsg)
    set TimeMsg to "Refresh Time: " & RefreshTime & " seconds" & return
    display alert "Transmit Keep-alive Script" message TimeMsg & SessionMsg giving up after 3
end result_msg

혹시 keep-alive 기능이 Transmit에 포함되어 있는데 제가 못찾은 거라면 알려주시면 감사겠습니다.
이름: capri91[삭제] [수정] 2006-06-05 13:24:18
별 생각없이 repeat 함수를 사용했더니 종료시에 Force Quit 해야만 되더군요. idle 함수를 사용하도록 소스를 수정하였습니다.
  이 름  암 호  보안코드  
번호작성자날짜조회제    목
602박기완2006-08-054424   생명을 불어 넣다 사망했네. ^^;; (1)
601박기완2006-08-043760   넥스트 터보 컬러에 생명을 불어넣다. *^^* (1)
600신용균2006-07-234063   NeXTStep Partition 문제 (5)
599신용균2006-07-244210   로그인 문제 (2)
598신용균2006-07-223571   회원가입 문의 (2)
597X2006-06-154341   NeXTSTEP 3.3J 공유 부탁드려도 될까요? (4)
596alpine2006-06-293794   부팅disk 복구... (1)
595doccho2006-06-164477   인텔맥 + 패럴랠 => 넥스트 빌드? (5)
594capri912006-04-0848119   [소개] Parallels Workstation/Desktop 2.1 Beta 발표 (16)
593alpine2006-06-143769   드라이브 설치에 관한 문의 (2)
592capri912006-06-025177   [강좌] AppleScript - Transmit Keep-alive Script (1)
591김여운2006-06-015102   맥 x86 용 DVD 를 (12)
590탐린2006-05-304223   NextStep 문의 (3)
589탐험가2006-05-173607   osx문의.. 10.4.1말고도 깔 수 있나요? (2)
588서지환2006-05-173811   새로운 맥북 출시... (2)
[≪] [<] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [>] [≫]