Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Help with script, please

 
   Mac (Home) -> Apple Scripts RSS
Next:  scripting Quicktime to convert images to jpg  
Author Message
Michelle Steiner

External


Since: Aug 30, 2005
Posts: 1352



(Msg. 1) Posted: Mon Jun 13, 2005 8:35 am
Post subject: Help with script, please
Imported from groups: alt>comp>lang>applescript (more info?)

This message is not archived
Back to top
Login to vote
Nigel Garvey

External


Since: Jun 14, 2005
Posts: 2



(Msg. 2) Posted: Tue Jun 14, 2005 2:27 am
Post subject: Re: Help with script, please [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <michelle-215C51.08350113062005.RemoveThis@news.west.cox.net>, Michelle
Steiner <michelle.RemoveThis@michelle.org> wrote:

> tell application "Mail"
...
> if not (mailbox folder_name exists) then
> make new mailbox at end of mailboxes with properties
> {name:folder_name}
> end if
> if not (exists (rule folder_name)) then
> set new_rule to make new rule at after rule 1 with properties
> {name:folder_name, move message:mailbox folder_name, stop evaluating
> rules:true}
> tell new_rule
> make new rule condition with properties {expression:address_,
> rule type:reply to, qualifier:does contain value, enabled:true}
> end tell
> end if
> end tell
>
> The problems are
> 1. It results in only the action to stop evaluating rules.
> 1a. If "stop evaluating rules:true" is removed from the script, the
> result is an action to move the message, but the mailbox is not
> specified. (This, BTW, is the default action, even if no actions are
> specified in the script.)
>
> 2. The rule type is "from" instead of "reply to"
> 3. The rule is not enabled.

Hi, Michelle. According to Mail 2.0.1's dictionary:

i) It's the rule that should have the 'enabled' property, not the rule
condition.
ii) Although 'reply to' compiles, it's not listed as one of the
possible rule types. 'From' is probably the closest alternative.
iii) The 'move message' thing seems to be enabled by setting the rule's
'should move message' to true.
iv) The rule apparently can't be enabled until the rule condition's in
place, so:

if not (exists (rule folder_name)) then
set new_rule to (make new rule at after rule 1 with properties
{name:folder_name, move message:mailbox folder_name, should move
message:true, stop evaluating rules:true})
tell new_rule
make new rule condition with properties {expression:address_,
rule type:from, qualifier:does contain value}
set enabled to true
end tell
end if

I'm not a Mail user myself, but I've tested this and it works in Tiger.

NG

--
To e-mail me, change '.invalid' to '.demon.co.uk'.
Back to top
Login to vote
Michelle Steiner

External


Since: Aug 30, 2005
Posts: 1352



(Msg. 3) Posted: Tue Jun 14, 2005 11:03 am
Post subject: Re: Help with script, please [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

This message is not archived
Back to top
Login to vote
Nigel Garvey

External


Since: Jun 14, 2005
Posts: 2



(Msg. 4) Posted: Tue Jun 14, 2005 12:15 pm
Post subject: Re: Help with script, please [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <140620050227203888%NigelGarvey@elevenfour.invalid>, Nigel
Garvey <NigelGarvey.TakeThisOut@elevenfour.invalid> wrote:

> Hi, Michelle. According to Mail 2.0.1's dictionary:
>
> i) It's the rule that should have the 'enabled' property, not the rule
> condition.
> ii) Although 'reply to' compiles, it's not listed as one of the
> possible rule types. 'From' is probably the closest alternative.
> iii) The 'move message' thing seems to be enabled by setting the rule's
> 'should move message' to true.
> iv) The rule apparently can't be enabled until the rule condition's in
> place, so:

Bad editing. Sorry. Smile

i) and ii) were gleaned from the dictionary; iii) and iv) were hunches.

> if not (exists (rule folder_name)) then
> set new_rule to (make new rule at after rule 1 with properties
> {name:folder_name, move message:mailbox folder_name, should move
> message:true, stop evaluating rules:true})
> tell new_rule
> make new rule condition with properties {expression:address_,
> rule type:from, qualifier:does contain value}

Should be:

make new rule condition with properties {expression:address_,
rule type:from header, qualifier:does contain value}

> set enabled to true
> end tell
> end if

NG

--
To e-mail me, change '.invalid' to '.demon.co.uk'.
Back to top
Login to vote
Michelle Steiner

External


Since: Aug 30, 2005
Posts: 1352



(Msg. 5) Posted: Tue Jun 14, 2005 12:15 pm
Post subject: Re: Help with script, please [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

This message is not archived
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Why this script doesn't work ? - The script: tell application "Finder" activate repeat set w to display dialog "salary?" default answer "2000" set wSal to text returned of w display dialog wSa...

Help with System Preferences script - From an obvious novice: I'd like to have a script for my wife that will 1.open the display preferences and 2.select a certain screen resolution and colors ( i.e. 256/thousands/millions). I can get as far as opening the preferences pane but I can't....

"Insert" script for BBEdit 7.1 - Hello, I want to write a script for BBEdit 7.1 using the command "insert" from the "edit" menu. The purpose is to insert selected files in one open file. But when recording from the "record" menu doesn't give any result. Lo...

Excel Script help needed - Hello, Let me preface this with the statement that I am not that familiar with Macs, I have 20 years experiance with PC's Servers, Unix etc, but not Mac. I do have a somewhat urgent need and hope somebody can help me, I can even pay if that is what i...

Backup script wanted. - Be nice to have a clickable icon on desktop to automate copying a set of files to a disk. For example, to back up Mail messages, and other things, you dive into the Library and grabs things and copy to a USB disk or whatever, could there be a simple..
       Mac (Home) -> Apple Scripts All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
 Linux Forums
  Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact