Re: ASScriptMenuManager
Re: ASScriptMenuManager
- Subject: Re: ASScriptMenuManager
- From: has <email@hidden>
- Date: Sun, 22 Jul 2007 13:28:04 +0100
Ron Fleckner wrote:
I've developed an Objective-C class which creates and manages a
Scripts menu for Cocoa apps.
Nice. Like the hierarchical and organisation support. FWIW, the demo
project works fine here on G4/10.4.10 and i386/10.4.9.
One bug I noticed: if I put a non-script file in the Scripts folder,
some menu items may not show up (which ones depends on the file's
name) and the Add/Remove Script Menu doesn't work correctly either:
2007-07-22 13:26:35.244 ASScriptMenuManager demo[536] *** -
[NSCFString substringFromIndex:]: Range or index out of bounds
Also, a couple suggestions, one to improve user interaction and one
to extend its appeal:
1. At the moment, addition/removal of scripts while the app is
running isn't automatically detected - users need to restart the menu/
app for changes to take effect. It'd be nice if menu refreshes were
done automatically (e.g. when the user opens a menu/submenu), though
you would need to watch for performance issues - e.g. Apple's system-
wide script menu frequently stalls while opening as it checks
[presumably] the entire file hierarchy, but maybe if you just refresh
individual [sub]menus only as they're needed it'd perform ok.
2. You might consider adding support for Python/Perl/Ruby/shell/etc.
scripts as well as OSA scripts. There are several languages that have
good Apple event support but whose OSA support isn't currently
sufficient to permit OSA attachability. Being able to execute, say,
a .rb file directly would allow users to invoke such scripts from
your menu without having to wait for a full Ruby OSA component to
become available. The only thing you need to do is avoid blocking the
client app's main event loop while the script is running (either by
detaching the interpreter subprocess or by having a background thread
manage it) so that you don't get a deadlock if the subprocess tries
to send Apple events back to the parent app.
HTH
has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
http://appscript.sourceforge.net/objc-appscript.html
_______________________________________________
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