File Paths

I’m trying to write a text file to a folder inside my documents folder. The Language Reference Docs only cover “SpecialFolder.Desktop” Here’s what I have so far:

Dim file As FolderItem = SpecialFolder.Documents.Child.(“Vocabulary_Files”).Child(“Vocabfile2.txt”)

Thanks,
-Rob

here is a list - Page Not Found — Xojo documentation

and check TextOutputStream class.

Have you checked if the folder Vocabulary_Files exists?
The folder must exist before you can write files into that folder.
See FolderItem.CreateAsFolder

Axel and Christian: As near as I can tell from the docs, the path should look like;

Dim file As FolderItem = /Users/robertcampanaro/Documents/“Vocabulary_Files”/“vocabulary.text”

This is giving me a syntax error.

Paul: Thanks, the existence of the folder Vocabulary_Files was confirmed.

Found the problem. My original code was correct except that I had inadvertently put a dot operator between Child and (“Vocabulary_Files”)

Documents.Child.(“Vocabulary_Files”)

Can I tack on a problem I have with SpecialFolder?
this code
<f = SpecialFolder.Preferences.child(“XojoTestFile”)
stream = f.CreateTextFile
stream.writeLine “File test”
stream.close>
“works” but I can’t find it in the Preferences folder. So where is it? What is the path to see where it is saved?
I am using High Sierra.

dim f as folderitem
f = SpecialFolder.Preferences
f.launch // or msgbox(f.nativepath)