AppleScript

提供: Wikinote
移動: 案内検索

サンプル

  • スリープタイマ
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