Code: Select all
program FindReplace;
const
WholeWord = False;
Search = '\\tower\\Movies\\';
Replace = 'c:\Movies\';
Field = fieldURL;
var
s: string;
begin
s := GetField(Field);
if WholeWord then
begin
if s = Search then
SetField(Field, Replace);
end
else
SetField(Field, StringReplace(s, Search, Replace));
end.
Before: c:\Movies\Die Hard.mkv
After: c:\Movies\Die Hard\Die Hard.mkv
I want to name the folder after the Original Title field and though I could use this:
Code: Select all
program FindReplace;
const
WholeWord = False;
Search = '\\tower\\Movies\\';
[b] Replace = 'c:\Movies\' + MovieName + '\";[/b]
Field = fieldURL;
var
s: string;
begin
s := GetField(Field);
if WholeWord then
begin
if s = Search then
SetField(Field, Replace);
end
else
SetField(Field, StringReplace(s, Search, Replace));
end.
I tried what I could understand from looking at other scripts but could not get it.
Thanks,
Scott