Get Title from Youtube Video

This Process prompts the user to enter a URL of a YouTube video and displays the title of the Video.

Note that the following Web Automation actions require the installation of the “Softomotive Automation” extension into Chrome.

import ".\Desktop\BrowserMaskFile.appmask"

Display.InputDialog Title:'Example' \
                    Message:'Please, enter the YouTube Url' \
                    DefaultValue:'' \
                    InputType:Display.InputType.SingleLine \
                    IsTopMost:False \
                    UserInput=> YouTubeUrl \
                    ButtonPressed=> ButtonPressed

if ButtonPressed='OK' then
    WebAutomation.LaunchChrome Url:YouTubeUrl  \
                        WindowState:WebAutomation.BrowserWindowState.Normal \
                        ClearCache:False \
                        ClearCookies:False \
                        CustomUserAgentString:'' \
                        BrowserInstance=> Chrome

    WebAutomation.DataExtraction.GetDetailsOfElement    BrowserInstance: Chrome \
                                                        Control:BrowserMaskFile.YouTube.Title \
                                                        AttributeName:'Title'  \
                                                        AttributeValue=> Title

    Display.ShowMessage Title:'The title of the Youtube video is: ' \
                        Message:Title \
                        Icon:Display.Icon.None \
                        Buttons:Display.Buttons.OK \
                        DefaultButton:Display.DefaultButton.Button1 \
                        IsTopMost:False \
                        ButtonPressed=> ButtonPressed
else
    exit
end