Dim fac As New Chilkat.FileAccess
success = fac.WriteEntireTextFile(prefFile.ShellPath,json.Emit(),"utf-8",False)
The output of the ShellPath is exactly /Users/mwilliams/Library/Application\ Support/com.customapp.oauth/ms\-tokens/microsoftGraph.json
FYI, I’ve also tried NativePath and other manual paths. Unfortunately the documentation regarding the root context of WriteEntireTextFile is opaque at best.
@Michael_Williams - On OS X I recreated what you are seeing. When I changed the folderpath to use NativePath for the String output it worked as expected (I failed when using FolderItem.ShellPath)
// MY TEST CODE TO PRODUCE A JSON RESULT
Var jsonTestStr as String = "{""Result"": ""OK"",""Reports"": [{""ReportTxt"": ["" "",""REPORT GROUP: DAILY REPORT""]}]}"
Dim json As New Chilkat.JsonObject
Var success as Boolean = json.Load(jsonTestStr)
json.EmitCompact = False
Dim fac As New Chilkat.FileAccess
Var thisPathFolderItem as FolderItem = SpecialFolder.ApplicationData.Child("MyAzureFolder")
If thisPathFolderItem.Exists = False Then
thisPathFolderItem.CreateFolder()
End If
// SET FILENAME
thisPathFolderItem = SpecialFolder.ApplicationData.Child("MyAzureFolder").Child("microsoftGraph.json")
Var filePathStr as String = thisPathFolderItem.NativePath
success = fac.WriteEntireTextFile(filePathStr,json.Emit(),"utf-8",False)
System.DebugLog(fac.LastErrorText)
I appreciate that Thom as I struggled to figure out how to get the auth code back from the browser outside of using a plugin and the HTMLViewer. Thanks!