Write Permission Error in iCloud

Hello,
I get a “Stopped (Error: touch: Lambton1948.md: Read-only file system error”

after the following piece of AppleScript and shell combination where the file in question
should be created on Icloud.

if not FileExists(fullFile) then
	do shell script "touch " & quoted form of fullFile -- Not pure AppleScript :(
	set myFile to open for access (fullFile) with write permission
	write noteText to myFile
	close access myFile

Thanks so much for your help.

Yours,
Maurice

Hi, try it. Just replace the username.

set fullFile to "Macintosh HD:Users:User:Library:Mobile Documents:com~apple~CloudDocs:Temp:test2.txt"
set noteText to "some text" as text

try
	return get alias fullFile
on error
	set myFile to open for access (fullFile) with write permission
	write noteText to myFile
	close access myFile
end try