Re: Adding commandline batch mode to Cocoa app
Re: Adding commandline batch mode to Cocoa app
- Subject: Re: Adding commandline batch mode to Cocoa app
- From: Carsten <email@hidden>
- Date: Sun, 23 Mar 2008 22:08:08 +0100
Running from both the GUI and commandline at the same time would be
rather unusual. I don't expect that heavy commandline batch users will
use the GUI app for anything but setting up some configuration files,
so it would be acceptable for the script-launch to detect that it was
running already, print a message and quit.
On the other hand, why would it be a problem? Can multiple copies of
the same app not run? I have not seen Mac OS X apps run like that,
true, but I didn't realise it would be a problem...
(I don't think I'll be emulating much from Photoshop. I have hardly
seen a worse example of how to code for Mac OS X :) Given how much
that app costs (and it costs about 2.5x as much in Europe as in the
States), they ought to be ashamed of themselves. Non-standard
keystrokes, broken GUI guidelines, weird memory management, and so on.
A re-write is desperately needed.)
I have mentioned using a batch manager within the GUI app, but this is
not going to be enough for everyone, just most people. I might hook
into Applescript, but not right off the bat, since I already have too
much to do. Some simplifying assumptions are in order for me.
As for target audience, I expect that most people would be happy with
the GUI, and most users will be photographers, with some percentage
(10-15% perhaps) being power users who will want to explore things
like batch processing. Just a few would go to the commandline, but I
don't want to leave them behind.
Note that I am not planning to attack all this at once. I just want to
make sane choices up front about how things would be done, skeleton it
out, and then leave most of it for a later full implementation. I want
to start with the core engine and the Cocoa GUI. The initial overall
architecture should not be done later though. That might make it very
hard to accomplish cleanly, if at all.
Carsten
On 23/03/2008, Brian Stern <email@hidden> wrote:
>
> On Mar 23, 2008, at 4:43 AM, Carsten wrote:
>
> > Ah, okay, I see now. My script will just launch the application
> > executable with a specific commandline that forces it into batch mode,
> > so the difference in functionality or convenience between a symlink to
> > a tool and a generated one-liner script (plus some error handling for
> > a broken link) is probably too small to bother about the development
> > of the tool, I think.
>
>
> And what will your app do if it is already running in non-batch mode
> when the user runs this script?
>
> From the beginning "mode" has been a four letter word among Mac
> developers.
>
> You could do worse than to follow Photoshop's model for this problem.
> Have a menu item that opens a dialog and allows the user to set up
> batch processing. Make your app scriptable and allow the user to
> access the batch functionality from Applescript.
>
> If you want to be fancy you can auto-generate applescripts that do
> whatever the user has done in the Batch window. Photoshop has this
> functionality and it's called droplets. (I don't know how they work
> actually but they appear to be applescripts or applescripts plus
> something else.)
>
> Who is the target audience for your application? If it at all
> includes "regular Mac users" then any solution that involves the
> Terminal and /usr/bin is not a good solution.
>
>
> --
> Brian Stern
> email@hidden
>
>
>
>
> _______________________________________________
>
> 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
>
_______________________________________________
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