Help

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
Twink
Posts: 92
Joined: 2002-08-01 01:40:12

Help

Post by Twink »

I tried making it not ask for name if it already has a imdb url, but it still asks for name, URL ='' for some reason.

Code: Select all

var
   URL: string;
begin
  if CheckVersion(3,3,0) then
  begin

    URL := UrlEncode(GetField(fieldURL));
    if URL <> '' then
    begin
     AnalyzePage(URL);
    end else
    begin
      MovieName := GetField(fieldOriginalTitle);
      if MovieName = '' then
        MovieName := GetField(fieldTranslatedTitle);
      if Input('IMDb Import', 'Enter the title of the movie:', MovieName) then
      begin
//        AnalyzePage('http://us.imdb.com/Tsearch?title='+UrlEncode(MovieName)+'&restrict=Movies+only');
        AnalyzePage('http://us.imdb.com/Tsearch?title='+UrlEncode(MovieName));
      end;
    end;

   end else
      ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.3.0)');
end.

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

Post by antp »

You should not use URLEncode for that : it is made to replace spaces by %20 and such things.
The URL field is already a valid URL

And this thing will only work when used through Tools -> Scripting, and with Movie -> Get information -> From script, since in the second case all fields (except titles) are empty.
Post Reply