sts24
Registered
I need to know what is wrong with this script:
on will quit theObject
set savepath to do shell script "whoami"
set pathName to "Users:" & savepath & ":Library:Application Support:Note2Self:mainnote.n2s"
set theData to contents of text view "text" of scroll view "text" of window "main" as string
set theFile to open for access pathName with write permission
write theData to theFile as string
close access theFile
return true
end will quit
I can get the thing to write a file, but the contents of the text view "text" doesn't write to the file. I was also wondering how to read this same file on launch. I can't get that to read. Is there an applescript command to overwrite a file so that on each quit, the file updates what is in the text view. Then on the next launch, it will open that same file in the text view "text".
Any help, thanks.
on will quit theObject
set savepath to do shell script "whoami"
set pathName to "Users:" & savepath & ":Library:Application Support:Note2Self:mainnote.n2s"
set theData to contents of text view "text" of scroll view "text" of window "main" as string
set theFile to open for access pathName with write permission
write theData to theFile as string
close access theFile
return true
end will quit
I can get the thing to write a file, but the contents of the text view "text" doesn't write to the file. I was also wondering how to read this same file on launch. I can't get that to read. Is there an applescript command to overwrite a file so that on each quit, the file updates what is in the text view. Then on the next launch, it will open that same file in the text view "text".
Any help, thanks.