• 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: iTunes, NSAppleScript, and timeout
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iTunes, NSAppleScript, and timeout


  • Subject: Re: iTunes, NSAppleScript, and timeout
  • From: has <email@hidden>
  • Date: Thu, 22 Mar 2007 17:34:00 +0000

patrick machielse wrote:

Timing out seems to work fine most of the time _except_ when iTunes' open panel is up the first time doScript: is executed. In that case I have to sit through the entire default timeout period (2 minutes).
[...]
Is this a bug

Your ObjC program is compiling AppleScript source code on the fly, so if the AppleScript component hasn't already obtained the iTunes terminology, it sends iTunes an 'ascrgdte' event to get it. That's the event that's stalling, not the 'get' command in your script.


There's no way to specify a custom timeout for the 'ascrgdte' event, so you'll need to use a different approach that doesn't require getting iTunes' terminology at runtime: either 1. load a compiled AppleScript (.scpt) file located in your bundle, or 2. ditch AppleScript and talk to iTunes directly from ObjC via the low-level Apple Event Manager API (tedious as hell for anything non-trivial) or via a high-level API such as objc-appscript [1] (see my sig).

HTH

has

[1] Not entirely finished (you'll need to ask me about specifying timeouts and other attributes), but already quite usable.
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
http://appscript.sourceforge.net/objc-appscript.html


_______________________________________________
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: do shell hanging
  • Next by Date: Re: do shell hanging
  • Previous by thread: iTunes, NSAppleScript, and timeout
  • Next by thread: Re: iTunes, NSAppleScript, and timeout
  • Index(es):
    • Date
    • Thread