You are not logged in.
hello I have a folder with 4 files of different extensions. I want to modify the name of all files, for same name of an existing file in the folder. This is possible? thank anyway
Offline
Yes, there are several different ways for doing this. You'll need to use PascalScript rule.
Few similar problems have already been discussed on the forum, for example: Rename "buddy" files
If you'll need help creating the script, you'll have to tell more details and give few examples.
Offline
Thanks for answering. I will need your help if possible. I don’t now anything of pascal. I am creating a database separate by folders where have files with extension in jpg, dwg and .max. I intend that all files assumes same name that the file with the extension .max or one extension I chose.
Offline
Forget about the "renaming buddy files" post, I found a better solution for you!
Simply drop all of your files into ReNamer, and use the code below. It will set name of every file to the same name as the first found file matching *.max mask and located in the same folder.
P.S. I removed your posted code because there is no need for it anymore. By the way, there was a slight mistake: you were trying to rename every file to the master file, without keeping the original extension - and that's why it didn't do anything.
P.P.S. I will move this topic to the "Help and Support" section later.
const
MASTER_MASK = '*.max';
var
MasterFile: WideString;
function FindMasterFile(const Dir: WideString): WideString;
var
Files: TStringsArray;
begin
Result := '';
SetLength(Files, 0);
WideScanDirForFiles(Dir, Files,
False, False, False, MASTER_MASK);
if Length(Files) > 0 then
Result := Files[0];
end;
begin
MasterFile := FindMasterFile(WideExtractFileDir(FilePath));
if MasterFile <> '' then
if MasterFile <> FilePath then
begin
MasterFile := WideExtractBaseName(MasterFile);
FileName := MasterFile + WideExtractFileExt(FileName);
end;
end.
Offline
Hi, you are extraordinary , work in the perfection, great help, saved me hours of tedium. This program is incredible or better it is perfect, thanks a lot
Offline
Great .. Hope this will start you up on the scripting, because it can be really powerful!
Offline