• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Using a variable in a property
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Scripting Remote Access
  • Next by Date: RE: Using a variable in a property
  • Previous by thread: AppleScript 1.7 breaks Smile and others
  • Next by thread: RE: Using a variable in a property
  • Index(es):
    • Date
    • Thread