Re: Dir of app
Re: Dir of app
- Subject: Re: Dir of app
- From: Gregory Weston <email@hidden>
- Date: Tue, 18 Dec 2007 15:12:19 -0500
On Dec 18, 2007, at 2:11 PM, Wesley Smith wrote:
Well, in the app I'm building, there are alot of scripts that are
going to be kept in 1 of 2 places depending on if they should be
touched by the user or not. One will be in the resources folder
inside the app folder and the other will be in a subfolder of the
app's folder in /Applications. Here's the basic layout:
/Applications/App/
App/Contents/Resources/Scripts <----
scripts the app uses internally
Scripts
<----- user scripts
The application is basically a shell of a Cocoa app with Lua running
inside it. Everything is completely configured through scripts and
I'd like to have a few directories that are standard with the app
where a user can throw scripts in and have them automatically in the
search paths of the app. Of course, more search paths can be added by
the user, but at the minimum I want there to be 1 directory that the
app always knows about and the cleanest way to do that is to define a
folder relative to the app location. There are a number of apps for
OSX that follow this same convention so I don't think it's unusual at
all but if you have any other ideas for how to handle this, I'd love
to hear them.
For the internal scripts, you shouldn't be building paths manually.
You should use the utility methods provided by NSBundle, invoked on
your app's main bundle.
For external scripts, I don't agree that "the cleanest way to do that
is to define a folder relative to the app location." I think the
cleanest way to do it is to document that your app will look for user-
provided scripts in /Library/Application Support/YourApp and ~/
Library/Application Support/YourApp and then do so. You're correct
that there *are* a number of apps that behave like you plan to, but
that number is quite small and I'd suggest that a lot of people are
annoyed by support folders cluttering up /Applications or by app's
requiring that they be in specific locations, absolute or relative to
some other information.
_______________________________________________
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