Novice needs help with MAIL script

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)

Hi, macelha.

You can use text item delimiters for this. Set AppleScript’s text item delimiters to “.”, which notionally defines a “text item” as any stretch of text between two full stops, or between a stop and the beginning or end of a string. Then drop the last stop and the last “text item” from each name:

tell application "Finder"
	set fList to the name of files in folder "test"
end tell

set astid to AppleScript's text item delimiters
set AppleScript's text item delimiters to "."
repeat with thisName in fList
	if thisName contains "." then
		set contents of thisName to text 1 thru text item -2 of thisName
	end if
end repeat
set AppleScript's text item delimiters to astid

-- The names in fList are now extensionless.

Thank you Nigel! I have so much to learn.