Trying to save a file with information from "system profile''

Hi,
I ‘m trying to save a file with information from "system profile’’ with thise script

set fileinfo to “path:to:fileinfo.txt”
tell application “Apple System Profiler”
set info to system profile as text
write fileinfo to info
end tell

I received a error " “could not insert text beacuase the text would be longuer that the maximum posible length”

I have mac OS 10.2.8

could anybody help me

thanks

M!

That’s not how you write to a file. (Note: this script was written on Mac OS 10.3.2 and “Apple System Profiler” is simply called “System Profiler”.)

set fileinfo to (((path to desktop) as string) & "fileinfo.txt")
tell application "System Profiler"
	activate
	set info to system profile as text
	try
		quit
	end try
end tell
my write_to_file(fileinfo, info, false)

on write_to_file(the_file, the_string, with_appending)
	set the_file to the_file as file specification
	try
		open for access the_file with write permission
		if with_appending = false then set eof of the_file to 0
		write (the_string as text) to the_file starting at eof
		close access the_file
	on error
		try
			close access the_file
		end try
	end try
end write_to_file

Jon

perfect… thanks a lot …