Play video automatically on Mac start up

iMac running MacOS 10.13.6 High Sierra

OK, I have an mp4 video file which I would like to automatically play when my iMac starts up. I’ve tried to create an Automator workflow but I haven’t been able to get one to work. The video uses QuickTime Player.

Anyway to do this with either QuickTime Player or VLC?

If you have auto-login enabled or you are OK with the video playing after you log in, the simplest way to get this done is to just add the video to
Settings > General > Login Items > Open at Login
via the + button below the list.

I tried that first but all it does is launch QuickTime Player with the video ready to run; I still have to manually click the “Play” icon. I want the video to start playing WITHOUT my having to click play.

I think use IINA (free movie player app) rather than quicktime. It can be set to auto play.

You can associate a single video with that app through the video file get info window.

Then add to login items as above.

https://iina.io

1 Like

Thank you, Matt I’ll try it.

Edit. Well, it doesn’t work, just does the exact same thing as QuickTime Player then waits for me to manually click “play”. The mp4 is set to use the app & the app is entered as a log in item. In the app’s preferences under General>Playlist, “Play next item automatically” is enabled.

How did you get the app to launch AND play a particular mp4 on log in?

1 Like

Automator can only do so much so you need to use Script Editor instead.

The following script works on my M1 but I would think it should work on your iMac:

tell application “QuickTime Player”
activate
set sourceFile to open POSIX file “//Users/jk/Test.MOV”
tell sourceFile
set presenting to true
end tell
play sourceFile
end tell

The line where it says Users would be the path to where your file is.

The “set presenting to true” line makes the video open in fullscreen so if you don’t want that, delete it.

Once the script works to your liking, Export it as an application and then test it. Finally, add the application to your startup items.

2 Likes

I’ve never used Script Editor. Is there a good tutorial for the High Sierra version of it (2.10)?

You could create a local, simple HTML page that has the movie embedded and set to autoplay. Then have that page set as a login item, which will open on your browser. (Assuming you don’t have autoplay overridden with a browser extension.)

Not off hand but you can search for one I would think.

All you have to do in this case is to open the Script Editor which should bring up a new window and copy the code I posted above, paste it in the window and change the path from "//Users/jk/ etc. to the path of your movie. Press the play button to test. If it doesn’t work, it will give an error message which may or may not help but usually it’s because of a missing quotation mark or something very small. If it works, use the File/Export function to save it as an application so that it will run, not a script. You can save the script separately as well.

When I saw your question, it reminded me of what I did with iTunes some time back as I wanted one computer to boot up each time starting with a specific playlist so what you’re trying to do is similar to that. I was able to use Automator for that issue but needed Script Editor for some different iTunes scripts.

That could work but if a browser like Firefox updated when quit, the next time it starts it might not load the video first but the page that says that it updated.

I don’t know about for the editor as such, but here’s an introduction to the AppleScript language:

For application-specific commands, you can get documentation from the app itself. From within Script Editor, select File → Open Dictionary… from the menu bar. Then select the app you want to communicate with. It will open a browser showing the classes and commands that app recognizes:

1 Like