Skip to content

Instantly share code, notes, and snippets.

@yosshi
Created January 26, 2010 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yosshi/286914 to your computer and use it in GitHub Desktop.
Save yosshi/286914 to your computer and use it in GitHub Desktop.
iTunes を指定時間で停止させるAppleScript
-- AppleScript
-- iTunesSleepTimer
display dialog "Stop iTunes 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 "iTunes will stop at " & time string of curDate buttons {"Stop Now"} giving up after sec
tell application "iTunes"
stop
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment