You really should start with some error checking!
1. Check if file is really present:
Code: Select all
on openStack
put specialFolderPath("documents") & "/test.txt" into tFile
IF THERE IS A FILE TFILE then
put URL ("file:" & tFile") into tSec
ELSE
put "No file yet!" into tSec
end if
put tSec into field "fsField"
end openStack
2. Check if writing was successfull:
Code: Select all
on shutdown
put specialFolderPath("documents") & "/test.txt" into tFile
put "second" into URL ("file:" & tFile)
if the result <> EMPTY then
answer "Error writing file!" & CR & the result & CR & syserror()
end if
pass shutdown
end shutdown
Maybe the answer dialog will show what might have gone wrong.
P.S.
As you can see I am not a friend of "messin' with the defaultfolder".
If I can have an absolute pathname, I will use it!