Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hello, new to Quick Macros. Move multiple files up one level
#1
Hi, I am new to Quick Macros, and if anyone could help me, I would really appreciate it. You could save me TONS of time.

I'm curious how I would go about creating a macro that would go through folders within a folder and move all the .gif files up a level.

So, to explain more clearly, I have a folder called images. Within images are folders with three letter codes, ABD, AKR, etc. In these folders are ABD08022007.tif folders (yes, the folder is named .tif), etc. I have run a batch process to convert tifs in these folders to gifs. I need the gifs to be in ABD, AKR, etc., up one level.

Help would be most appreciated.
#2
Code:
Copy      Help
;enumerate folders in "images" folder
Dir d
foreach(d "c:\somewhere\images\*" FE_Dir 0x1)
,str sPath=d.FileName(1)
,out "Folder: %s" sPath ;;display folder path in QM output
,;enumerate gif files in these folders
,str s2.from(sPath "\*.gif")
,Dir d2
,foreach(d2 s2 FE_Dir)
,,str sPath2=d2.FileName(1)
,,out sPath2 ;;display gif file path in QM output
,,;move into folder up one level
,,;ren sPath2 sPath ;;disabled for testing. Enable this line if enumeration works well
,,
,

These foreach can be inserted using the 'Enumerate Files' dialog.
#3
Thank you very much! That is very helpful.


Forum Jump:


Users browsing this thread: 1 Guest(s)