performance drop when calling applescript during performdrag
performance drop when calling applescript during performdrag
- Subject: performance drop when calling applescript during performdrag
- From: Thomas Bauer <email@hidden>
- Date: Sun, 11 Jun 2006 11:24:08 +0200
Dear list!
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.
When I call this script in script-editor it returns the result in no
time, immediately.
The same happens if I perform the call inside my application in an
action triggered by a button or such. Everything works fine then.
Even resolving more than one song does not cause any noticeable delay.
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.
I have tried all sorts of random things, like calling the script
explicitely on the main thread etc. Nothing helped.
My main problem is that i have no idea why this is and where I have
to look.
Can anyone please tell me why is happening and how it can be solved?
Despite using the script and wanting to know why it may not be called
during a drag,
any other suggestion to determine the duration of a song would also
be helpful of course.
thanks and kind regards
tom
_______________________________________________
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