Scripting problem/question
Scripting problem/question
- Subject: Scripting problem/question
- From: Michelle Steiner <email@hidden>
- Date: Mon, 12 Feb 2001 15:30:41 -0800
There's a problem with the reject-HTML script that I wrote.
As written below, it works fine when run from either the script editor or
manually selected from the applescript menu.
But when run from a mail action, making the changes indicated, it
generates an error after deleting the files and the message.
The error is the generic "unstuff a file" error when Emailer doesn't
understand the error. (this generic dialog is a bug we weren't able to
squash before releasing emailer.)
Anyone have any idea of what's going on there?
--Michelle
set replycontent to "blahbhah"
set rejectlist to {".html", ".htm", ".asp", ".jsp"} --add suffixes as
needed
tell application "Claris Emailer"
set foo to the selection --comment out this line for mail actions
set the rejectedmessage to item 1 of foo --comment out this line for
mail actions
-- set the rejectedmessage to the filtered message --uncomment for mail
actions
if the content of the rejectedmessage is "" then
set filelist to files of the rejectedmessage
if filelist is not {} then
repeat with currentfile in the filelist
set fileName to name of the currentfile
repeat with testphrase in the rejectlist
if (offset of testphrase in fileName) is not 0 then
set replyMessage to reply to the rejectedmessage ,
without replying to all
set the content of replyMessage to replycontent
set the scheduled of the replyMessage to false
repeat with filetobedeleted in the the filelist
set the deletedFileName to the name of the filetobedeleted
tell application "Finder" to delete file deletedFileName
end repeat
end if
exit repeat
end repeat
end repeat
delete the rejectedmessage
end if
end if
end tell
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------