![]() |
Guys,
I'm sorry to butt in, and also if I'm off the thread a little (but this is a very long thread with a lot of code flying around :) ) but in Panther you can select a box so: Code:
property mailbox_to_select : "Add name of mailbox here" |
Quote:
weve actually solved my original problem in spades, but it threw up other things :D your code gives the following from applescript Code:
tell application "Mail"and to be honest ive never seen that term used in applescript for jaguar ive also tried various combinations of and variations on the theme but mail always kicks back an error but thx for trying :) |
My point really is that Mail 1.3.9 has the means to select a mailbox, and I don't know when Mail acquired this function. You could check to see if there's a property "selected mailboxes" in the application or viewer class in the Mail AS Dictionary for the version you have.
The same script without 'as reference' works on my machine - can't remember why it was in the script that snip of code came from. |
invoke a message
Quote:
[/code] tell application "Mail" perform mail action with messages of account "roncross@cox.net" check for new mail end tell -- I haven't tried this code so not sure if it will work. However, there are ton -- of information. Check macosxhints and the other forum for an idea on how this works. [code] You can then open up mail preferences, go to rules. Click on Add rules. Give it a description and fill out the text field part. Notice, where it says Perform the following actions. Click on this and there will be a section that says run applescript. Click on that and select the applescript that you want. It will be invoke, the next time the rule apples to your case. Quote:
|
Quote:
Code:
tell application "Mail"the as dictionary does have "selected mailboxes" but the error is occuring in the line before clive |
hi Ron
Quote:
im guessing that it depends on what you save an applescript as, not how i add a rule to the rules section. are you trying to tell me that you can save any kind of applescript in panther and it will run regardless, as long as the rules are met ? Quote:
i have non applescript stuff that is much more urgent. so i dont mind trying to solve this on this board and at the speed of email rather than instantly with prefab. you should have all the UI info in the previous posts, im assuming you want the deepest level UI info, the one where you do the clicking or whatever, so here it is Code:
<AXApplication: “Mail”> |
Bingo, Success!!!
Code:
tell application "Mail"i could not have done this without you warmest regards clive :D now i just got to get applescript to automate within mail :p |
Quote:
as long as your rules work, this script should be activated just make sure you set the right path to the applescript you actually want to run Code:
on perform_mail_action(info) |
Running applescript with rules
Quote:
Here is what the help section says about rules in Panther. I have used it and I am able to get it to work. However, I am not sure how this works in Jaquar. Go to mail help and type applescript rules and it may explain to you how it work.... Mail Help in Panther when searching Rule and Applescript Mail offers a wide range of actions that can be triggered when an email message meets the conditions in a rule. An example of a simple rule is one that plays a sound if a message is received with a subject that contains a certain word. Other actions that you can set up include moving or copying messages, bouncing the Mail icon in the Dock, and replying to the message. Sometimes you may need additional flexibility when creating rule actions, or may want to interact with other applications that have AppleScript capabilities. You can use AppleScript rule actions to enable actions by other applications and also to increase the flexibility of the actions that already exist. For example, you could have an incoming message trigger a script that gathers information from the message and enters it into an AppleScript-aware database. Or, you could reply to messages with a custom-tailored message using data gathered from another AppleScript-aware application. After you've written an AppleScript, compiled it, and saved it, you can attach it to a rule. To see an example script and create your own script: Press the Option key and choose Scripts > Sample Rule Action Script. The "Sample Rule Action Script" opens in Script Editor. Near the top you'll see a description of the script. When executed, the script displays a dialog showing the name of the rule being executed, and the subject of the message that triggered the rule. Modify this script to suit your needs, or create a new script. Save it in the following location: Applications/AppleScript/Example Scripts/Mail Scripts. Click the Run button at the top of the window to run your script. Click Next for information on attaching your AppleScript to a rule action. Attaching an AppleScript to a rule action In the previous step, you wrote an AppleScript to use for a rule action. In this step, you attach the script to a rule. To attach the script to a rule: Open Mail, choose Mail > Preferences, and click Rules. Click Add Rule or edit an existing rule. Choose conditions from the pop-up menus. Use the Add (+) button to add conditions. Choose Run AppleScript from the "Perform the following actions" pop-up menu. Click Choose and locate your saved script in the dialog that appears. In the previous step, you saved your script in the following location: Applications/AppleScript/Example Scripts/Mail Scripts. Click Choose File. Click OK to save your rule. If you move your script from the location where you saved it, or if you rename it, your rule will stop working. If you want to move or rename the script, modify the rule to reflect the new location. Here's how rule actions work "behind the scenes": When Mail invokes an AppleScript as a rule action, it looks for a handler named "perform mail action with messages," which receives a list of messages as its direct object, with an optional parameter that specifies the rule being executed. Once you have the rule object and the list of messages, you can access all the properties that are shown in Mail's AppleScript dictionary for these objects. For more information on AppleScript, see www.apple.com/applescript. Open the Script Editor application (in Applications/AppleScript) to see example scripts in various applications, including Mail. Go to the website thx RLC |
Quote:
i dont know what it works either, but it does, and thats the most important thing thx for the info clive |
| All times are GMT -5. The time now is 05:46 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.