I have an appleScript that works from the AppleScript Script Editor,
but fails when I try to add it to a FMP script. Here it is:

-----
set file1Path to "Macintosh HD:Users:chartley:Desktop:academic web
files:review files:review begin part"
set file2Path to "Macintosh HD:Users:chartley:Desktop:academic web
files:review files:ssr_h1"
set file3Path to "Macintosh HD:Users:chartley:Desktop:academic web
files:review files:ssr"
set file4Path to "Macintosh HD:Users:chartley:Desktop:academic web
files:review files:review end part"
set file5Path to "Macintosh HD:Users:chartley:Desktop:academic web
files:review files:round 1:ssr.php"

set file1Text to read file file1Path
set file2Text to read file file2Path
set file3Text to read file file3Path
set file4Text to read file file4Path
set finalText to file1Text & return & file2Text & return & file3Text &
return & file4Text

writeTo(finalText, file5Path, false, string)

on writeTo(this_data, target_file, append_data, mode) -- append_data
is true or false, mode is string etc. (no quotes around either)
        try
                set target_file to target_file as Unicode text
                if target_file does not contain ":" then set target_file to 
POSIX
file target_file as Unicode text
                set the open_target_file to open for access file target_file 
with
write permission
                if append_data is false then set eof of the open_target_file to 0
                write this_data to the open_target_file starting at eof as mode
                close access the open_target_file
                return true
        on error
                try
                        close access file open_target_file
                end try
                return false
        end try
end writeTo
-----

When I try to add it to a FMP script I get the following error
message: "Expected end of line, etc. but found class name." and
indicates that the error occurs at the word "file" on the line that
reads, "set file1Text to read file file1Path."

This occurs with the latest FMP as well as with my older v.6.

Any ideas what the problem is?

Thanks,
Charlie

Reply via email to