Page 1 of 1
[req] Script to copy movie info from another database (amc)
Posted: 2005-06-26 21:00:52
by LA
please write a script, which will search a movie within another amc database (should be chosen) and then will extract info from this database to current...
or please let me know the format of amc database.
thanks
Posted: 2005-06-26 21:10:59
by antp
It is not possible to make that by script.
It could maybe be done with a .xml database rather a .amc database.
The format of the .amc files is described in the help file.
What do you want to do exactly ? If you want to merge two database you can simply use the Import window.
Posted: 2005-06-26 21:40:31
by LA
why it is not possible? if we can read files and we know the format of the file, seems that we can do it.
I want to copy info on one/two/three movie(s) from one database to another.. not to merge databases!
Posted: 2005-06-27 06:43:22
by antp
I do not think that the script engine can handle binary files, but actually I never tried. One of the problem is that you'll have to read strings from the file like if it was a simple memory area, for that you need to force the length of the string and then have a pointer to its first character. And these two things cannot be done with the script engine. But maybe it can be done in another way.
Posted: 2005-06-30 11:46:01
by LA
I have asked the same question to developers of Pascal Script. And the ff answer was received:
You can use the streams part of the classes import library to read from a file.
Do you know what does it mean?

I need just a idea, how to read binary files...
Posted: 2005-06-30 11:50:47
by antp
That does not solve the other problem, i.e. the access to string memory. Maybe that in IFPS3 more things are possible, but AMC still uses IFPS2.
Posted: 2005-07-03 13:35:31
by LA
but I have written small script, which allow to copy info from another database in xml format (the script will be sent via e-mail).
Could you please let me know how I should verify if some property exists (or doesn't exist)?
for ex., if I have the ff code:
Code: Select all
SetField(fieldSize,CurItem.GetItemNamed('Size').Value);
but this item doesn't include item named 'size'. I am getting the error. How it can be avoided?
Posted: 2005-07-03 14:26:02
by antp
if CurItem.GetItemNamed('Size') <> nil then
...
(I think)
Posted: 2005-07-03 15:20:12
by LA
yes, it works. thank a lot.
but how I should add picture into catalog, if I now the path to the picture?
Posted: 2005-07-03 15:23:11
by LA
sorry, corrected previous msg:
yes, it works. thanks a lot.
but how I should add a picture into catalog, if I know the path to the picture?
Posted: 2005-07-03 21:49:13
by antp
It is not possible to do that unfortunately.
The GetPicture function can only import picture from http URL.
I really have to add functions to manage pictures.