Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to make auto sorting macro
#1
Hello,

I was trying to make a macro to move my photos to folder according to photo file names(date), all my photos and folder formats as below:

Folder Name
January
February
March
April
etc...

Photo File Name
IMG_20170723_153937.jpg
(20170723 = 23 July 2017)
(153937= 3.39pm 37 Seconds)

I just wanted to auto sort it according to month, but have no luck..

hope anyone can teach me how to start.

Thanks.
#2
Macro Macro1018
Code:
Copy      Help
str folder="Q:\test\photos"
ARRAY(str) a
GetFilesInFolder a folder "IMG_????????_??????.jpg"
if(a.len=0) out "no files"; ret
a.sort(8) ;;out a

int i
for i 0 a.len
,str& path=a[i]
,str monthN.get(path folder.len+9 2) ;;out monthN
,str month.gett("January February March April May June July August September October November December" val(monthN)-1) ;;out month
,str monthFolder=F"{folder}\{month}"
,mkdir monthFolder
,ren path monthFolder


Forum Jump:


Users browsing this thread: 1 Guest(s)