You are not logged in.
OK boys and gals it's time to rock and roll. Please use and abuse this code but do report any bugs. Thanks.
This script capitalizes the first letter found in a file/folder title regardless of what precedes the letter. The remainder of the title remains unchanged.
var
i: Integer;
istop: Integer;
FileNameExt: WideString;
begin
i := 1;
istop := 0;
FileNameExt := WideExtractFileExt(FileName);
FileName := WideExtractBaseName(FileName);
repeat
if IsWideCharAlpha(FileName[i]) then // Is the file name character a letter?
begin
istop := 22222;
end
else
i := i+1;
if i > Length(FileName)-1 then istop := 22222;
until (istop = 22222);
FileName := WideCopy(FileName, 1, i-1) + WideUpperCase(FileName[i]) + WideCopy(FileName, i+1, Length(FileName)-1) + FileNameExt;
end.
The second release is a Smart Title Case Capitalizer where the user can choose to force lowercase on certain classes of words e.g. prepositions. Copy the following code to a txt file, save and close file then change .txt to .rnp. Lastly place file in Presets folder.
[Rule0]
ID=Case
Config=WHAT:3;SKIPEXTENSION:1;EXTENSIONALWAYSLOWERCASE:0;FORCECASE:0;FRAGMENTSTEXT:then%2Cneither%2Cthere%2Chere%2Cnever%2Coften
Marked=1
[Rule1]
ID=Case
Config=WHAT:0;SKIPEXTENSION:1;EXTENSIONALWAYSLOWERCASE:0;FORCECASE:1;FRAGMENTSTEXT:of%2Cby%2Cto%2Cfor%2Cwith%2Cat%2Cfrom%2Cafter%2Conto%2Cover
Marked=1
[Rule2]
ID=Case
Config=WHAT:0;SKIPEXTENSION:1;EXTENSIONALWAYSLOWERCASE:0;FORCECASE:1;FRAGMENTSTEXT:that%2Cand%2Cbut%2Cor%2Cnor%2Cif%2Cthan
Marked=1
[Rule3]
ID=Case
Config=WHAT:0;SKIPEXTENSION:1;EXTENSIONALWAYSLOWERCASE:0;FORCECASE:1;FRAGMENTSTEXT:he%2Cshe%2Cit%2Cyou%2Cher%2Chim%2Cthey%2Cthem
Marked=1
[Rule4]
ID=Case
Config=WHAT:0;SKIPEXTENSION:1;EXTENSIONALWAYSLOWERCASE:0;FORCECASE:1;FRAGMENTSTEXT:the%2Can%2Ca
Marked=1
[Rule5]
ID=Case
Config=WHAT:0;SKIPEXTENSION:1;EXTENSIONALWAYSLOWERCASE:0;FORCECASE:1;FRAGMENTSTEXT:us%2Cme%2Cour%2Cwe%2Cthis
Marked=1
[Rule6]
ID=Case
Config=WHAT:0;SKIPEXTENSION:1;EXTENSIONALWAYSLOWERCASE:0;FORCECASE:1;FRAGMENTSTEXT:is%2Care%2Cbe%2Chas%2Chave%2Ctill%2Chad
Marked=1
[Rule7]
ID=Case
Config=WHAT:0;SKIPEXTENSION:1;EXTENSIONALWAYSLOWERCASE:0;FORCECASE:1;FRAGMENTSTEXT:all%2Cno%2Cnear%2Cyes
Marked=1
[Rule8]
ID=Case
Config=WHAT:0;SKIPEXTENSION:1;EXTENSIONALWAYSLOWERCASE:0;FORCECASE:1;FRAGMENTSTEXT:on%2Cin%2Cas%2Cso%2Cfar%2Ctoo%2Cup%2Cout%2Coff%2Cnot%2Cyet
Marked=1
[Rule9]
ID=Case
Config=WHAT:0;SKIPEXTENSION:1;EXTENSIONALWAYSLOWERCASE:0;FORCECASE:1;FRAGMENTSTEXT:then%2Cneither%2Cthere%2Chere%2Cnever%2Coften
Marked=1
[Rule10]
ID=PascalScript
Config=SOURCE:var%0D%0A++i%3A+Integer%3B%0D%0A++istop%3A+Integer%3B%0D%0A%0D%0Abegin%0D%0A++i+%3A%3D+1%3B%0D%0A++istop+%3A%3D+0%3B%0D%0A+++%0D%0A+repeat%0D%0A++++if+IsWideCharAlpha%28FileName%5Bi%5D%29++then++++++%2F%2F+Is+the+file+name+character+a+letter%3F%0D%0A++++++begin%0D%0A++++++%0D%0A++++++istop+%3A%3D+22222%3B%0D%0A++++++end%0D%0A%0D%0A++++++else%0D%0A++++++i+%3A%3D++i%2B1%3B+%0D%0A+++++++++%0D%0A+until+%28istop+%3D+22222%29%3B+%0D%0A%0D%0AFileName+%3A%3D+WideCopy%28FileName%2C+1%2C+i%2D1%29+%2B++WideUpperCase%28FileName%5Bi%5D%29+%2B+WideCopy%28FileName%2C+i%2B1%2C+Length%28FileName%29%2D1%29%3B%0D%0A%0D%0Aend%2E
Marked=1
Offline