Where should AppleScripts reside?

  • Hi everyone,

    My Cocoa app has a bunch of standard AppleScripts that are executed on
    various events. I intend to write an installer for the application
    which will also place the standard Applescript in a desired location.

    What is the recommended path for putting such AppleScript files?
    ~/Library/Application Support/AppName?

    Thanks a lot.

    --
    "I never look back darling, it distracts from the now", Edna Mode (The
    Incredibles)
  • If they're standard resources of your application, why not store them
    inside the application bundle instead of crapping them all over the
    user's drive?

    --
    m-s

    On 19 Jan, 2008, at 22:15, Devraj Mukherjee wrote:

    > Hi everyone,
    >
    > My Cocoa app has a bunch of standard AppleScripts that are executed on
    > various events. I intend to write an installer for the application
    > which will also place the standard Applescript in a desired location.
    >
    > What is the recommended path for putting such AppleScript files?
    > ~/Library/Application Support/AppName?
    >
    > Thanks a lot.
    >
    > --
    > "I never look back darling, it distracts from the now", Edna Mode (The
    > Incredibles)
  • 1. Remember to send replies to the list, otherwise you're only talking
    to me. :-)

    2. Allowing the user the ability to add additional scripts is mutually
    exclusive from storing your standard resources inside the application
    bundle. Either provide them a folder to drop their own things into, or
    allow them to point to a script in an arbitrary location, a la iChat
    alerts. (Or point to a folder, etc. There are several ways to do this.)

    3. If you insist on installing the scripts into someone's user folder,
    you have to do it for all users, even ones that exist after the
    installation of your application, otherwise your application has no
    scripts for other users. You'll end up having an at-launch setup-and-
    install-resources check or sticking stuff in the /Library folder
    somewhere . . . both of which add to the complexity of removing your
    application at a later date as well as adding complexity to the
    development, testing, and support of your application.

    4. If you want users to be able to modify the standard scripts you
    ship with, just distribute with your application copies of the
    standard scripts in a folder of example scripts. The power users that
    choose to modify the scripts you ship with will be able to do whatever
    they please, and your application's base configuration will be
    identical on every user's machine. (Your support person will be very
    happy and may buy you cookies for this.)

    --
    m-s

    On 20 Jan, 2008, at 00:11, Devraj Mukherjee wrote:

    > Oh because I was hoping to allow the user to be able to modify/add
    > AppleScripts that runs on the nominated events.
    >
    > Is the Bundle a good idea for that?
    >
    > On Jan 20, 2008 2:35 PM, Michael Watson <mikey-san...> wrote:
    >> If they're standard resources of your application, why not store them
    >> inside the application bundle instead of crapping them all over the
    >> user's drive?
    >>
    >>
    >> --
    >> m-s
    >>
    >>
    >> On 19 Jan, 2008, at 22:15, Devraj Mukherjee wrote:
    >>
    >>> Hi everyone,
    >>>
    >>> My Cocoa app has a bunch of standard AppleScripts that are
    >>> executed on
    >>> various events. I intend to write an installer for the application
    >>> which will also place the standard Applescript in a desired
    >>> location.
    >>>
    >>> What is the recommended path for putting such AppleScript files?
    >>> ~/Library/Application Support/AppName?
    >>>
    >>> Thanks a lot.
    >>>
    >>> --
    >>> "I never look back darling, it distracts from the now", Edna Mode
    >>> (The
    >>> Incredibles)
    >>
    >>
    >
    >
    >
    > --
    > "I never look back darling, it distracts from the now", Edna Mode (The
    > Incredibles)
  • I had asked a related question a few weeks ago about relative paths to
    the application bundle in order to access user scripts and was roundly
    shot down for not thinking about installing such scripts in the ~/App
    Suppors/My App/ folder.  However, I will note that for the domain of
    application I am working on (multimedia composition) most applications
    are installed within a separate folder inside the /Applications folder
    with a directory for extensions and scripts.  Two examples that come
    to mind are Max/MSP and Processing.  So, in short, I think it depends
    on who your apps audience is and what they expect.  In multimedia,
    users don't like going through the ridiculous number of folders of an
    app support installation and instead prefer things to be with the app
    itself along with the option of adding user search paths to the app.

    wes
  • Thanks a lot guys.

    Apologies to replying to Micheal directly. I have done that before,
    still trying to get used to the GMail interface.

    On Jan 20, 2008 4:49 PM, Wesley Smith <wesley.hoke...> wrote:
    > I had asked a related question a few weeks ago about relative paths to
    > the application bundle in order to access user scripts and was roundly
    > shot down for not thinking about installing such scripts in the ~/App
    > Suppors/My App/ folder.  However, I will note that for the domain of
    > application I am working on (multimedia composition) most applications
    > are installed within a separate folder inside the /Applications folder
    > with a directory for extensions and scripts.  Two examples that come
    > to mind are Max/MSP and Processing.  So, in short, I think it depends
    > on who your apps audience is and what they expect.  In multimedia,
    > users don't like going through the ridiculous number of folders of an
    > app support installation and instead prefer things to be with the app
    > itself along with the option of adding user search paths to the app.
    >
    > wes
    >

    --
    "I never look back darling, it distracts from the now", Edna Mode (The
    Incredibles)
  • On 20.01.2008, at 06:49, Wesley Smith wrote:
    > However, I will note that for the domain of
    > application I am working on (multimedia composition) most applications
    > are installed within a separate folder inside the /Applications folder
    > with a directory for extensions and scripts.  Two examples that come
    > to mind are Max/MSP and Processing.  So, in short, I think it depends
    > on who your apps audience is and what they expect.  In multimedia,
    > users don't like going through the ridiculous number of folders of an
    > app support installation and instead prefer things to be with the app
    > itself along with the option of adding user search paths to the app.

      I doubt it has anything to do with the domain you're in. Installing
    such configurable parts in /Applications is unsuitable for multi-user
    setups or server deployment (because all users on the same Mac/logged
    in to the same server will get the same scripts. This used to be OK in
    the System 7 days when I started out, because back then networking
    wasn't done that much, particularly for applications, which were
    simply to large to run over the network, but on OS X this has nothing
    to do with multimedia apps.

      It's a trade-off, as always: If you can, make your app self-
    contained, but if it has user-serviceable parts, put them in one of
    the recommended folders inside Library, so users can customize them
    individually.

    Cheers,
    -- M. Uli Kusterer
    "The Witnesses of TeachText are everywhere..."
    http://www.zathras.de
  • On 20.01.2008, at 12:52, Uli Kusterer wrote:
    > It's a trade-off, as always: If you can, make your app self-
    > contained, but if it has user-serviceable parts, put them in one of
    > the recommended folders inside Library, so users can customize them
    > individually.

      Oh, forgot to mention: There is another reason for not putting your
    customizable stuff in /Applications: Usually, only admin users have
    write access there.

      Also, one can take advantage of the fact that there are several
    library folders: One for each Mac, one for each user, etc.

      So you can use the user's folder to override or augment stuff higher
    up the hierarchy. I wrote a generic plugin-loading class that first
    searches in MyApp.app/Contents/Plug-ins, then in /Library/Application
    Support/MyApp/Plug-ins, then in ~/Library/Application Support/MyApp/
    Plug-ins etc. That way, I can put default, "built-in plugins" (i.e.
    modules of my app that just use the plugin protocol to do their work)
    in my app, where they can't be removed or renamed. An admin can
    install plugins the whole company needs in /Library/... and the user
    herself can install plugins she wants in ~/Library/...

    Cheers,
    -- M. Uli Kusterer
    "The Witnesses of TeachText are everywhere..."
    http://www.zathras.de
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today