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.
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 lastReceivedEmailsList) to 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:mailAddressesMainError, emailText1Key:emailText1Array, emailText2Key:emailText2Array, emailText3Key:emailText3Array} ## FAILS, cannot retrieve values.
end try
#
## Lots snipped out
#
try
set (my theLastMidnightCheckerStoreNSDate) to my makeNSDateFrom:theLastMidnightCheckerStore
end try
try
set numbersDict to current application's NSDictionary's dictionaryWithDictionary:{sendNumbersChartAlsoKey:sendNumbersChartAlso, sendNumbersChartOnlyKey:sendNumbersChartOnly, numbersGraphStoreEachNumbersFileKey:numbersGraphStoreEachNumbersFile, numbersGraphPreviousDaysPermanentKey:numbersGraphPreviousDaysPermanent, numbersGraphPreviousWeeksPermanentKey:numbersGraphPreviousWeeksPermanent, numbersGraphPreviousMonthsPermanentKey:numbersGraphPreviousMonthsPermanent, numbersGraphLastYearsPermanentKey:numbersGraphLastYearsPermanent, theNumbersGraphTypeKey:theNumbersGraphType}
on error errmsg number errnum
my displayError("saveTheGeneralData set numbersDict " & errmsg as text)
end try
try
set (my theNSPreviousSunday) to my makeNSDateFrom:(my thePreviousSunday)
on error errmsg number errnum
set (my theNSPreviousSunday) to my makeNSDateFrom:(current date)
end try
try
set myDict to current application's NSDictionary's dictionaryWithObjects:{mailDict, theBusinessName, theServerDisk, serverBackupState, hourlyReports, theCoverPagePrinter, theSmallPaperList, theLargePagePrinter, theLargePaperList, sayEveryErrorMessage, rtfdPapersize, largePapersize, voiceSetter, emailsMaxRetrievable, lastReceivedEmailsList, interarchyActivator, saveLocalftpArchiveOnserver, theLastMidnightCheckerStoreNSDate, emailsToChooseFromSortDefiner, numbersDict, theNShourlyReportsDateKeeper, theNSPreviousSunday, specialReportSetterTitle, theLastSpecialReportStoreNSDate, ignoreGraphicConverterCount, checkInterarchyEvery, theMainEmailAddress, includeCompressedExcelSpreadSheet, maxBarcodeCharacters, printGCToA4Test, barcodeSize, dontPrintSignatures, SendErrorMessage, SendSalesErrorMessage, shutDownCycle, errorsListDisplay, eMailAddressesList, printBarcodes, replaceMissingFonts, activateInDesign, AcrobatOverlap, printWithQuark, cropBoxError, cropBoxErrordpi, salesAddressKeeperStore, printEveryImage, eMailAddressesListButton, theGCPosition, saveToAccountancy, saveToAccountancyPath} forKeys:{"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