Jump to content
Sign in to follow this  
sbrady

rename files

Recommended Posts

sbrady

I have a hugh need to rename files. There would be 3 specific files in a given folder to be renamed. Here is what I got to work the way I need:

; orginal name: AR123 Smith, Bob v1 - Full mix.wav

; renamed file: AR123 Smith, Bob Full Mix v1.wav

$original_name = "D:\Promos\AR123 Smith, Bob v1 - FULL MIX.jpg"

$text = StringReplace("AR123 Smith, Bob v1 - FULL MIX.jpg"," - FULL MIX","");AR123 Smith, Bob v1

$new_file_name = StringReplace("AR123 Smith, Bob v1"," v1", " FULL MIX v1.jpg") ;AR123 Smith, Bob FULL MIX v1

$new_filename_path = "D:\Promos\"

FileCopy ($original_name, $new_filename_path & $new_file_name)

; then I would delete the original file

my problem is getting started.

1. Can I select the 3 files and run a script on the selection?

2. Do I run a script that looks at the contents of every open folder, and search for files with the name FULL MIX, SOT MIX, M&E MIX and then use my code above to rename the 3 files?

I cant figure out how to make the script look into a folder and find the files that need changing.

Share this post


Link to post
Share on other sites
JohnOne

First you need to determine a generic part of a file name which identifies files which need

changing.

Only you can do that unless you post a full list of files.

Next you should turn your code above into a function, so you can pass all file names to the same function.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×