I am using textedit to create a document and then save it. When it gets to the save step I get this message in the event log:
save document 1 as text in "Beow27:Users:mkaz:Documents:Homepage:mrev:xx.txt"
--> error number -10000
The dialog box error is:
“The document xx.txt could not be exported as xx.txt. You don’t have permission.”
I know this is something simple, it has eluded me.
Thanks!
tell application "Mail"
set selectedMessages to selection
if (count of selectedMessages) is equal to 0 then
display alert "No Messages Selected" message "You must select a message first."
else
repeat with i from 1 to count of selectedMessages
set theMessage to item i of selectedMessages
set theSub to subject of theMessage
copy (display dialog theSub & " Enter file name:" buttons {"OK", "Cancel"} ¬
default button "OK" default answer ".txt") to dialogResult
if the button returned of dialogResult is "Cancel" then quit
copy the text returned of dialogResult to arg
set theFilename to "Beow27:Users:mkaz:Documents:Homepage:mrev:" & arg
set theContent to content of theMessage
set theSub to subject of theMessage
set thedate to date sent of theMessage
tell application "TextEdit"
activate
make new document
tell the front document
set paragraph 1 to "Subject: " & theSub & return & "Date: " & thedate & return & return & theContent
end tell
save the front document as text in theFilename -- Where it crashes
close the front document
end tell
tell application "Mail"
activate
end tell
tell application "Finder"
open "Beow27:Users:mkaz:Documents:Homepage:mrev"
end tell
end repeat
tell application "TextEdit"
quit
end tell
end if
end tell