AppleScript

出典: Wikinote

2009年2月7日 (土) 07:24時点における Hagio (会話 | 投稿記録) による版
(差分) ←前の版 | 最新版を表示 (差分) | 次の版→ (差分)

サンプル

  • スリープタイマ
display dialog "Sleep after input minutes:" default answer "30"
set res to result
if button returned of res is "OK" then
    set sec to (text returned of res) * 60
    set curdate to current date
    set time of curdate to (time of curdate) + sec
    display dialog "Sleep at " & time string of curdate buttons {"Cancel"} giving up after sec
    tell application "Finder"
        sleep
    end tell
end if