Re: plist files instead of properties
Re: plist files instead of properties
- Subject: Re: plist files instead of properties
- From: Shane Stanley <email@hidden>
- Date: Sun, 11 Jun 2017 12:52:01 +1000
On 11 Jun 2017, at 3:07 am, Stockly, Ed <email@hidden> wrote:
>
> Is it better to use AppleScriptObjC to read and write the plists or just use
> System Events?
The biggest down-side to System Events is that it's very slow. For small
amounts of data it might not matter, but it can add up. For ASObjC, the main
downside is that pre-10.11 you can't save AS dates directly. If you're going to
do it in ASObjC, it's a natural for a script library.
> Is there a standard location where plists are generally stored or is it to
> each his own?
Giving each app its own folder in ~/Library/Application Support/ is the
canonical recommendation, but to an extent it's up to you.
> Any drawbacks to doing this?
Only that you're limited to the types of data that can be saved in property
lists.
> I will want to share some the data in some of the plists between multiple
> scripts on the same mac and on different macs. (The plists could be synced or
> shared on a network volume; icloud; dropbox, etc.)
If you want to share them between multiple scripts, you might want to look at
using the defaults system instead, with a shared domain. It's a bit more
complicated to set up, but it's a lot quicker -- defaults takes care of the
actual reading and writing to file, as well as caching stuff -- and has the
added advantage of not requiring everything at once. For example, you might
have a couple of dozen settings, and if you only want to change one, you can do
that with defaults -- otherwise you have to read/write everything each time.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden