FindReplace
FindReplace
I just installed AMC 3.5.0.2 and can't find the the script FindReplace. I'm not sure if that is the corect name of script. Before that I used AMC 3.5.0.1 and the script was there. Maybe from a previous version, I don't remember, but is a very useful script for me.
Can you tell me where to find the script? Thx.
Can you tell me where to find the script? Thx.
It may have been deleted... strange I did not remember having deleted it, especially since version 3.5.0.1 (maybe it was when switching to version 3.5 from an older version)..
It is quite easy to make actually:
It is quite easy to make actually:
Code: Select all
program FindReplace;
const
WholeWord = False;
Search = 'old';
Replace = 'new';
Field = fieldOriginalTitle;
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.
Here is a simplified version of the script. The example is for changing the values in the field "Date Added". Be aware of date format, which must be the same used by Windows.
You can change the value of the Field with any other name available. See the AMC help for details. For me is working very well.
You can change the value of the Field with any other name available. See the AMC help for details. For me is working very well.
Code: Select all
program myReplace;
const
WholeWord = False;
Field = fieldDate;
Replace = '2006-03-26';
var
s: string;
begin
SetField(Field, Replace);
end.
I don't receive msg of error but i don't see/find the list of the duplicate. I have search in C: but nothing.
I have repeat the operation, i have click Using Shift+F6 - click on Editor tab, delete the line:
program NewScript;
begin
end.
and past the code of zuzu.
After i have save the script and i have click on F9 for execute the script but i don't see nothing..don't know
I have repeat the operation, i have click Using Shift+F6 - click on Editor tab, delete the line:
program NewScript;
begin
end.
and past the code of zuzu.
After i have save the script and i have click on F9 for execute the script but i don't see nothing..don't know
-
- Posts: 745
- Joined: 2007-04-28 05:46:43
- Location: Italy
Find the lines looking like this:
For the option that you use (1, 2 or 3) modify the line to have all info that you which, e.g.:
The names of the fields (field-something) are described in the help file (tech info -> scripts)
Code: Select all
case GetOption('TitleToUse') of
1: CurTitle := GetField(fieldOriginalTitle);
2: CurTitle := GetField(fieldTranslatedTitle);
3: CurTitle := GetField(fieldOriginalTitle) + ' | ' + GetField(fieldTranslatedTitle);
else
Code: Select all
1: CurTitle := GetField(fieldNumber) + ' ' + GetField(fieldOriginalTitle) + ' ' + GetField(fieldDate);
Yes, you can use the script "FindReplace" from the posting above. Just replace thezxao wrote:Would i be able to use this to change the drive letter/location in the url field? I used to have a bunch of movies on my "e" drive but its now my "d" drive.
Code: Select all
Search = 'old';
Replace = 'new';
Field = fieldOriginalTitle;
Code: Select all
Search = 'E:\';
Replace = 'D:\';
Field = fieldURL;
@antp: Maybe the FindReplace script (perhaps with some helpful comments) should be uploaded to update or archive server, too ?