Good morning.
I need a search and replace script, in particular I want to change the text of the field "source" to a different one without having to do it manually.
Thank you very much.
Search & Replace Script
Re: Search & Replace Script
Hi,
There is a script name "Update all fields" that provides various options for that.
Otherwise a very basic script like this will apply the same value to all selected movies:
You can find in the Help of the program the list of the field names.
If you want to do a real search/replace of the whole field (i.e. check the existing value and replace only if it matches) :
Maybe do a backup of your catalog before experimenting that
There is a script name "Update all fields" that provides various options for that.
Otherwise a very basic script like this will apply the same value to all selected movies:
Code: Select all
Program NewScript;
begin
SetField(fieldSource, 'new text');
end.
If you want to do a real search/replace of the whole field (i.e. check the existing value and replace only if it matches) :
Code: Select all
Program NewScript;
begin
if GetField(fieldSource) = 'old text' then
begin
SetField(fieldSource, 'new text');
end;
end.
Re: Search & Replace Script
Thank you very much for your quick response.
Would it be possible to change the value of a field if two conditions are met?
For example:
Current value of the "Source" field: 'HDD 5T'
New value: 'HDD 3'
Conditions:
Field "Source" = 'HDD 5T'
Field "Media label" includes word 'SAGA'
Thank you in advance.'
Would it be possible to change the value of a field if two conditions are met?
For example:
Current value of the "Source" field: 'HDD 5T'
New value: 'HDD 3'
Conditions:
Field "Source" = 'HDD 5T'
Field "Media label" includes word 'SAGA'
Thank you in advance.'
Re: Search & Replace Script
here is the conditon:
Code: Select all
if (GetField(fieldSource) = 'HDD5T') and (Pos('SAGA', GetField(fieldMedia)) > 0) then