Using a variable in a property
Using a variable in a property
- Subject: Using a variable in a property
- From: William Barnes <email@hidden>
- Date: Tue, 11 Dec 2001 17:00:30 -0800
I'm trying to write my first script, and would like to know if it is
possible to use a variable in the definition of a property. The object of
the script is to save Emailer messages of the Applescript list digest to
a folder outside of Emailer:
tell application "Claris Emailer"
activate
set bodyvar to message 1 of folder "AppleScript list"
set subjectvar to subject of message 1 of folder "AppleScript list"
end tell
tell application "Finder"
activate
set filnam to characters 26 thru 35 of subjectvar
set destfol to "Macintosh HD:E-mail:AppleScript list:"
make file at destfol with properties ,
{name:filnam as string, creator type:"NISI", file type:"TEXT"}
set filRef to (open for access file filnam with write permission)
write bodyvar to filRef
save fileRef
close access filRef
end tell
The script chokes on the "make file..." line with an error message
"Invalid key form". I am assuming that this results from my trying to use
the variable 'filnam' for the 'name' property, and it cannot be coerced
into a string. Any suggestions would be greatly appreciated.
William