Play a movie clip for a specified time using AppleScript

Source: Internet
Author: User

To share a movie in the company, in order to be able to play some movie clips simply, use AppleScript and Mplayerx's Seekto function to play the movie for the specified time period.

Tell application"Finder"Open Document File"Xxx.mkv"of folder"Movies"of folder"Vector"of folder"Users"of startup disk using application file"Mplayerx.app"of folder"Applications"of Startup disk tell application"Mplayerx"Activate pause delay1SetIsfullscreenafter tofalseTell application"System Events"            TryTell front window of the first process whose frontmost istrue)                    SetIsFullScreen toGetValue of attribute"Axfullscreen"                    SetIsfullscreenafter to not IsFullScreenSetValue of attribute"Axfullscreen"To Isfullscreenafter end Tell EndTryEnd Tell Delay1        (* Seekto 1539*) Seekto1650play end tell delay82Tell application"Mplayerx"Tell application"System Events"            TryTell front window of the first process whose frontmost istrue)                    SetIsFullScreen toGetValue of attribute"Axfullscreen"                    SetIsfullscreenafter to not IsFullScreenSetValue of attribute"Axfullscreen"To Isfullscreenafter end Tell EndTryend Tell pause delay1End Tellend Tell

Automatically play full screen after opening the movie, wait for a period of time to exit full screen and pause.

Because Mplayerx does not have a close method, you need to manually close the player after playback is complete.

Play a movie clip for a specified time using AppleScript

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.