You are not logged in.
Next version will include a scripting rule; I'm already working on it!
It will allow users to program their own renaming rule using Delphi/Pascal syntax and functionality Can anyone program in Delphi?
Soon enough, I will release a first Beta version of it, and I would like people to test it and try it out...
Join the forum, to get connected :yes:
Offline
Good News!!!
Here is the first test version of ReNamer with new PascalScript rule
http://www.redbrick.dcu.ie/~den4b/Proje … erBeta.zip
I'm more then certain that no bugs will be found, since I did test it a lot! But I want users to try it out, and tell me what they think?
Any suggestions/questions concerning PascalScript rule should be posted here, thanks
Offline
I'm still learning RegEx (for Exim). This seems like a powerful feature... perhaps you'll create a subforum "PascalScript respository"? That way power users can show off, non programming power users can benefit.
cheers
Offline
perhaps you'll create a subforum "PascalScript repository"?
I probably will, but it will be a bit later, once the forum fills up a bit... it's just starting off
Offline
Great new feature, saves me having to knock up one time delphi programmes
This is the kind of program I've being meaning to write for a while, but I never seem to get the time
Being able to just insert my own code is very useful
Though a list of what I can type would be handy
Can I for example access the (don't know what your using but a tstringlist might be it)
list of files to be renamed and sort them? eg FileToBeRenamed.Sort or SortByFilename(ascending)
How about accessing the folder name of the file?
(this is going to assume that path=the full foldername eg c:\document...\my pic..\party and folder =party)
So you could do something like
var i:integer;
begin
i:=i+1;
filename:= folder+' '+inttostr(i);
end
Thanks
Offline
Hi dloneranger,
Can I for example access the (don't know what your using but a tstringlist might be it)
list of files to be renamed and sort them? eg FileToBeRenamed.Sort or SortByFilename(ascending)
No, the FileName and FilePath are the only Global/Registered variables that you access from within the PascalScript rule. It is much safer this way, since it eliminates the possibility of users breaking the whole operation
There are loads of Sort options, did you not find the one you want? By which criteria do you want to sort your files?
How about accessing the folder name of the file?
You can access it via the meta tag :File_FolderName: , or you can use this code:
var
I: Integer;
Folder: string;
begin
I := I + 1;
Folder := ExtractFileDir(FilePath);
Folder := ExtractFileName(Folder);
FileName := Folder + ' ' + IntToStr(I);
end.
Offline
There are loads of Sort options, did you not find the one you want? By which criteria do you want to sort your files?
No real need, I was just curious.
How about accessing the folder name of the file?
You can access it via the meta tag :File_FolderName: , or you can use this code:var I: Integer; Folder: string; begin I := I + 1; Folder := ExtractFileDir(FilePath); Folder := ExtractFileName(Folder); FileName := Folder + ' ' + IntToStr(I); end.
Hmm, so is it possible to change the folder as well?
To do something like
extract the first word of the filename, make a new folder with that name and add that name to Filepath.
or more simply put
var Folder:string;
begin
Folder:= Filepath+'\'+copy(filename,1,6);
ForceDirectories(folder)
Filepath := Folder
end.
Offline
Just tried it and the folder doesn't get created.
No probs
You've got me interested in this pascalscript though
It could save a lot of time - a simple pascal interpretor could come in handy
Faster than loading up BDS and a lot easier to transport around
Honestly, the amount of times I wish I had Delphi installed on clients pc's :no:
Offline
Hmm, so is it possible to change the folder as well? To do something like extract the first word of the filename, make a new folder with that name and add that name to Filepath. Or more simply put:
var Folder:string; begin Folder:= Filepath+'\'+copy(filename,1,6); ForceDirectories(folder) Filepath := Folder end.
As it written in the PascalScript help:
Changes to the FileName variable will be treated as changes to the New Name of the File.
FileName - filename of the currently processing file, including extension;
FilePath - path of the currently processing file;
FilePath is provided only for information, so you can read the file contents for example. Even if you change it - changes will NOT be affect anything. The FileName variable is the only variable that will affect the new filename.
So, you can't really change the file's folder structure... But, there is one trick, you can APPEND the folder structure, i.e. if you have file FilePath = "c:\temp\file.txt", then FileName = "file.txt", and if you set FileName = "folder\file.txt", then it will be appended to the "c:\temp\", and so you'll get the file to be renamed to "c:\temp\folder\file.txt" ;D
That will do the trick:
begin
FileName := Copy(FileName,1,6) + '\' + FileName;
end.
Note: ReNamer will give you a warning, saying that the new name is invalid because it will contain '\' (forbidden character), but it will still rename (folders will be automatically created)!
Offline
Um, the PascalScript help?
Can't say I've seen that anywhere :conf:
But what you've written sorts me out ok
Thanks
Offline