The script installation in a more central place is an interesting
thought. Is /usr/local/bin the Apple-sanctioned place for
user-installed commandline utilities, rather than something like (the
non-existent) /Users/<username>/bin? I could also install such a
script alongside the .app bundle, which is a thought which had crossed
my mind before I decided to ask more experienced Mac developers, but
that might lead to path problems or long paths again, of course.

Automator-enabling is something which I would tackle at a later stage,
I think. It might not be hard, but it could take me a lot of reading
and learning to get to the point where I would realise this :) I will
focus on separating engine from GUI cleanly, for now, and learning
Cocoa.

Thanks for the reply. I think that'll get me going in the right
general direction.

Carsten


On 22/03/2008, Tom Harrington <[EMAIL PROTECTED]> wrote:
> On Sat, Mar 22, 2008 at 4:26 PM, Carsten <[EMAIL PROTECTED]> wrote:
>  >  However, image processing apps can benefit from batch modes, and
>  >  although some things can be nicely handled by an in-app batch manager,
>  >  the ideal would be to also allow the application to be run from the
>  >  commandline, as a traditional unix utility.
>  >
>  >  Given the .app bundle format of Cocoa apps, I don't quite see how I
>  >  would do this. In main(), I have added an if contingent on the
>  >  existence of commandline parameters (which can be refined in case Mac
>  >  OS X uses these to launch drag-n-drop scenarios, something which I
>  >  don't know yet), which doesn't load the GUI in case the app has been
>  >  launched in commandline batch mode, but the executable is deep inside
>  >  the .app bundle...
>  >
>  >  What is the traditional Mac OS X/Cocoa way of handling such a
>  >  scenario, or is it simply not do it like this, and to force the user
>  >  to use an in-app batch manager?
>
>
> You could just use the executable in the .app bundle, though it would
>  lead to some very long command lines.  For example you can run
>  TextEdit with "/Applications/TextEdit.app/Contents/MacOS/TextEdit".
>
>  One approach that some apps take is to have a separate command-line
>  tool which could be installed in /usr/local/bin or some other more
>  normal-seeming place.  With this approach you'd probably have a
>  regular drag-install app bundle with a menu item to optionally install
>  the command-line tool.  Depending on your architecture the
>  command-line tool could be as simple as a symbolic link to the main
>  bundle's binary.
>
>  Depending on your requirements, you might consider whether the
>  batch-mode processing would be better implemented as an Automator
>  action.
>
>  --
>  Tom Harrington
>  [EMAIL PROTECTED]
>  AIM: atomicbird1
>  _______________________________________________
>
>  Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
>  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:
>  http://lists.apple.com/mailman/options/cocoa-dev/dev%40whimster.org
>
>  This email sent to [EMAIL PROTECTED]
>
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to