Page 1 of 1

Batch script to copy one field to another

Posted: 2010-07-30 03:27:35
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

Copy one field to another.

Posted: 2010-07-30 21:30:47
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

Posted: 2010-08-01 10:30:57
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.