I’ve writen this script to create a new MAIL message with all the fields filled. The body text includes names of files in a folder.
Is there any way to capture the file names without the extension?
tell application "Finder"
set fList to the name of files in folder "test"
end tell
set theName to "Name"
set theCopy to "Name"
set theAddress to "address"
set theCopyAddress to "address"
set theSubject to "the subject"
set the line_list to fList
set theSender to ("the sender")
tell application "Mail"
try
set the line_count to the count of the line_list
set this_text to ""
repeat with i from 1 to the line_count
set this_line to item i of the line_list
set this_text to this_text & return & this_line & return
end repeat
set the text of the front document to this_text
end try
set theBody to "Please activate these files. Thank you." & return & this_text
set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return}
tell newMessage
set visible to true
set sender to theSender
make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
make new cc recipient at end of cc recipients with properties {name:theCopy, address:theCopyAddress}
end tell
activate
end tell
Model: G5
AppleScript: 1.9.3
Browser: Safari 312
Operating System: Mac OS X (10.4)