--- In [email protected], [EMAIL PROTECTED] wrote:
> > There could be at least two way:
> > (I haven't tested these, so you should test them first)
> >
> > 1) Using AllFiles
> > ; all in 1-line below
> > File.AllFiles(?"c:\music\*.wma",?'regex.replace(_file_,"_.*?_"
> > ,"_","_new_")
> > ++File.Move(_file_,_new_)')
> > ;all in 1-line above
>
> Bruce put a "don't use allfiles with rename" in the .txt file so I
didn't
> try modifying those.
I supposed that it wouldn't cause a problem in this case, but I hadn't
tested it.
> > 2) Using ListFiles
>
> This was what I have gotten working:
> @rs_rename
> local onames, nnames, _lines_, i
> onames = File.ListFiles(?"c:\My Documents\My Music\Radioshark2\*.wma")
> nnames = replacechars ( onames, "_Mon_", "_" )
> nnames = replacechars ( nnames, "_Tue_", "_" )
> nnames = replacechars ( nnames, "_Wed_", "_" )
> nnames = replacechars ( nnames, "_Thu_", "_" )
> nnames = replacechars ( nnames, "_Fri_", "_" )
> _lines_ = line (onames, 0)
> for(i=1; i<=_lines_; i=i+1)
> File.Move (line(onames, i), line(nnames, i))
> endfor
> Quit
>
> Works great for the move on the first time. However if there is no
change in
> the old vs new file name, there's an error can't move file (same name).
I didn't think it would generate an error message for this...
> Is there another syntax to use so that you can do a non-forced move
iwht the
> file plugin? Something like:
> No error dialog
> MOVE(filepath1, filepath2, [0])
>
> I know that you can do something similar to the optional flag with
> Autoit...maybe that kind of flag would be useful with copy, and other
> relavent functions?
It would be great to have a flag like this for move etc. BTW, you may
try 'Exec.OnError()' in this case:
Exec.OnError("none")
...
...
Exec.OnError("display")
Sean
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12h31je22/M=362131.6882499.7825260.1510227/D=groups/S=1706030409:TM/Y=YAHOO/EXP=1124438489/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~->
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/