またまたダウンロードファイルを日付ごとにフォルダを作成し自動で振り分ける
ファイルがダウンロードされるまでに作られる.partでダウンロード失敗だけではなく.downloadが移動してダウンロード失敗も発生!とりあえず条件をふやしてみましたが、.partと.jpgを同時に受け取ると失敗しました。 まぁ冷静に考えればトリガーを条件分岐してるだけなので根本的な解決になっていなかったわけですから・・・とりあえず移動させるファイルから.partと.downloadを外してみる事にしました。昨日追加したif文も削除しました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
on adding folder items to thisFolder after receiving theseItems tell application "Finder" set fileList to (every file whose name does not end with "part" and name does not end with "download") of thisFolder as list set folderList to every folder of thisFolder as list repeat with i from 1 to number of items in fileList set curItem to item i of fileList as alias set curItemPath to (do shell script "stat -f \"%B\" " & (quoted form of (POSIX path of curItem))) set todayDate to do shell script "date +%Y-%m-%d" if not (exists folder todayDate of thisFolder) then make new folder at thisFolder with properties {name:todayDate} end if try move file curItem to folder todayDate of thisFolder end try end repeat end tell end adding folder items to |
とりあえず今の所はいけてますが、またしばらく様子見です。
- 2013年10月25日金曜日
- :Naruhiko Wakai
コメントを残す