Batch script to copy one field to another

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
PropheX
Posts: 10
Joined: 2004-08-16 12:22:43

Batch script to copy one field to another

Post by PropheX »

Hi
i know nothing of scripting
so if someone could make me a little script that would copy info in one field to another, i'd be grateful

say i want the URL (full pathname is imported when i add movies) to be cut/pasted into COMMENTS

i used to use AMC like 10 years ago and now im back into the collecting game so i want to get organized

can anybody help?

i also hoping this little script will help me understand scripting so i can make my own scripts
Dedej
Posts: 161
Joined: 2007-03-25 16:30:07
Location: Toulon

Copy one field to another.

Post by Dedej »

Use script (shift + F6) "Update field", with it you can do what you want and some other things.
If you haven't the last version use update script ( find more) to have it.

:grinking: good catalog
Last edited by Dedej on 2010-08-01 11:00:55, edited 1 time in total.
antp
Site Admin
Posts: 9639
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Hi,
If you wish to learn how make basic scripts, for simple operations like that, a script to copy one field to another would look like this:

Code: Select all

program NewScript;
var
  s: string;
begin
  s := GetField(fieldUrl);
  SetField(fieldComments, s);
end.
If you want to have it added at the end of existing comments :

Code: Select all

program NewScript;
var
  s: string;
begin
  s := GetField(fieldComments); // getting existing comment
  if s <> ''
    s := s + #13#10; // inserting a line break at the end of existing comment, if any
  s := s + GetField(fieldUrl); // adding url
  SetField(fieldComments, s);
end.

The list of field names can be found in the help file.
Post Reply