Page 5 of 7
Posted: 2012-08-04 10:43:18
by bad4u
Usually the BatchMode option '2' does similar, as the IMDB id is part of the URL. Still this won't work if you use URL field for local storage path or something.
You could replace
with
Code: Select all
MovieName := 'http://www.imdb.com/title/' + GetCustomField('YourCustomFieldTag') + '/';
to make the script build the IMDB URL from the IMDB ID instead of reading the URL from URL field, just change YourCustomFieldTag to what you named your customfield and set BatchMode option to '2' then. This isn't the most elegant solution, but it's easy to add whenever the script might be updated in future.
Posted: 2012-08-04 12:00:09
by KoolPal
Thanks bad4u,
I did as you suggested, but I am new to this and messed up somewhere and some title names became blank.
Will use batch mode 2 for now and learn more of scripting.
Your input would help me get there.
Thanks for a quick reply.
Programar scripts
Posted: 2013-08-31 15:50:00
by raulsara
Hola, que compilador y manual necesito para programar scripts.
Hello, wich compiler and manual i need to program scripts.
Thanks
Posted: 2013-09-01 14:00:25
by antp
There is no compiler, the scripts are executed by AMC.
As manual, you can check tutorials for Pascal or Delphi, as the language is similar. Additional functions are detailed in the Help of AMC.
Posted: 2013-09-04 20:22:42
by raulsara
OK, i will try to program some spanish scripts.
Thanks
Posted: 2013-09-05 11:28:53
by raulsara
Please i need help.
How can i display the value of field for debug a program
Whit Showmessage i can show a fixed field f.e. 'hello' but i don't know how can i display the value of variable. f.e. the name of the movie MovieName.
Is very important for me because i can debug ando follow the program.
Thanks
Posted: 2013-09-05 12:41:46
by antp
if the variable is named MovieName you can simply do ShowMessage(MovieName);
Posted: 2013-09-05 12:57:49
by raulsara
Thanks, it was very easy but did not know how.
Posted: 2013-09-05 14:24:09
by raulsara
Hello antp, to show the value of a string is correct ShowMessage but to show the value of an integer ¿?
Thanks
Posted: 2013-09-05 14:33:29
by kgytopi
raulsara wrote:Hello antp, to show the value of a string is correct ShowMessage but to show the value of an integer ¿?
Thanks
Showmessage(IntToStr(value));
Posted: 2013-09-05 18:24:35
by raulsara
Thanks again
Posted: 2013-09-14 23:49:03
by diegopau
Hi!
I am trying to edit a script so that I can get the description and comments info from FilmAffinity and set it to some custom fields I have created. I created the two custom fields with tags sinopsis_es and critica_es, and the only 2 lines that I've modified in the script are:
SetCustomField(sinopsis_es, Item);
instead of:
SetField (fieldDescription, Item)
and
SetCustomField(critica_es, Comments);
instead of:
SetField(fieldComments, Comments);
I get the error: "Script error in "FILMAFFINITY": unknown identifier: SINOPSIS_ES at line 304
But I think i am using the right procedure params:
procedure SetCustomField(fieldTag: string; value: string);
Stores a value in the specified custom field of the current movie.
What am i doing wrong?
Thanks in advance!
Posted: 2013-09-15 00:24:38
by Raoul_Volfoni
Hi,
diegopau wrote:What am i doing wrong?
The first parameter is a string. You forgot the quotes for the fieldTag =
'fieldTag
'
Code: Select all
SetCustomField('sinopsis_es', Item);
SetCustomField('critica_es', Comments);
Posted: 2013-09-15 01:07:06
by diegopau
Raoul_Volfoni wrote:Hi,
diegopau wrote:What am i doing wrong?
The first parameter is a string. You forgot the quotes for the fieldTag =
'fieldTag
'
Code: Select all
SetCustomField('sinopsis_es', Item);
SetCustomField('critica_es', Comments);
I knew it has to be something small, thanks a lot!!
question about stopping error messages
Posted: 2013-09-25 00:27:41
by rana
Hi everyone, first of all, thanks a lot for this wonderful software. I have been using it for ages and it's great.
Today I have been looking at the brilliant imdb script to fit my need; I would like a real batch mode that would ignore all the errors like read timeout, 404 page not found and such. So basically, I can leave it running overnight and not to wake up to find that it stopped with a message box after parsing 4 movies
All these errors are originated from GetPage() call; so basically I am looking for any kind of throw exception method.
Thanks again guys; I have already made some major improvement on the existing script that I am hoping to share with the community.
Posted: 2013-09-25 12:11:24
by antp
That rather depends on AMC itself than on the script.
There is nothing made in AMC to properly handle these in the scripts, I think.
Posted: 2013-09-25 21:58:25
by soulsnake
Maybe I could add a function like RaiseConnectionErrors(raise: boolean) to raise or not connection errors from GetPage, PostPage, GetPicture, ...
Soulsnake.
Posted: 2013-09-26 10:04:57
by antp
Indeed, it could be useful for batch-processing.
The only thing to check is that the function return then an empty content and not random things or the previous data (for example).
Making one more version of the functions would be a little too much I guess, there are already many.
Posted: 2015-01-16 10:24:23
by MarcelloCuoghi
Hi,
How can I add a sound like the system "beep" on a script??
Posted: 2015-01-18 20:35:04
by antp
I don't think the script engine has a function for that