Gabriele's, Stan's, and Tom's suggestions have almost gotten my command file (script
file?) to run. The
error message now is:
Script: "User Preferences" (20-May-2001/21:08:16-4:00)
Script: "Send message with attachment script 8" (8-Aug-2004)
arguments: ["localaddresses.txt message.txt attachments.txt"]
addressfile: %localaddresses.txt
messagefile: %message.txt
attachfiles: %attachments.txt
** Access Error: Cannot open /D/Rebol/test1.file
** Where: build-attach-body
** Near: val: read/binary file
Apparently, the script is opening the "attachments.txt" file and reading the
first filename listed but stripping off the leading "%" that I included in
the file.
For example, the attachments.txt file consists of two lines,
%test1.txt and %test2.txt.
I didn't really think that including the "%" before the filename in the
"data file," attachments.txt, would convert into a block of Rebol filenames
in the attachfiles: word but I didn't know what command to use (reduce?, ...?).
THe script is now:
REBOL [
Title: "Send message with attachment script 8"
File: %sendattach8.r
Author: "jwirt, gabriele santilli, stan silver, tom conlin :-)"
Date: 8-8-04
Purpose: { Load an email script from command line, two arguments.
Uses REBOL 2.5.8.3.1 }
]
arguments: parse system/script/args none
print ["arguments:" mold arguments]
addressfile: to file! system/options/args/1
print ["addressfile:" mold addressfile]
messagefile: to file! system/options/args/2
print ["messagefile:" mold messagefile]
attachfiles: to file! system/options/args/3
print ["attachfiles:" mold attachfiles]
message: read messagefile
members: load/all addressfile
attachments: load/all attachfiles
send/attach members message attachments
The next to last statement is the one that probably needs to change. The individual
filenames in the text
file whose name is stored in the word, attachments:, need to be loaded into
attachments: as a block of
Rebol filennames.
At worst, I could load the list of filenames in attachments.txt into a series word and
then somehow
convert them one by one into a series of Rebol filenames that is then stored as a
block in a word. The
word attachments has to contain a list of Rebol file Names as a block, if I understand
the syntax of the
"send" command correctly.
If I replace the next to last line with:
[%test1.txt %test2.txt]
Currently, the data in the text file attachments.txt are two lines of text, %test1.txt
and %test2.txt.
This gives the error above.
John Wirt
it works perfectly.
Thank you in advance.
John Wirt
--
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.