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