Page 1 of 1

Help

Posted: 2002-08-08 05:44:52
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.


Posted: 2002-08-08 10:29:50
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.