Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Filename and folder partial matching and move
#7
Try this

Replace "filePath" to match your folder path

Macro Kingdoms
Code:
Copy      Help
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


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)