• 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: AppleScript-Users Digest, Vol 14, Issue 479
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: What is "system events" ?
  • Next by Date: Re: What is "system events" ?
  • Previous by thread: Please stop reply discussions
  • Next by thread: Raising the 'auto open zipped .dmg's' again.
  • Index(es):
    • Date
    • Thread