I'm trying to open an existing text file, add some HTML code, and write the result to replace a pre-existing second file, but I keep getting an end-of-file error right off the bat:
tell application "TextWrangler" activate
set sourceFile to (choose file with prompt "Choose the ... text file:") set targetFile to (choose file with prompt "Choose the ... HTML file:")
set introText to "<!DOCTYPE html PUBLIC ...(lots of header code)" --read the books list set booksList to read sourceFile as Unicode text using delimiter return close access sourceFile
... <loop to do the deed, etc.> end tell --"TextWrangler"
I'm trying to open an existing text file, add some HTML code, and write the result to replace a pre-existing second file. I've tried it with the surrounding "tell" set to TextEdit, TextWrangler, Finder, and nothing. Regardless, I get this:
read alias "Goalie:Users:edr:Documents:BUUF:BUUF Library:BUUF library in OO.txt" as Unicode text using delimiter " " --> error number -10004 end tell tell current application read alias "Goalie:Users:edr:Documents:BUUF:BUUF Library:BUUF library in OO.txt" as Unicode text using delimiter " " Result: error "TextWrangler got an error: End of file error." number -39 from file "Goalie:Users:edr:Documents:BUUF:BUUF Library:BUUF library in OO.txt"
I found that error -10004 is a permissions error, so I made sure that the files and their folders are all "Read & Write," but the problem persists. Error 39 is the EOF, presumably resulting from inability to open the file.
-*"*-.,,.-*"*-.,,.-*"*-.,,.-*"*-.,,.-*"*-.,,.-*"*-.,,.-*"*—
|