On 8/10/02 9:35 PM, "Paul Berkowitz" <[EMAIL PROTECTED]> wrote:It compiles for me too, in Script Debugger and Script Editor X, but nevertheless, it's an error. You're trying to talk to the front window of Entourage. But you've taken it out of the Entourage tell block (why?). So it's compiling because all those terms 'front', 'window', 'class', 'message window', 'close' - are all basic AppleScript terms. (I'm still wondering about 'message window' but that's how it appears here in AS 1.8.3/OS 10.1.5.) Bit they have nothing to do with Entourage- that part of the script won't do anything if a message is open in its own window.
>> BTW, when I tried to compile your script, it wouldn't until I moved the
>> 'tell front window' block in your ProcessMsg handler inside the 'tell
>> "Microsoft Entourage"' block.
>
> Right. There's some funny business going on here. The script couldn't have
> compiled and set those lurid formatting colors in that state. Lines have
> been moved!
It compiled for me as sent; then I copied and pasted it into an email :) Here it is again, just to be sure I didn’t accidentally munge it before:
tell application "Microsoft Entourage"
set currentMessages to the current messages
if currentMessages = {} then
error "No messages selected. Select at least one message in a folder, or open a message to file."
error -128
end if
repeat with theMsg in the currentMessages
my ProcessMsg(theMsg)
end repeat
end tell
on ProcessMsg(theMsg)
tell application "Microsoft Entourage"
set the read status of theMsg to read
set category of theMsg to {category "Junk"}
move theMsg to folder " SPAM"
end tell
tell the front window
if class is message window then close
end tell
end ProcessMsg
>> Another BTW, and Paul would know about this better than I, but it seems toIt works perfectly here. What is more - it embarrasses me. It actually _does_ set Junk status as well as Junk category! that's quite a neat trick of the MBU. Nothing to do with scripting: just setting Junk category in the UI as well also sets Junk status, I see. I bet it also works in other languages (whatever they may call "Junk" there), because Entourage supplies that category by default, and probably understands it.
>> me that with a script this simple, it would probably be faster to not even
>> use that ProcessMsg handler.
>
> I agree completely. However, since it worked OK with setting read status it
> should also set the category. Unless Dan doesn't have a "Junk" category, in
> which case it should error. Here's what I think:
Nope, I have a category “Junk”
> There's some other Rule in operation which is stripping the category. Is
> this by any chance an IMAP account?
Nope, it’s a POP account, and I’m not using this script in a rule — I only use it manually after email has been downloaded and all rules have of course already been run. And I don’t have any other rules or scripts that strip categories.
It may be that you have some sort of corruption, Dan, or simply more than one "Junk" category, one of which may not be visible.
Try
get name of every category
If you see Junk only once (bad news) try
get ID of category "Junk"
Then select a message with your "real" Junk category and do both
name of item 1 of (get category of (item 1 of (get selection)))
ID of item 1 of (get category of (item 1 of (get selection)))
Is the name "Junk"? Is the ID the same? If not, you've got corruption.
Or you're just not noticing a second Junk category. When you imported categories recently, you may have created second Junk category. Check the :Edit Categories" window to be sure.
On 8/10/02 8:56 PM, "George Clark" <[EMAIL PROTECTED]> wrote:
>On 8/10/02 22:47, Paul Berkowitz wrote:
>> Maybe you need to make the color for Junk category more distinctive.
>
> Or include 'Categories' as one of the columns in your message view.
I do both already :)
--
Paul Berkowitz
