• 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: performance drop when calling applescript during performdrag
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: performance drop when calling applescript during performdrag


  • Subject: Re: performance drop when calling applescript during performdrag
  • From: Andrew Farmer <email@hidden>
  • Date: Sun, 11 Jun 2006 03:02:33 -0700

On 11 Jun 06, at 02:24, Thomas Bauer wrote:
In my application I am calling an applescript using NSAppleScript and NSAppleEventDescriptor (because I have to pass a parameter to the script). My application is accepting dragged iTunes songs and i need all the information about the song there including the duration (which is unfortunately not prestent in the pasteboard information). So I call the applescript which gets the "Track ID" of the dragged iTunes track and returns the duration in seconds.

However, if I call the same script during a "performDragOperation", the script takes 10 seconds, giving my application a spinning ball. Unfortunately this is what i need, because i would like to check the total duration immediately, disallowing dragging another song if the total duration exceeds a certain value.

iTunes may be running an auxiliary event loop for file drag operations, so it can't receive Apple Events properly. (Remember that it's still a Carbon application, so it does all sorts of odd things.)


There's really no easy way around this one. Your best bet is waiting for the drag to complete before checking. You could also try reading the track data out of the iTunes XML library, although that's likely to be a rather slow operation with large libraries.

Attachment: PGP.sig
Description: This is a digitally signed message part

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: performance drop when calling applescript during performdrag
      • From: Thomas Bauer <email@hidden>
References: 
 >performance drop when calling applescript during performdrag (From: Thomas Bauer <email@hidden>)

  • Prev by Date: Re: If Functions
  • Next by Date: setMenuBarVisible: with animation
  • Previous by thread: performance drop when calling applescript during performdrag
  • Next by thread: Re: performance drop when calling applescript during performdrag
  • Index(es):
    • Date
    • Thread