能否通过AppleScript或现成应用在局域网触发多台Mac的视频播放?
Hey there, let's tackle this multi-Mac synchronized playback scenario you're working on! I totally get what you're aiming for—triggering playback across several local Macs with a single "play" button on one machine, each playing their own unique video file. Since you mentioned you couldn't find relevant network-focused solutions (only that QuickTime AppleScript close question), here are some solid approaches to try out:
1. Ready-Made Synchronized Playback Apps (Easiest Option)
If you want a hassle-free solution without scripting, these tools are built exactly for this kind of scenario:
- SyncPlay: A free, cross-platform tool that works seamlessly on macOS. Install it on all your target Macs, create a shared "room" name, and have each machine load its own video file. When you hit play on the control Mac, every connected device starts playback in sync. It automatically adjusts for minor latency, which fits your on-site testing needs perfectly. No complex setup required—just follow the on-screen wizard.
- QLab: If you're working in a professional AV context (like events or installations), QLab is the industry standard. You can set up a master workspace on your control Mac, then configure slave instances on other network-connected Macs. Assign each slave to play its specific video cue, and trigger all cues with a single play command from the master. It’s paid software, but offers rock-solid synchronization and advanced control features.
2. DIY AppleScript + Network Trigger (Custom Free Solution)
If you prefer building a custom setup, combining AppleScript with network access works great:
SSH-Based Trigger
- On every target Mac, enable Remote Login (System Settings > General > Sharing > Remote Login) so your control Mac can access it via SSH.
- On each target Mac, create an AppleScript that launches QuickTime and plays its specific video, then save it as an app:
(Go to File > Export > File Format: Application to save it.)tell application "QuickTime Player" open POSIX file "/Users/YourName/Videos/your-local-video.mp4" play document 1 end tell - On your control Mac, write an AppleScript that sends SSH commands to launch the playback app on all targets (plus trigger your own playback if needed):
You can assign this script to a keyboard shortcut or menu bar button using tools like Automator or BetterTouchTool for easy one-click triggering.-- List your target Macs' SSH addresses (e.g., "username@mac-name.local") set targetMacs to {"jane@studio-mac-1.local", "john@studio-mac-2.local"} set playbackAppPath to "/Applications/PlayMyVideo.app" -- Trigger playback on each remote Mac repeat with mac in targetMacs do shell script "ssh " & mac & " 'open " & playbackAppPath & "'" end repeat -- Play your local video tell application "QuickTime Player" open POSIX file "/Users/You/Videos/control-video.mp4" play document 1 end tell
Bonjour Network Messages (No SSH Required)
If you don’t want to set up SSH, you can use Bonjour to send network signals between Macs. Write a listener script on each target Mac that waits for a specific "play" command, then triggers playback. On the control Mac, send that command to all devices on the local network. This requires a bit more scripting work, but avoids SSH configuration.
3. Command-Line Alternative (ffplay + SSH)
If you don’t want to use QuickTime, ffplay (part of FFmpeg) is a lightweight, reliable option:
- Install FFmpeg on all Macs via Homebrew:
brew install ffmpeg - On your control Mac, run this bash script (or save it as a shell file) to trigger playback across all machines:
The# Trigger remote playback ssh jane@studio-mac-1.local 'ffplay -autoexit /Users/jane/Videos/video1.mp4' & ssh john@studio-mac-2.local 'ffplay -autoexit /Users/john/Videos/video2.mp4' & # Play local video ffplay -autoexit /Users/You/Videos/control-video.mp4&runs remote commands in the background so they don’t block each other, and-autoexitcloses ffplay when the video finishes.
For your use case, I’d recommend starting with SyncPlay if you want a free, no-fuss solution that just works. If you need professional-grade control, QLab is worth the investment. The SSH/AppleScript route is perfect if you want a custom, free setup without relying on third-party apps.
内容的提问来源于stack exchange,提问作者bgdegazio

