• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: where to put files owned by the application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: where to put files owned by the application


  • Subject: Re: where to put files owned by the application
  • From: Chris Page <email@hidden>
  • Date: Sun, 20 Jun 2004 05:13:24 -0700

On Jun 20, 2004, at 04:41, Ronald Hofmann wrote:

I already thought of this. But I'm taking care of a counter which holds the number, how many times the app was launched. When the user deletes the app and reinstalls it then the counter has to start from scratch. But I want the counter to continue even after reinstall.

Application bundles should be assumed read-only, anyway, except in very unusual circumstances. Users should be allowed to run software stored on read-only disk images or on read-only network volumes, for example.

By default, application-managed data should either be stored in a preferences file -- if the data is relatively small and ultimately safe to throw away -- or in a file in ~/Library/Application Support/<YourApplicationName>/. Application-managed data should only be stored elsewhere in exceptional circumstances (ignore the fact that some Apple applications store data directly in ~/Library/, for example.)

When scripting, you can use 'do shell script' to invoke the 'defaults' command to read and write preferences, or you can locate the Application Support folder and store arbitrary data in a file of your choosing with 'open for access', 'read', and 'write'. Note that I see no way to get to either the Library or Application Support folders directly. I think you'll need to ask for the user's home folder, then, unfortunately, specify the folders by name. Finally, create a folder with the same name of your application -- or something more unique if your application name is likely to collide with other programs -- and then create a file inside that folder, with whatever name seems appropriate.

--
Chris Page - Software Wrangler - Dylan Pundit

Dylan + You = Code
<http://www.gwydiondylan.org/>
<http://www.cafepress.com/chrispage>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: where to put files owned by the application
      • From: "Shane Stanley" <email@hidden>
References: 
 >where to put files owned by the application (From: Ronald Hofmann <email@hidden>)
 >Re: where to put files owned by the application (From: Walter Ian Kaye <email@hidden>)
 >Re: where to put files owned by the application (From: Ronald Hofmann <email@hidden>)

  • Prev by Date: Re: where to put files owned by the application
  • Next by Date: Re: Unicode issue (jj)
  • Previous by thread: Re: where to put files owned by the application
  • Next by thread: Re: where to put files owned by the application
  • Index(es):
    • Date
    • Thread