1
minamike 2021-10-21 15:18:53 +08:00
http://hints.macworld.com/article.php?story=20090501221803809
这个 applescript 可以 ``` tell application "Finder" set mifold to choose folder set filelist to every file of mifold as list set foldlist to every folder of mifold as list repeat with i from 1 to number of items in filelist set subj to item i of filelist as alias set epoch to (do shell script "stat -f \"%B\" " & (quoted form of (POSIX path of subj))) set caldate to do shell script ("date -r " & epoch & " \"+%Y-%m-%d\"") if not (exists folder caldate of mifold) then make new folder at mifold with properties {name:caldate} end if try (* try ignores errors from locked files *) move file subj to folder caldate of mifold end try end repeat repeat with j from 1 to number of items in foldlist set subj to item j of foldlist as alias if name of subj does not start with "200" then set epoch to (do shell script "stat -f \"%B\" " & (quoted form of (POSIX path of subj))) set caldate to do shell script ("date -r " & epoch & " \"+%Y-%m-%d\"") if not (exists folder caldate of mifold) then make new folder at mifold with properties {name:caldate} end if try (* try ignores errors from locked items *) move folder subj to folder caldate of mifold end try end if end repeat end tell ``` |
2
DonDonc 2021-10-21 15:48:06 +08:00
使用 Automator,参考:sspai. com / post / 41801
|
3
beayrdghkj OP 谢谢两位!
|