Re: AppleScript-Users Digest, Vol 14, Issue 479
Re: AppleScript-Users Digest, Vol 14, Issue 479
- Subject: Re: AppleScript-Users Digest, Vol 14, Issue 479
- From: Jim Weisbin <email@hidden>
- Date: Sat, 21 Oct 2017 15:24:15 -0400
On Sat, 21 Oct 2017 22:56:14 +1100 Shane Stanley <email@hidden
<mailto:email@hidden>> wrote:
>
> FYI, if you're doing it a lot, something like this is considerably quicker:
>
> use AppleScript version "2.5" -- 10.11 required
> use framework "Foundation"
> use framework "AVFoundation"
> use scripting additions
>
> set theFile to (choose file)
> set theAsset to current application's AVAsset's assetWithURL:theFile
> set N to theAsset's |URL|()'s lastPathComponent() as text
> set theDuration to theAsset's duration()
> set t to (theDuration's value) / (theDuration's timescale)
> set theFormatter to current application's NSDateComponentsFormatter's new()
> (theFormatter's stringFromTimeInterval:t) as text
>
Unfortunately, a lot of my clients are still on 10.9.5 or 10.10, but this will
be very useful once I get them all updated.
Thanks!
Jim Weisbin | C.T.O. | Human | Post Human | 27 West 20th Street | Suite 801 |
New York, NY | 10011 | (212) 352-0211 | (917) 375-2272 | 2046 Broadway |
Santa Monica, CA | 90404 | (310) 264-0211 telephone | www.humanworldwide.com
<http://www.humanworldwide.com/>
Click here <http://www.humanworldwide.com/#commercials> to view our online reel
_______________________________________________
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