Thanks, Jeff, I’ll try to answer all that. I started work on this app about six weeks ago on my laptop in Australia using the latest Mac PowerBook OS after not using Xojo for a couple of years. (It’s important to know that I had no serious problem with it until about 24 hours ago (after installing Mac OS 10.15.7 on my iMac in England)).
I had to remind myself how Xojo worked so I experimented with folderItem, creating folders and files in my Documents folder. I created a “xojoData” folder programatically and within that two folders, call them “folderA” and “folderB”.
I had two main routines to output and input a text file. My input/output code was pretty much the same:
//Dim everything needed including folderItems d, f, g, h
//In particular Dim d As FolderItem = SpecialFolder.Documents
//and text input or output stream t
If d <> Nil Then
f=d.Child("xojoData")
if f<>Nil then
g=f.child(“folderA”)
If g<> Nil Then
h=g.child(“diskFile.text”)
if h<>Nil and h.exists = true then
t=TextOutputStream.Create(h)
//do stuff
end
end
end
end
That’s from memory so I may have a typing error in there.
Then I got a file of words off the internet, dumped the text in a named .txt file in folderA and input it into my app, sorted everything by length into arrays and then spat them out again as lists with names like “list3.txt”, “list4.txt” etc so I could access them by length in future. Those files were Xojo created. I accessed several of those files later using TextEdit, more to look at them than change them. Everything worked fine in the app with input and output.
When I got back to England about two weeks ago, I shifted to using my elderly iMac because the screen is bigger but that didn’t seem to create any problems. I had a fresh download of the latest Xojo on the iMac although my app in progress was on my iCloud.
After a while (several days) when I started using my file input routines, I started getting the alert which I mentioned at the start of this thread, “myapp.debug.app” would like to access files in your Documents folder. Not serious, I just had to click on the OK button, but a bit irritating.
I discovered I could avoid this irritation by dragging a copy of my xojoData folder to my iMac’s “Application Support” folder and using a path to get there so I replaced:
Dim d As FolderItem = SpecialFolder.Documents
with
Dim d as new FolderItem("/Users/imac27/Library/Application Support")
The alert window stopped bothering me and I carried on with developing the code. Then, within the last day or two, I realised I was getting problems with my data not loading. I assumed I had inserted a logical error somewhere in the code I was developing, although I couldn’t see what it was.
Eventually, I tracked the problem down to the textfile input routine. In the debug, it would go right through to the line
if h<>Nil and h.exists = true then
Actually that line had become just
if h.exists = true then
At that point the debug app just skipped to the end, obviously deciding that h did not exist
I changed it to
if h<>Nil then
And the debug got past that line, but when it tried to do a readLine, it failed and skipped to the end.
At that point I tried reverting to using the Documents folder again simply by changing back to
Dim d As FolderItem = SpecialFolder.Documents
I had never moved the folder xojoData that had been working - I had just copied it, dragged the copy to the new location and given it the original name.
But that was no longer working - the debug just skipped to the end after trying to implement the line referring to folderItem h.
Then I looked at the information windows on my text files, saw that the files seemed to be owned by TextEdit and tried changing the “Open With” entry to Xojo but that didn’t help.
I hope that answers all your questions. - Steve