• 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: Property List Tools osax with Framework Foundation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
 _______________________________________________
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

  • Follow-Ups:
    • Re: Property List Tools osax with Framework Foundation
      • From: Shane Stanley <email@hidden>
References: 
 >Property List Tools osax with Framework Foundation (From: Denis Boyd <email@hidden>)

  • Prev by Date: Property List Tools osax with Framework Foundation
  • Next by Date: Re: Property List Tools osax with Framework Foundation
  • Previous by thread: Property List Tools osax with Framework Foundation
  • Next by thread: Re: Property List Tools osax with Framework Foundation
  • Index(es):
    • Date
    • Thread