PS: probier mal das…

der Quellordner ist ~/Scans
der Zielordner ist ~/Documents/Ablage

Die Monatsordner werden automatisch erstellt, falls nicht vorhanden

Show Plain Text
  1. set scanFolder to (path to home folder as text) & "Scans:"
  2. set ablageFolder to (path to documents folder as text) & "Ablage:"
  3.  
  4. tell application "Finder" to set theFiles to sort (get files of folder scanFolder) by creation date
  5. repeat with aFile in theFiles
  6.   tell application "Finder"
  7.     set creationDate to creation date of aFile
  8.     set fileExtension to name extension of aFile
  9.     tell creationDate to set {yr, mt, dy, tm} to {its year, its month as integer, its day, its time string}
  10.   end tell
  11.   set monthString to pad(mt)
  12.   set dateString to (yr as text) & monthString & pad(dy) & (words of tm as text)
  13.   set sourceFile to quoted form of POSIX path of (aFile as text)
  14.   set destinationFolder to quoted form of (POSIX path of ablageFolder & monthString)
  15.   do shell script "/bin/mkdir -p " & destinationFolder
  16.   set destinationFile to quoted form of (POSIX path of ablageFolder & monthString & "/" & dateString & "." & fileExtension)
  17.   do shell script "mv " & sourceFile & space & destinationFile
  18. end repeat
  19.  
  20. on pad(v)
  21.   return text -2 thru -1 of ((v + 100) as text)
  22. end pad
----------
Gruss

Stefan