Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.
write text to file fileName ¬
[at { eof|end|[-]integer]}
write
command copies text to a file. You must have already opened the file with the open file
command, and you should close it when writing is completed with the close file
command. write
command after opening a file begins at the start of a file unless you use the at integer
option, with integer
as the character position within the file where writing is to begin. -integer
option begins writing at integer
characters from the file's end. write
commands append text to the file’s contents after the last character written until you close the file. write "Hello" to file "My Data"
write field 1 & return & field 2 to file "My Data"
write someStuff to file "My File" at -15
on writeData theData
ask file "Write to what text file?" with "Untitled"
if it is empty then exit writeData
put it into theFileName
open file theFileName
write theData to file theFileName
close file theFileName
end writeData
"Hello"
"The sum is:" && 3
card field 1
line 1 of bg fld "Address"
the Message box
the selection
myVar -- a variable
See also: background, bkgnd, button, card, field,
menu
, menuItem, and stack
"my stack"
"HD20:Wally's Stacks:my stack"
"my file alias"
3
18 - 100
-(3 * sum(1,3,4,5)) + 39
In AppleScript, integer is a value class. Commands
Version 0.7b1 (March 24, 2022)