tell application "Microsoft Entourage"
set curMsgs to current messages
repeat with theMsg in curMsgs
move theMsg to folder "Friends" in folder "Archive"
end repeat
end tell
:) |
Clarification of Answer by
alexander-ga
on
30 Oct 2002 09:33 PST
I should make that more lucid. I just couldn't resist such a clean and
concise answer. :)
I'm a professional Mac programmer, but truth be told, that's the first
AppleScript I've ever written. And it didn't take nearly as long as I
thought it would to figure out.
Why? Because I used a common approach to programming something one
doesn't know how to do: I looked for sample code.
Specifically, I downloaded two scripts from
http://www.applescriptcentral.com/ :
1) "Delete Junk Folder X":
http://www.applescriptcentral.com/ftpinwin.php?id=307
2) "File Reply in Same Folder X":
http://www.applescriptcentral.com/ftpinwin.php?id=348
The first contains code which gets a named folder:
set junkFolder to folder "Junk"
The second contains code which gets the selection:
set currMsgs to (current messages)
And code that moves messages:
move theMsg to theFolder
The syntax is easy enough to come up with thanks to AppleScript's
excellent syntax checking and highlighting. That, plus some
trial-and-error running of the script made it easy to narrow down the
commands to create a script that works.
Let me know if you have any questions, and thanks for the opportunity.
:)
|
Request for Answer Clarification by
eager2learn-ga
on
30 Oct 2002 17:47 PST
I'm grateful to you for giving this a whirl, but I'm getting an error
I can't quite understand. When it gets to the move command, it returns
the error: "Microsoft Entourage got an error: Can't get item 1 of
(incoming message id 44501)." Any ideas?
|
Clarification of Answer by
alexander-ga
on
30 Oct 2002 18:31 PST
I was able to reproduce that error when there was no Archive:Friends
folder. It works when there a folder called "Friends" inside a folder
called "Archive" within "On My Computer". If you're is set up slightly
differently, it should be obvious how to change the code. Also make
sure there are no misspellings. :)
|
Request for Answer Clarification by
eager2learn-ga
on
30 Oct 2002 18:59 PST
My stupid mistake. The folder's name was " friends" (I had added the
space to change the ordering of the folders. Sorry for the extra
trouble, and thanks for the elegant solution.
|
Clarification of Answer by
alexander-ga
on
30 Oct 2002 20:24 PST
No problem. Glad I could be of help. :)
|