• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Fix this script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fix this script


  • Subject: Re: Fix this script
  • From: Lists <email@hidden>
  • Date: Sun, 03 Feb 2013 21:22:38 -0800

On Feb 3, 2013, at 8:11 PM, "Ball, Dan" <email@hidden> wrote:

Yes, if you comment it out and save it as an application and then drag videos onto it you get another error.  "This script contains uncompiled changes and cannot be run."  Doesn't say where the problem is though.  I think its the dimensions of the if statement. Commented those out and it loads the videos but its not right.  This whole part needs re-written.  I also changed it from "Quicktime Player" to "Quicktime Player 7".  I have QT7 Pro still.

I think this whole part is screwy, the commented parts are what I think is messed up in that script on http://hints.macworld.com/article.php?story=20090515094704521:

I copied the script from hints.macworld and directed it at "QuickTime Player 7" and it works great. I'm on OS X 10.8.2.
J


on open filelist
  tell application "QuickTime Player 7" to open filelist
  run
end open
on run
  tell application "QuickTime Player 7"
    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 controller type of doc to none
      set looping of doc to true
      set {wi, hi} to natural dimensions of doc
      if wi / window_width > hi / window_height then
        set dimensions of doc to {window_width, hi / (wi / window_width)}
      else
        set dimensions 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
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Fix this script (From: "Ball, Dan" <email@hidden>)

  • Prev by Date: Re: keystroke "esc"
  • Next by Date: Re: Fix this script
  • Previous by thread: Re: Fix this script
  • Next by thread: Unlock script
  • Index(es):
    • Date
    • Thread