03-27-2013, 09:51 PM
Hi, I wrote the script below to change the names of files within a folder:
Now I would like to have a small dialog-box with two fields:
1) ENTER THE PATH: (in this particular case it would be: C:\Users\EMERSON\Desktop\test\)
2) ENTER FORMAT: (in this particular case it would be: png)
so that I don't need to open type inside the code anymore.
Thanks in advance for your help
Emerson
int i
ARRAY(str) a
GetFilesInFolder a "C:\Users\EMERSON\Desktop\test\" ""
a.sort(8)
for i 0 a.len
,str& s1=a[i]
,str s2
,s2=s1
,s2.insert(F"{i+1}_" findcr(s2 '\')+1)
,ren s1 s2
int j
for j 1 (a.len)+1
,str s3 s4 s5
,s3.expandpath("C:\Users\EMERSON\Desktop\test\")
,lpstr filename=dir(F"{s3}{j}_*" ); if(!filename) break
,s4=F"{s3}{filename}"
,s5=F"{s3}{j}.png"
,ren s4 s5
1) ENTER THE PATH: (in this particular case it would be: C:\Users\EMERSON\Desktop\test\)
2) ENTER FORMAT: (in this particular case it would be: png)
so that I don't need to open type inside the code anymore.
Thanks in advance for your help
Emerson