Page 1 of 2
FindReplace
Posted: 2006-03-11 08:28:56
by zuzu
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.
Posted: 2006-03-11 11:11:14
by antp
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:
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.
Posted: 2006-03-11 12:07:58
by zuzu
It's working, thank you for your fast reply.
Posted: 2006-03-25 22:40:26
by LucMa
sorry can u post the complete script?
I have use the code that u have post but don't work
Can u tell me exacltly what i must do for use it?
I click ShiftF6 and i click on the new script but don't work for me
Bye:)
Posted: 2006-03-25 23:03:28
by zuzu
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.
Code: Select all
program myReplace;
const
WholeWord = False;
Field = fieldDate;
Replace = '2006-03-26';
var
s: string;
begin
SetField(Field, Replace);
end.
Posted: 2006-03-25 23:05:00
by zuzu
... abd what error message do you receive?
Posted: 2006-03-26 09:41:30
by antp
LucMa wrote:
I click ShiftF6 and i click on the new script but don't work for me
As asked Zuzu, what error do you receive?
Using Shift+F6->new->paste is the good way to use it.
Posted: 2006-03-27 10:18:45
by LucMa
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
Posted: 2006-03-27 15:13:15
by antp
What list of duplicates ?
that script is to do a find/replace on field contents...
Posted: 2006-03-27 16:44:25
by LucMa
ops sorry
i have read "replace" and i have associated it to duplicate..my english is terrible
can u tell me what i must do for find the duplicate movie?
Thank's
Posted: 2006-03-27 19:18:55
by antp
There is a "Find Duplicates" script provided with the program.
There is nothing special to do to use it, except that you have to be sure that you either selected all movies, or that you specify that the script has to be applied to all movies.
Posted: 2006-03-27 23:27:01
by LucMa
sorry but i haven't find the script in the program. Can u tell me exactly what i must do for start it? I have selected all my movie and now?
Bye:)
Posted: 2006-03-28 08:26:17
by antp
Shift+F6 (or Tools->Scripting), then select the "Find Duplicates" script.
Posted: 2006-03-28 15:30:27
by LucMa
ok, many thank's
Posted: 2007-05-05 06:32:49
by fulvio53s03
I read this very interesting thread and I have a question about duplicate movies: how is it possible to add some other information to the output (i.e. the number of the movie, the date added etc) ?
Please, I'm not an expert, give me an example with the exact code.
thanks.
Posted: 2007-05-05 20:00:32
by antp
Find the lines looking like this:
Code: Select all
case GetOption('TitleToUse') of
1: CurTitle := GetField(fieldOriginalTitle);
2: CurTitle := GetField(fieldTranslatedTitle);
3: CurTitle := GetField(fieldOriginalTitle) + ' | ' + GetField(fieldTranslatedTitle);
else
For the option that you use (1, 2 or 3) modify the line to have all info that you which, e.g.:
Code: Select all
1: CurTitle := GetField(fieldNumber) + ' ' + GetField(fieldOriginalTitle) + ' ' + GetField(fieldDate);
The names of the fields (field-something) are described in the help file (tech info -> scripts)
Posted: 2007-05-05 20:38:07
by fulvio53s03
Thanks, It's clear!
Posted: 2007-10-04 21:01:46
by zxao
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.
It would take me forever to go through and change the url for so many files.
Posted: 2007-10-04 21:33:08
by bad4u
zxao 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.
Yes, you can use the script "FindReplace" from the posting above. Just replace the
Code: Select all
Search = 'old';
Replace = 'new';
Field = fieldOriginalTitle;
with
Code: Select all
Search = 'E:\';
Replace = 'D:\';
Field = fieldURL;
The drive letters are case sensitive, so take care if you have small or capital letters on your list (E:\ or e:\).
@antp: Maybe the FindReplace script (perhaps with some helpful comments) should be uploaded to update or archive server, too ?
Posted: 2007-10-04 21:40:23
by zxao
HEY! that makes sense. Thanks man! i actually just did a replace with the xml in notepad. (which i'm feeling very proud of at the moment) but thank you so much man I will be using your method from now on!