2013-11-22 40 views
2

所以,几年前有一些讨论关于在mac上使用applescript创建视频墙效果来生成应用程序,但代码似乎不再反映QT在小牛队工作。你会将一串视频剪辑“拖放”到应用程序上,它会自动调整它们的大小并循环它们以在屏幕上创建一个很酷的“视频墙马赛克”效果 - 非常酷,如果你输出到大型电视机或投影机到墙使用QuickTime创建一个“平铺的视频墙”或“视频马赛克”

任何想法如何更新/修复此代码,以生成在特立独行的QT修复?这里是最近的迭代中,但如果你下的AppleScript编辑器测试它似乎没有工作...

on open filelist 
    tell application "QuickTime Player" to open filelist 
    run 
end open 
on run 
    tell application "QuickTime Player" 
     set ratio to 4/3 

     tell application "Finder" to set display_bounds to bounds of window of desktop 
     set display_width to (item 3 of display_bounds) 
     set display_height to (item 4 of display_bounds) - 42 -- menu height + title bar 
     set window_count to count of windows 
     set max_pixels to 0 
     repeat with potential_cols from 1 to window_count -- try all possibilities - hardly optimal but who cares. 
      set potential_rows to round (window_count - 1)/potential_cols + 1 rounding toward zero 
      set {potential_window_width, potential_window_height} to {round display_width/potential_cols rounding toward zero, round display_height/potential_rows rounding toward zero} 
      if potential_window_width/potential_window_height < ratio then 
       set {potential_window_width, potential_window_height} to {potential_window_width, round potential_window_width/ratio rounding toward zero} 
      else 
       set {potential_window_width, potential_window_height} to {potential_window_height * ratio, potential_window_height} 
      end if 
      set used_pixels to potential_window_width * potential_window_height * window_count 
      if used_pixels > max_pixels then 
       set {window_width, window_height, cols, rows} to {potential_window_width, potential_window_height, potential_cols, potential_rows} 
       set max_pixels to used_pixels 
      end if 
     end repeat 

     set {x, y} to {0, 0} 
     set wins to (get every window) 
     repeat with win in wins 
      set doc to document of win 
      set «class mctl» of doc to «constant playnone» 
      set looping of doc to true 
      set {wi, hi} to natural dimensions of doc 
      if wi/window_width > hi/window_height then 
       set «class pdim» of doc to {window_width, hi/(wi/window_width)} 
      else 
       set «class pdim» of doc to {wi/(hi/window_height), window_height} 
      end if 
      set x to x + 1 
      if x = cols then set {x, y} to {0, y + 1} 
     end repeat 

     set {x, y} to {0, 0} 
     set wins to (get every window) 
     repeat with win in wins 
      set {wi, hi} to natural dimensions of doc 
      if wi/window_width > hi/window_height then 
       set bounds of win to {window_width * x, 22 + window_height * y, window_width * x + window_width, 22 + window_height * y + hi/(wi/window_width)} 
      else 
       set bounds of win to {window_width * x, 22 + window_height * y, window_width * x + wi/(hi/window_height), 22 + window_height * y + window_height} 
      end if 
      set x to x + 1 
      if x = cols then set {x, y} to {0, y + 1} 
     end repeat 
     set wins to (get every window) 
     repeat with win in wins 
      play document of win 
     end repeat 
     activate 
    end tell 
end run 
+0

可能是剧本不好反正这就是为什么没有找到真正的版本。 – 2013-11-22 17:14:40

+0

@DigiMonk这实际上是一个很酷的脚本。 – Mark

+0

是的,我不知道这个脚本是为QuickTime Player 7而设计的。我们必须重写它才能使用QuickTime Player。 – 2013-11-23 21:58:28

回答

2

这个脚本工作正常使用QuickTime Player 7

苹果仍然使得它可以弥补用于最近版本中的所有缺失功能。

如果它不是已经在你的机器上试试这个下载http://support.apple.com/kb/DL923

然后在脚本重命名所有的“QuickTime播放器”引用“QuickTime播放器7”

+0

很酷。我忘了QTP7。所以我们可以在我承担的小牛队上安装这个 - – 2013-11-23 22:10:28

相关问题