Plist problem under Sierra!


Brian Christmas
 

G’day

The following shortened code has worked flawlessly for 6 years, and now party (mostly) fails, especially when saving the email addresses. I’ve checked the output of the Array Controllers, and even replaced them. The count of the output matches the lines of the filled in Table connected to the Array Controllers. However, when creating a Dictionary, it seems to fail.

Some parts write to the plist, most don’t. Basically just the simple variables.

I’ve spent all day trying to find guidance on Apples sites, but haven’t found anything.

Four array Controllers store email lists, 3 of them also have a cell tick box, 1 of them has two cell tick boxes. The Tables are naturally cell based. Always have been.

Any advice, please?

Regards

Santa

on saveTheGeneralData()
  #  Set up Emails
try
set emailText1Array to table1ArrayController's arrangedObjects() as list
on error errmsg
set emailText1Array to {}
my displayError("saveTheGeneralData 1 " & errmsg as text)
end try
try
set emailText2Array to table2ArrayController's arrangedObjects() as list
on error errmsg
set emailText2Array to {}
my displayError("saveTheGeneralData 2 " & errmsg as text)
end try
try
set emailText3Array to table3ArrayController's arrangedObjects() as list
on error errmsg
set emailText3Array to {}
my displayError("saveTheGeneralData 3 " & errmsg as text)
end try
#
try
set (my lastReceivedEmailsListto emailListArrayController's arrangedObjects() as list
on error errmsg
set lastReceivedemailsListList to {}
my displayError("saveTheGeneralData 4 " & errmsg as text)
end try
try
set mailDict to current application's NSDictionary's dictionaryWithDictionary:{mailAddressesMainErrorKey:mailAddressesMainErroremailText1Key:emailText1ArrayemailText2Key:emailText2ArrayemailText3Key:emailText3Array} ##  FAILS, cannot retrieve values.
 end try
## Lots snipped out
#
try
set (my theLastMidnightCheckerStoreNSDateto my makeNSDateFrom:theLastMidnightCheckerStore
 end try
  try
set numbersDict to current application's NSDictionary's dictionaryWithDictionary:{sendNumbersChartAlsoKey:sendNumbersChartAlsosendNumbersChartOnlyKey:sendNumbersChartOnlynumbersGraphStoreEachNumbersFileKey:numbersGraphStoreEachNumbersFilenumbersGraphPreviousDaysPermanentKey:numbersGraphPreviousDaysPermanentnumbersGraphPreviousWeeksPermanentKey:numbersGraphPreviousWeeksPermanentnumbersGraphPreviousMonthsPermanentKey:numbersGraphPreviousMonthsPermanentnumbersGraphLastYearsPermanentKey:numbersGraphLastYearsPermanenttheNumbersGraphTypeKey:theNumbersGraphType}
on error errmsg number errnum
my displayError("saveTheGeneralData set numbersDict  " & errmsg as text)
end try
 try
set (my theNSPreviousSundayto my makeNSDateFrom:(my thePreviousSunday)
on error errmsg number errnum
set (my theNSPreviousSundayto my makeNSDateFrom:(current date)
end try
   try
set myDict to current application's NSDictionary's dictionaryWithObjects:{mailDicttheBusinessNametheServerDiskserverBackupStatehourlyReportstheCoverPagePrintertheSmallPaperListtheLargePagePrintertheLargePaperListsayEveryErrorMessagertfdPapersizelargePapersizevoiceSetteremailsMaxRetrievablelastReceivedEmailsListinterarchyActivatorsaveLocalftpArchiveOnservertheLastMidnightCheckerStoreNSDateemailsToChooseFromSortDefinernumbersDicttheNShourlyReportsDateKeepertheNSPreviousSundayspecialReportSetterTitletheLastSpecialReportStoreNSDateignoreGraphicConverterCountcheckInterarchyEverytheMainEmailAddressincludeCompressedExcelSpreadSheetmaxBarcodeCharactersprintGCToA4TestbarcodeSizedontPrintSignaturesSendErrorMessageSendSalesErrorMessageshutDownCycleerrorsListDisplayeMailAddressesListprintBarcodesreplaceMissingFontsactivateInDesignAcrobatOverlapprintWithQuarkcropBoxErrorcropBoxErrordpisalesAddressKeeperStoreprintEveryImageeMailAddressesListButtontheGCPositionsaveToAccountancysaveToAccountancyPathforKeys:{"mailDictKey", "theBusinessNameKey", "sFKey", "serverBackupStateKey", "hourlyReportsKey", "theCoverPagePrinterKey", "theSmallPaperListKey", "theLargePagePrinterKey", "theLargePaperListKey", "sayEveryErrorMessageKey", "rtfdPapersizeKey", "largePapersizeKey", "voiceSetterKey", "emailsMaxRetrievableKey", "lastReceivedemailsListKey", "interarchyActivatorKey", "saveLocalftpArchiveOnserverKey", "theLastMidnightCheckerStoreNSDateKey", "emailsToChooseFromSortDefinerKey", "numbersDictKey", "hourlyReportsDateKeeperKey", "thePreviousSundayKey", "specialReportSetterKey", "theLastSpecialReportStoreNSDateKey", "ignoreGraphicConverterCountKey", "checkInterarchyEveryKey", "theMainEmailAddressKey", "includeCompressedExcelSpreadSheetKey", "maxBarcodeCharactersKey", "printGCToA4TestKey", "barcodeSizeKey", "dontPrintSignaturesKey", "SendErrorMessageKey", "SendSalesErrorMessageKey", "shutDownCycleKey", "errorsListDisplayKey", "eMailAddressesListKey", "printBarcodesKey", "replaceMissingFontsKey", "activateInDesignKey", "AcrobatOverlapKey", "printWithQuarkKey", "cropBoxErrorKey", "cropBoxErrordpiKey", "salesAddressKeeperStoreKey", "printEveryImageKey", "eMailAddressesListButtonKey", "theGCPositionKey", "saveToAccountancyKey", "saveToAccountancyPathKey"}
on error errmsg number errnum
tell application "System Events" to display dialog "Setting myDict " & errmsg
end try
try
tell application id "com.apple.systemevents"
myDict's writeToFile:thePPath atomically:true
end tell
on error errmsg number errnum
my displayError("AppDelegate's saveTheGeneralData " & errmsg as text)
end try
end saveTheGeneralData