10-20-2014, 06:01 AM
Try this
Replace "filePath" to match your folder path
Macro Kingdoms
Replace "filePath" to match your folder path
Macro Kingdoms
Dir d
ARRAY(str) aDir aPic
str tempDir tempPic filePath="$my pictures$\Kingdoms\"
foreach(d _s.from(filePath "*") FE_Dir 2)
,str path=d.FileName
,if(find(path ".jpg" 0 1)>-1) aPic[]=path
,else aDir[]=path
for int'i 0 aDir.len
,tempDir=aDir[i]
,tempDir.findreplace(" " "" 8)
,for int'j 0 aPic.len
,,tempPic=aPic[j].getfilename
,,tempPic.findreplace(" " "" 8)
,,if (StrCompare(tempPic tempDir 1)=0)
,,,str onePic.from(filePath aPic[j] ".jpg")
,,,str oneDir.from(filePath aDir[i])
,,,ren- onePic oneDir