how to automate vlc player using perl script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • siva12venu
    New Member
    • Feb 2014
    • 5

    how to automate vlc player using perl script

    How to open vlc player using perl script

    Requirement::
    1. open vlc player
    2. press (CTRL + "n") //It opens network stream
    3. enter url // In network stream page u have enter any url
    4. click play button in //network stream
    5. wait for 20 seconds
    6. close the vlc player


    can anybody guide me how do it

    Advance Thanks
    Last edited by Frinavale; Mar 19 '14, 04:06 PM.
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    Steps for finding a solution:

    I don't know if that module will be able to help you with your specific project, but it's the first place I would start.

    - Miller

    Comment

    • RonB
      Recognized Expert Contributor
      • Jun 2009
      • 589

      #3
      Take a look at Win32::GuiTest. That module should let you accomplish what you want.

      However, Perl may not be the best solution in this case. You may be better off using AutoHotKey

      Comment

      • siva12venu
        New Member
        • Feb 2014
        • 5

        #4
        Hi RonB

        Thanks for u r replay,Know i am trying with autohotkey.

        Code:
        n::
        Run C:\Program Files (x86)\VideoLAN\VLC\vlc.exe
        
        Send {Ctrl} 
        Send {n} 
        return
        I am able to open vlc player.
        Can you please guide me how so send keys using autohot key script

        Advance Thanks
        Last edited by Frinavale; Mar 19 '14, 04:06 PM.

        Comment

        • siva12venu
          New Member
          • Feb 2014
          • 5

          #5
          Hi Ron,
          Code:
          p::
          Run C:\Program Files (x86)\VideoLAN\VLC\vlc.exe
          sleep 5000
          Send, {CTRLDOWN}n{CTRLUP}
          sleep 5000
          send [url]http://www.youtube.com/watch?v=voubrypx_r0[/url]
          sleep 5000
          Send {Enter}
          sleep 500000
          return
          I have tried this piece of script.But i am unable to play video url(wat i mentioned above)
          Last edited by Frinavale; Mar 19 '14, 04:06 PM. Reason: Added code tags

          Comment

          • RonB
            Recognized Expert Contributor
            • Jun 2009
            • 589

            #6
            Sorry, but I actually haven't used autohotkey yet, so I can't help with its coding.

            I suggested it because that's what others in my dept use for automating tasks such as yours. Learning it is near the top of my list of things I need to do.

            Comment

            • siva12venu
              New Member
              • Feb 2014
              • 5

              #7
              Hi Ron

              Thanks for u r replay. I will try

              Comment

              • siva12venu
                New Member
                • Feb 2014
                • 5

                #8
                Hi Ron,

                The Above mentioned script is working fine.
                Know i understand where did i mistake.

                F1:: // In previous script i mentioned it as p while script is running P key is not work (Because autohotkey script using this key p). Because of this in script i have mentioned url in that p character is not taking vlc player.That's why i change F1 instead of P
                Code:
                LOOP
                {
                Run C:\Program Files (x86)\VideoLAN\VLC\vlc.exe
                sleep 5000
                Send, {CTRLDOWN}n{CTRLUP}
                sleep 5000
                send [url]http://www.youtube.com/watch?v=voubrypx_r0[/url]
                sleep 5000
                Send {Enter}
                sleep 20000
                Send, {CTRLDOWN}q{CTRLUP}
                }
                Thanks u gave some hint automate vlc using autohotkey.I did it.

                Thanks once again...
                Last edited by Frinavale; Mar 19 '14, 04:07 PM. Reason: Added code tags

                Comment

                • Raj4perl
                  New Member
                  • Aug 2014
                  • 12

                  #9
                  Hi Siva,

                  Why do you want to run VLC in perl itself.?

                  Give a try with simple batch file.

                  1.Open VLC through cmd line and throw url as an argument
                  2.give timedelay
                  3.taskill from tray to close it

                  If you use hotkey, you may not be able to control app when it runs in the background

                  -Raj

                  Comment

                  Working...