> 
> In this case, I want to check if dir "%tmp%\imgs" exist or not, if 
it 
> does, then rename all files in there (no .ext) to .png, save all 
to 
> "%mydocs%\imgs" and delete the original folder. If it doesn't, 
show 
> me a message saying so.
> 
> Any help appreciated and please go easy with the explaining ;)
> 


Something like this, but since deleting is involved, be sure to test 
thoroughly.  You may want to take a look at scripting tutorial (see 
PowerPro start menu entry).

Put the following into a file in your script folder called (say) 
renameimgs.  Then use a hot key or button to run the script as
.renameimgs

//**start of script
local source = env("tmp")++?"\imgs"
local target = env("mydocs")++?"\imgs2"

if (file.isfolder(source)) do
if (not file.isfolder(target))
exec.newfolder(target)

file.allfiles(source, ;;+
?=file.copy(_file_, target++?"\"++file.name(_file_)++".png")=)

//file.delete(source) 
else
MessageBox("ok", "Cannot find source folder "++source)
endif

//**end of script
Note that I have commented out the file.delete with //. Remove // 
when you are happy that the rest of the script works OK.  You should 
test on fake files first.  You make want to even use 
file.deletenorecycle.

I could not make file.rename rename multiple files, hence use 
file.allfiles to go through them and rename one at a time.  See help 
for plugin file.


>


Reply via email to