• 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: Best Strategy to Control iTunes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best Strategy to Control iTunes


  • Subject: Re: Best Strategy to Control iTunes
  • From: Michael Ash <email@hidden>
  • Date: Tue, 31 Mar 2009 20:52:59 -0400

On Tue, Mar 31, 2009 at 3:57 PM, Luca C. <email@hidden> wrote:
> 2009/3/31 Ammar Ibrahim <email@hidden>
>> If I want to add a track to iTunes, I need to make sure iTunes is
>> responsive.
>>
>>
> Are you sure it is that important? Actually, if you run an AS script wich,
> say, opens with the Finder some mp3 files whilst iTunes has dialog windows
> opened, the command will be automatically enqueued.  In other words, your
> tracks will be added after the user closes the dialog window.
>  Run the script in a separate thread so it won't block your application's
> interface in any case.

No, don't do this. AppleScript is not safe to use outside the main
thread. If you must run AppleScript asynchronously, either spawn a
subprocess to run it or, better yet, don't use AS at all but send
Apple Events in some other way, such as with ScriptingBridge.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Best Strategy to Control iTunes (From: Ammar Ibrahim <email@hidden>)
 >Re: Best Strategy to Control iTunes (From: "Luca C." <email@hidden>)
 >Re: Best Strategy to Control iTunes (From: Ammar Ibrahim <email@hidden>)
 >Re: Best Strategy to Control iTunes (From: "Luca C." <email@hidden>)

  • Prev by Date: Re: clarification regarding properties
  • Next by Date: Re: [NSView noob] How to be detect when a scroll view scrolls its document view
  • Previous by thread: Re: Best Strategy to Control iTunes
  • Next by thread: Re: Best Strategy to Control iTunes
  • Index(es):
    • Date
    • Thread