在 OSX 上创建基于 USB 输入的变速幻灯片
我有一个朋友正在尝试为婚礼制作一个令人讨厌的小装置,人们可以在其中观看幻灯片。我们都没有使用 Mac,也没有为 Mac 编程过,但由于各种原因它必须在 Mac 上运行。
将有一个 USB 电流表连接到自行车发电机上。我们想要的是运行幻灯片,并以相对于某人踩固定自行车的速度的速度前进。
经过多次谷歌搜索后,我们似乎可以通过 applescript 加载 iPhoto 幻灯片。是否可以暂停幻灯片放映并使用按键命令前进?
applescript 命令将通过 bash 脚本或类似脚本运行,该脚本将监视 USB 电流表的命令行应用程序返回的值并相应地发出按键事件。
是否有其他一些应用程序可以同样编写脚本来显示照片?希望有人能提供一些提示,让我们朝着正确的方向开始!
谢谢!
I have a friend who is trying to put together a geeky little contraption for a wedding, where people can view a slideshow. Neither of us use Macs, nor have programmed for one, but for various reasons it has to run on a Mac.
There will be a USB ammeter hooked up to a bike dynamo. What we want is for a slideshow to be run, and advance at a speed relative to how fast someone is pedaling on a stationary bike.
After much googling, it seems like we could load an iPhoto slideshow up via applescript. Is it possible to pause the slideshow and advance it with keypress commands?
The applescript commands would be run via a bash script or similar that would monitor the value returned by the USB ammeter's command-line app and issue the keypress events accordingly.
Is there some other app that could be likewise scripted to display photos?Hoping someone has some hints to get us started in the right direction!
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为控制 Quicktime 电影是最简单的。请注意,您可以将 iPhoto 幻灯片保存到 QuickTime 影片中...这可能是最好的方法。
因此,假设您在 QuickTime 播放器中将幻灯片作为电影播放,那么您可以使用 applescript 命令控制它,并且可以执行如下操作...
1.0 的速率是正常速度。低于 1.0 会使电影变慢等等。我的示例将电影速度加快了 50%。您还可以对前面的文档执行其他操作,例如“播放”、“停止”、“暂停”。
在 bash 中,您可以使用 osascript 运行 applescript。所以上面的 applescript 可以使用下面的 bash 脚本从命令行运行......
我希望有帮助。祝你好运。
I would think controlling a quicktime movie would be easiest. Note that you can save an iPhoto slideshow to a quicktime movie... this might be the best approach.
So assuming you have the slideshow playing as a movie in quicktime player, then you can control it with applescript commands and you could do something like the following...
A rate of 1.0 is normal speed. Under 1.0 is slowing the movie and so on. My example speeds the movie up by 50%. You can also do other things to the front document, like "play", "stop", "pause" for example.
And from bash you can run an applescript using osascript. So the above applescript can be run from the command line with the following bash script...
I hope that helps. Good luck.