Skip to content

Instantly share code, notes, and snippets.

@tgck
Last active December 15, 2015 07:09
Show Gist options
  • Save tgck/5221548 to your computer and use it in GitHub Desktop.
Save tgck/5221548 to your computer and use it in GitHub Desktop.
壁紙を変更する(複数ファイルをリストで) AppleScript/MacOS X: 10.6.8/AppleScript Editor: 2.3
-- リストで与えられたファイルパスのファイルにより、順次壁紙を変更していく
--
set Basedir to "/Users/saji/Desktop/" as text
set theList to {"070613_r2d2_4.jpg", "1258216685I1Qshr.jpg", "5471d2e497139bf3398334027a8af8e2.jpg", "72467494.gif", "Unknown.jpeg", "dokusyosi.jpg", "images-1.jpeg", "images.jpeg", "walkman.jpg"}
repeat with curItem in theList
set curPath to Basedir & curItem
-- display dialog curPath
changeDesktopPicture(curPath)
delay 0.1
end repeat
-- サブルーチン:
-- デスクトップ画像を所定のファイルに変更する
on changeDesktopPicture(aFilePath)
tell application "Finder"
try
set desktop picture to POSIX file (aFilePath)
on error
"ファイルが見つかりません。" & return & return
display dialog result & aFilePath
end try
end tell
end changeDesktopPicture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment