New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Ľ Advice and insight from world-class Apple enthusiasts Ľ Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Apps and Games Discussion of applications and games available for Mac OS X.

An applescript to automagically mark message as "junk"


Post Reply New Thread Subscribe

 
Thread Tools
voiceofra

 
voiceofra's Avatar
 
Member Since: Mar 02, 2007
Location: St Helens, OR, USA
Posts: 250
voiceofra has a spectacular aura about
Mac Specs: MacBook CoreDuo 2Ghz 768M RAM

voiceofra is offline
While trying to help someone over on another mac forum (because nobody else was offering anything useful to the topic originator) , I wrote my first useful Applescript (up until now, I'd modified existing scripts or done VERY basic things with it) and thought others here might find it of use.
What he was looking for:
Quote:
"I have severals rules that detect Junk messages which are not caught by Mail.app built-in Junk filter. My rules move this to the Junk folder. However, Mail doesn't mark them as Junk (obviously, since I haven't found a way to tell Mail -> "Mark this as Junk"). This means I have to go to my Junk mailbox, and manually mark all these messages as Junk.

Any ideas on how to avoid doing this manually and tell Mail to mark something as Junk?

Thanks!
What I came up with:
Code:
tell application "Mail" to activate
tell application "System Events"
	keystroke "j" using {command down, shift down}
	
end tell
After your 'junk' rule criteria are met, this script will automagically "press" command-shift j - the Mail.app shortcut for selecting an item as junk mail.
Feel free to modify it, expand on it, etc.
QUOTE Thanks

Post Reply New Thread Subscribe


« Skype button for my mail signature | Mac getting older (poor thing) »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
[ANN] New comprehensive AppleScript book hanaan OS X - Development and Darwin 0 11-06-2004 07:28 PM
Looking for AppleScript help tommyabroad OS X - Operating System 2 04-14-2004 12:51 AM

All times are GMT -4. The time now is 03:53 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?