Fill at same time the same field of different movies

If you need help on how to use the program
Post Reply
al0203
Posts: 72
Joined: 2013-02-27 05:24:17

Fill at same time the same field of different movies

Post by al0203 »

Is it possible to fill the same field of different movies with same vale at ones? Like selecting all the files that you want to fill the custom file "already watched" and to change all at the same time. Some programs if you select several files and you change a value it changes that value in all the files at same time.
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

There is a script "update fields" that allows that (or you could yourself write a custom script: it is a matter of 1 or 2 lines of code)
You can find that script in Tools->Scripting
al0203
Posts: 72
Joined: 2013-02-27 05:24:17

Post by al0203 »

antp wrote:There is a script "update fields" that allows that (or you could yourself write a custom script: it is a matter of 1 or 2 lines of code)
You can find that script in Tools->Scripting
Can you write me a script that put the value 1 in the custom field NQV of the movies that are checked?

Thankyou
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Code: Select all

program NewScript;
begin
  if GetField(fieldChecked) = 'True' then
  begin
    SetCustomField('NQV', '1');
  end;
end.
al0203
Posts: 72
Joined: 2013-02-27 05:24:17

Post by al0203 »

antp wrote:

Code: Select all

program NewScript;
begin
  if GetField(fieldChecked) = 'True' then
  begin
    SetCustomField('NQV', '1');
  end;
end.
Great!
al0203
Posts: 72
Joined: 2013-02-27 05:24:17

Post by al0203 »

al0203 wrote:
antp wrote:

Code: Select all

program NewScript;
begin
  if GetField(fieldChecked) = 'True' then
  begin
    SetCustomField('NQV', '1');
  end;
end.
Great!
I tried to do the same with Color Tag field, but I don´t know how the computer name this field. Which is the name of this field and where I can see the names of all the fields?
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post by soulsnake »

Hi,

You can find all the fields in help file (press F1 in AMC) and go in technical scripting section.
For color tag the field name is: fieldColorTag
You have to put a color tag between 0 (blank) and 12 (grey).

Soulsnake.
al0203
Posts: 72
Joined: 2013-02-27 05:24:17

Post by al0203 »

soulsnake wrote:Hi,

You can find all the fields in help file (press F1 in AMC) and go in technical scripting section.
For color tag the field name is: fieldColorTag
You have to put a color tag between 0 (blank) and 12 (grey).

Soulsnake.
I wrote this and it gave me error in the line found := (StrToInt(GetField('ColorTag'), 0) = 3)

Code: Select all

program SFilt;
var
  found: Boolean;
begin

found := true;
  if found then // Search on movie ColorTag
    found := (StrToInt(GetField('ColorTag'), 0) = 3)
  if found then // Check movie if found
    SetField(fieldChecked, 'True');

end.
Last edited by al0203 on 2013-05-14 07:43:39, edited 1 time in total.
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post by soulsnake »

Hi,

This is not the good syntax.

Use this code:

Code: Select all

program SFilt;
var
  found: Boolean;
begin
  found := true;
  if found then // Search on movie ColorTag
    found := (StrToInt(GetField(fieldColorTag), 0) = 3)
  if found then // Check movie if found
    SetField(fieldChecked, 'True');
end.
Soulsnake.
al0203
Posts: 72
Joined: 2013-02-27 05:24:17

Post by al0203 »

soulsnake wrote:Hi,

This is not the good syntax.

Use this code:

Code: Select all

program SFilt;
var
  found: Boolean;
begin
  found := true;
  if found then // Search on movie ColorTag
    found := (StrToInt(GetField(fieldColorTag), 0) = 3)
  if found then // Check movie if found
    SetField(fieldChecked, 'True');
end.
Soulsnake.
Thank you.
Witch is the function that return you a part of a string like it use to be in basic str(getfield(fieldName),3) to return the first 3 characters of the name or str(getfield(fieldName),3,4) for 3rd to the 6th characters.
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post by soulsnake »

You can use copy(string, pos, length) function like this:

Code: Select all

copy('a string', 1, 3) will return 'a s'.
copy('a string', 3, 6) will return 'string'.
Soulsnake.
Post Reply