tell application "Finder"
set MyFile to make new file at desktop with properties
{name:DoStoryName(winningTeam) of me}
open for access file MyFile with write permission
write AGATE to file MyFile starting at eof
close access file MyFile
end tell
Open for access through close access should be outside the tell block.
For that matter, you don't need the tell block at all.
set MyFile to (choose file name default location (path to desktop)
default name "DoStoryName(winningTeam)")
set theFile to open for access MyFile with write permission
write AGATE to theFile starting at eof
close access theFile
If you want it always at the desktop, you can hard code that instead
of using "choose file name"
-- Michelle
--
My choice early in life was either to be a piano-player in a
whorehouse or a politician. And to tell the truth, there's hardly
any difference.
-- Harry S. Truman (circa 1962)