Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Expensive widget calls to widget.system("/usr/bin/osascript....")



JavaScript isn't multithreaded, even if you start something with a timer. But you can have widget.system() spawn a separate thread by providing a function that will be called when it finishes. This is described here:

http://developer.apple.com/documentation/AppleApplications/Conceptual/ Dashboard_Tutorial/Scripts/chapter_12_section_4.html

Ben

On Nov 19, 2005, at 5:26 AM, Brian Klock wrote:

When my widget makes its call to widget.system("/usr/bin/ osascript...") to get some information from external applications, it freezes the widget for about half a second. Any ideas what the cause is? It's difficult to believe AppleScript could be this slow when it's only getting a few lines of text as a response. True, it is launching an entire separate process (osascript), though I don't think that is supposed to be so expensive.

What ways are there to optimize it? It's already running in a separate timing thread. Anyone have insights into the multithreading architecture of JavaScript in Safari?

Brian


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/kazezb% 40carleton.edu


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Dashboard-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden
References: 
 >Expensive widget calls to widget.system("/usr/bin/osascript....") (From: "Brian Klock" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.