program YouTube; // Login to YouTube website { Process events here } procedure OnDocumentComplete(URL : string); begin if IsPartOf('http://www.youtube.com/signup?next=/', URL) then begin // web page has 2 text fields that have a name of 'username' // fill password then use sendkeypress() and sendstring() to // fill username field Fill('password', GetParam('youtube_p')); SendKeyPress('SHIFT+TAB') SendString(GetParam('youtube_l')); ClickButtonValue('Log In'); NewbieScriptEnd; end; if IsPartOf('http://www.youtube.com/', URL) then begin ClickHyperLink('Log In'); end; end; { This is the main program body. } begin Navigate('http://www.youtube.com/'); end.