Re: Property List Tools osax with Framework Foundation
Re: Property List Tools osax with Framework Foundation
- Subject: Re: Property List Tools osax with Framework Foundation
- From: Shane Stanley <email@hidden>
- Date: Fri, 12 May 2017 21:33:58 +0200
On 12 May 2017, at 7:42 pm, Denis Boyd <email@hidden> wrote:
Does anyone have a workaround for this?
I suspect Property List Tools is incompatible with ASObjC -- it's fairly old. But you don't need it:
use AppleScript version "2.4" use framework "Foundation" use scripting additions
set thePath to POSIX path of "Macintosh HD:Users:[username]:Library:Preferences:com.myPlist.plist" set theData to current application's NSPropertyListSerialization's dataWithPropertyList:{myvalue:"the value"} format:(current application's NSPropertyListBinaryFormat_v1_0) options:0 |error|:(reference) theNSData's writeToFile:thePath atomically:true
|
_______________________________________________
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