• 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: Quicktime frame rate calculation error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quicktime frame rate calculation error


  • Subject: Re: Quicktime frame rate calculation error
  • From: Shane Stanley <email@hidden>
  • Date: Sun, 14 Dec 2014 12:13:40 +1100

On 14 Dec 2014, at 8:42 am, Jim Weisbin <email@hidden> wrote:

However, this throws an "out of bounds" error:

You have a couple of problems there. First, you only need quoted form for shell scripts; you shouldn't quote the path here. Second, you're building a URL called anNSURL, but then you try to pass one called myURL. And I think you'd be better to take that stuff outside the QuickTime tell block. Try this:

use scripting additions
use framework "Foundation"
use framework "AVFoundation"

tell application id "com.apple.quicktimeplayer"
activate
set original_file to get original file of document 1
end tell
set posix_file to POSIX path of original_file
set anNSURL to current application's NSURL's fileURLWithPath:posix_file
set theAsset to current application's AVURLAsset's URLAssetWithURL:anNSURL options:(missing value)
set theTrack to (theAsset's tracksWithMediaType:(current application's AVMediaTypeVideo))'s objectAtIndex:0
set theFrameRate to theTrack's nominalFrameRate()
set theSize to theTrack's naturalSize()
return {theFrameRate, width of theSize, height of theSize}


-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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: Quicktime frame rate calculation error (From: Jim Weisbin <email@hidden>)

  • Prev by Date: Re: Quicktime frame rate calculation error
  • Next by Date: Re: Quicktime frame rate calculation error
  • Previous by thread: Re: Quicktime frame rate calculation error
  • Next by thread: Re: Quicktime frame rate calculation error
  • Index(es):
    • Date
    • Thread