Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Operating System
Looking for AppleScript help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="witeshark" data-source="post: 28084" data-attributes="member: 3865"><p><span style="color: darkred">Here is an example from the Applescript applications:</span></p><p><span style="color: darkred">using terms from application "Mail"</span></p><p><span style="color: darkred"> on perform mail action with messages theMessages for rule theRule</span></p><p><span style="color: darkred"> tell application "Mail"</span></p><p><span style="color: darkred"> set theText to "This AppleScript is intended to be used as an AppleScript rule action, but is also an example of how to write scripts that act on a selection of messages or mailboxes." & return & return & "To view this script, hold down the option key and select it again from the Scripts menu."</span></p><p><span style="color: darkred"> repeat with eachMessage in theMessages</span></p><p><span style="color: darkred"> set theSubject to subject of eachMessage</span></p><p><span style="color: darkred"> try</span></p><p><span style="color: darkred"> -- If this is not being executed as a rule action,</span></p><p><span style="color: darkred"> -- getting the name of theRule variable will fail.</span></p><p><span style="color: darkred"> set theRuleName to name of theRule</span></p><p><span style="color: darkred"> set theText to "The rule named '" & theRuleName & "' matched this message:"</span></p><p><span style="color: darkred"> set theText to theText & return & return & "Subject: " & theSubject</span></p><p><span style="color: darkred"> display dialog theText</span></p><p><span style="color: darkred"> set theText to ""</span></p><p><span style="color: darkred"> end try</span></p><p><span style="color: darkred"> end repeat</span></p><p><span style="color: darkred"> if theText is not equal to "" then</span></p><p><span style="color: darkred"> display dialog theText buttons {"OK"} default button 1</span></p><p><span style="color: darkred"> end if</span></p><p><span style="color: darkred"> end tell</span></p><p><span style="color: darkred"> end perform mail action with messages</span></p><p><span style="color: darkred">end using terms from</span></p><p><span style="color: darkred">You may well be able to use this one with some modifications</span> <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="witeshark, post: 28084, member: 3865"] [color=darkred]Here is an example from the Applescript applications: using terms from application "Mail" on perform mail action with messages theMessages for rule theRule tell application "Mail" set theText to "This AppleScript is intended to be used as an AppleScript rule action, but is also an example of how to write scripts that act on a selection of messages or mailboxes." & return & return & "To view this script, hold down the option key and select it again from the Scripts menu." repeat with eachMessage in theMessages set theSubject to subject of eachMessage try -- If this is not being executed as a rule action, -- getting the name of theRule variable will fail. set theRuleName to name of theRule set theText to "The rule named '" & theRuleName & "' matched this message:" set theText to theText & return & return & "Subject: " & theSubject display dialog theText set theText to "" end try end repeat if theText is not equal to "" then display dialog theText buttons {"OK"} default button 1 end if end tell end perform mail action with messages end using terms from You may well be able to use this one with some modifications[/color] :) [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
Apple Computing Products:
macOS - Operating System
Looking for AppleScript help
Top