[강좌] 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 함수를 사용하도록 소스를 수정하였습니다.
  이 름  암 호  보안코드  
번호작성자날짜조회제    목
602X2006-06-154342   NeXTSTEP 3.3J 공유 부탁드려도 될까요? (4)
601alpine2006-06-143770   드라이브 설치에 관한 문의 (2)
600capri912006-06-025178   [강좌] AppleScript - Transmit Keep-alive Script (1)
599김여운2006-06-015103   맥 x86 용 DVD 를 (12)
598탐린2006-05-304224   NextStep 문의 (3)
597탐험가2006-05-173608   osx문의.. 10.4.1말고도 깔 수 있나요? (2)
596서지환2006-05-173812   새로운 맥북 출시... (2)
595jimmyjimmy2006-05-054131   3.3_Boot_Disk.img로 디스크를 만들었을때 멈춤현상 관련 질문. (4)
594정우석2006-05-053934   NeXTSTEP 3.3J for SPARC and PA-RISC 시디를 구할수 있나요? (1)
593jimmyjimmy2006-04-274504   펜3 233 에서 OpenStep 을 인스톨 할수 있을런지요? (4)
592정우석2006-04-263629   Nextstep에서 Mo Media를 Format하는 방법 가르쳐주세요 (1)
591Eli2006-04-263479   파티션에 관한 질문입니다~ (3)
590서지환2006-04-143631   Solaris on the iMac
589이용우2006-04-123770   안녕하세요.. 부탁 드려도 될까요.. (2)
588capri912006-04-0848119   [소개] Parallels Workstation/Desktop 2.1 Beta 발표 (16)
[≪] [<] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [>] [≫]