Using a Mail rule to run an AppleScript

I've been trying to get a Mail rule to run a very simple AppleScript on 10.5.3 and it just doesn't work, period.
I've tried making everything as simple as possible:
1. My Mail rule sets the background color of a message and runs the AppleScript if the subject contains "test".
2. The AppleScript displays a Finder alert.
[(screenshot)|http://i26.tinypic.com/nqxou8.png]
Naturally, the script runs fine within the Script Editor. I also know that the rule works since the background color action gets applied.
But, the AppeScript never runs when I apply the rule to a message manually or when it gets automatically applied to new messages. I really can't imagine where I'm going wrong here...

You can't simply feed it some arbitrary script to execute, you have to write a handler that Mail can dispatch events to. This generally looks something like
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with suspectMessage in theMessages
--do something
end repeat
end tell
end perform mail action with messages
end using terms from

Similar Messages

  • Mail rules have stopped executing applescripts

    I have 3 mail rules that run different applescripts to process mail into other apps (omnifocus and yojimbo). Sometime in the last few days, these rules stopped processing the apple scripts. I know the issue is not the scripts themselves, because I can execute them manually just fine.
    I'm not sure why they have stopped working, but there are two changes that have happened on my computer that I think might have created the issue:
    1) I installed the Safari 4.0 beta
    2) I began syncing mail rules with another machine. (This created duplicate rules, but I have deleted them.)
    Anyone have any ideas what might be causing my issue?

    you can submit a bug report here:
    https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa/wa/signIn
    You will need ADC membership to do so. it's free and you can use your existing apple id to get it.

  • Mail crashes when executing a rule that runs an applescript

    I have set up a rule in mail that when executed runs an apple script. Most of the time it crashes mail, but occasionally runs completely or just partially. Doesn't matter what the apple script is, most of the time it will just crash. I've done a clean install of OS X, so the system is in pristeen condition.
    The rule says if an message is from the specified sender then to execute the applescript. I invoke the rule by right clicking on a message from the sender and selecting the 'apply rules' menu item, or when a new message from the sender arrives in the mail box.
    Here's the applescript (a edited version of one of the scripts that was included from Apple)
    using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
    tell application "Mail"
    repeat with eachMessage in theMessages
    set theSubject to subject of eachMessage
    set theSender to sender of eachMessage
    set theText to "Sender:" & theSender & return & "Subject: " & theSubject
    display dialog theText
    end repeat
    end tell
    end perform mail action with messages
    end using terms from
    Here's the crash report (copied from the 'Problem Report for Mail' window)
    Date/Time: 2007-04-03 23:14:41.074 -0500
    OS Version: 10.4.9 (Build 8P135)
    Report Version: 4
    Command: Mail
    Path: /Applications/Mail.app/Contents/MacOS/Mail
    Parent: WindowServer [60]
    Version: 2.1 (752)
    Build Version: 22
    Project Name: MailViewer
    Source Version: 7520000
    PID: 280
    Thread: 0
    Exception: EXCBADACCESS (0x0001)
    Codes: KERNPROTECTIONFAILURE (0x0002) at 0x0000002a
    Thread 0 Crashed:
    0 libRIP.A.dylib 0x947d154c RIPLayerIntersect + 40
    1 libRIP.A.dylib 0x947cbb40 ripc_GetClipState + 2112
    2 libRIP.A.dylib 0x947cb08c ripc_GetRenderingState + 204
    3 libRIP.A.dylib 0x947ca1a4 ripc_DrawImage + 152
    4 com.apple.CoreGraphics 0x903d4064 CGContextDelegateDrawImage + 76
    5 com.apple.CoreGraphics 0x903d3fbc CGContextDrawImage + 340
    6 com.apple.HIToolbox 0x932c6ea0 _ThemeImageDrawMultiple + 1412
    7 com.apple.HIToolbox 0x93375128 HIThemeDrawButtonPulsed(CGRect const*, ThemeImageDrawInfo*, unsigned long, HIThemeButtonDrawInfo const*, CGContext*) + 404
    8 com.apple.HIToolbox 0x93360ba8 HIThemeDrawButtonInternal(CGRect const*, HIThemeButtonDrawInfo const*, HIThemeButtonDrawInfo const*, ThemeEraseXUPP*, ThemeButtonDrawXUPP*, unsigned long, CGContext*, unsigned long, CGRect*) + 12264
    9 com.apple.HIToolbox 0x9335dbb0 HIThemeDrawButton + 44
    10 com.apple.HIToolbox 0x933712d0 HIPushButton::DrawSelf(short, __HIShape const*, CGContext*) + 412
    11 com.apple.HIToolbox 0x932c26dc HIView::DrawCacheOrSelf(short, __HIShape const*, CGContext*) + 328
    12 com.apple.HIToolbox 0x932c2438 HIView::SendDraw(short, OpaqueGrafPtr*, __HIShape const*, CGContext*) + 100
    13 com.apple.HIToolbox 0x93370fc4 HIView::RecursiveDrawNonComposited(short, OpaqueGrafPtr*, OpaqueRgnHandle*, unsigned char, unsigned char, unsigned char) + 468
    14 com.apple.HIToolbox 0x933706e4 HIView::DrawNonComposited(short, OpaqueGrafPtr*, OpaqueRgnHandle*, unsigned long) + 312
    15 com.apple.HIToolbox 0x93379440 Draw1Control + 68
    16 com.apple.HIToolbox 0x93455698 HIPushButton::Animate() + 428
    17 com.apple.HIToolbox 0x934314e8 HIStandardAnimator::TimerProc(__EventLoopTimer*, void*) + 72
    18 com.apple.CoreFoundation 0x907f2578 __CFRunLoopDoTimer + 184
    19 com.apple.CoreFoundation 0x907deef8 __CFRunLoopRun + 1680
    20 com.apple.CoreFoundation 0x907de4ac CFRunLoopRunSpecific + 268
    21 com.apple.HIToolbox 0x93298b20 RunCurrentEventLoopInMode + 264
    22 com.apple.HIToolbox 0x932981b4 ReceiveNextEventCommon + 380
    23 com.apple.HIToolbox 0x93298020 BlockUntilNextEventMatchingListInMode + 96
    24 com.apple.AppKit 0x9377dae4 _DPSNextEvent + 384
    25 com.apple.AppKit 0x9377d7a8 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 116
    26 com.apple.AppKit 0x93779cec -[NSApplication run] + 472
    27 com.apple.AppKit 0x9386a87c NSApplicationMain + 452
    28 com.apple.mail 0x000871d8 0x1000 + 549336
    29 com.apple.mail 0x00087080 0x1000 + 548992
    Thread 1:
    0 libSystem.B.dylib 0x9004a828 syscallthreadswitch + 8
    1 com.apple.Foundation 0x92bf95dc +[NSThread sleepUntilDate:] + 152
    2 com.apple.AppKit 0x9381aa10 -[NSUIHeartBeat _heartBeatThread:] + 1100
    3 com.apple.Foundation 0x92be11a0 forkThreadForFunction + 108
    4 libSystem.B.dylib 0x9002be88 pthreadbody + 96
    Thread 2:
    0 libSystem.B.dylib 0x9000b4c8 machmsgtrap + 8
    1 libSystem.B.dylib 0x9000b41c mach_msg + 60
    2 com.apple.CoreFoundation 0x907deba8 __CFRunLoopRun + 832
    3 com.apple.CoreFoundation 0x907de4ac CFRunLoopRunSpecific + 268
    4 com.apple.Foundation 0x92bf0170 -[NSRunLoop runMode:beforeDate:] + 172
    5 com.apple.Foundation 0x92bf00a8 -[NSRunLoop run] + 76
    6 com.apple.MessageFramework 0x9a25c198 +[_NSSocket _runIOThread] + 92
    7 com.apple.Foundation 0x92be11a0 forkThreadForFunction + 108
    8 libSystem.B.dylib 0x9002be88 pthreadbody + 96
    Thread 3:
    0 libSystem.B.dylib 0x9001fa0c select + 12
    1 com.apple.CoreFoundation 0x907f1434 __CFSocketManager + 472
    2 libSystem.B.dylib 0x9002be88 pthreadbody + 96
    Thread 4:
    0 libSystem.B.dylib 0x9002f20c kevent + 12
    1 com.apple.DesktopServices 0x92af4eb0 TFSNotificationTask::FSNotificationTaskProc(void*) + 56
    2 ...ple.CoreServices.CarbonCore 0x90bc683c PrivateMPEntryPoint + 76
    3 libSystem.B.dylib 0x9002be88 pthreadbody + 96
    Thread 5:
    0 libSystem.B.dylib 0x9002c548 semaphorewait_signaltrap + 8
    1 libSystem.B.dylib 0x9003102c pthreadcondwait + 480
    2 ...ple.CoreServices.CarbonCore 0x90bc6a2c MPWaitOnQueue + 224
    3 com.apple.DesktopServices 0x92af552c TNodeSyncTask::SyncTaskProc(void*) + 116
    4 ...ple.CoreServices.CarbonCore 0x90bc683c PrivateMPEntryPoint + 76
    5 libSystem.B.dylib 0x9002be88 pthreadbody + 96
    Thread 6:
    0 libSystem.B.dylib 0x90055468 semaphoretimedwait_signaltrap + 8
    1 libSystem.B.dylib 0x900552c4 pthreadcondtimedwait + 676
    2 com.apple.Foundation 0x92c605d4 FCONDITION_WAITTIMEOUT + 144
    3 com.apple.Foundation 0x92c604f0 -[NSConditionLock lockWhenCondition:beforeDate:] + 128
    4 com.apple.MessageFramework 0x9a257d90 -[InvocationQueue _drainQueue] + 176
    5 com.apple.Foundation 0x92be11a0 forkThreadForFunction + 108
    6 libSystem.B.dylib 0x9002be88 pthreadbody + 96
    Thread 7:
    0 libSystem.B.dylib 0x90055468 semaphoretimedwait_signaltrap + 8
    1 libSystem.B.dylib 0x900552c4 pthreadcondtimedwait + 676
    2 com.apple.Foundation 0x92c605d4 FCONDITION_WAITTIMEOUT + 144
    3 com.apple.Foundation 0x92c604f0 -[NSConditionLock lockWhenCondition:beforeDate:] + 128
    4 com.apple.MessageFramework 0x9a257d90 -[InvocationQueue _drainQueue] + 176
    5 com.apple.Foundation 0x92be11a0 forkThreadForFunction + 108
    6 libSystem.B.dylib 0x9002be88 pthreadbody + 96
    Thread 8:
    0 libSystem.B.dylib 0x90055468 semaphoretimedwait_signaltrap + 8
    1 libSystem.B.dylib 0x900552c4 pthreadcondtimedwait + 676
    2 com.apple.Foundation 0x92c605d4 FCONDITION_WAITTIMEOUT + 144
    3 com.apple.Foundation 0x92c604f0 -[NSConditionLock lockWhenCondition:beforeDate:] + 128
    4 com.apple.MessageFramework 0x9a257d90 -[InvocationQueue _drainQueue] + 176
    5 com.apple.Foundation 0x92be11a0 forkThreadForFunction + 108
    6 libSystem.B.dylib 0x9002be88 pthreadbody + 96
    Thread 9:
    0 libSystem.B.dylib 0x9000b4c8 machmsgtrap + 8
    1 libSystem.B.dylib 0x9000b41c mach_msg + 60
    2 com.apple.CoreFoundation 0x907deba8 __CFRunLoopRun + 832
    3 com.apple.CoreFoundation 0x907de4ac CFRunLoopRunSpecific + 268
    4 com.apple.HIToolbox 0x93298b20 RunCurrentEventLoopInMode + 264
    5 com.apple.HIToolbox 0x932981b4 ReceiveNextEventCommon + 380
    6 com.apple.HIToolbox 0x932dd348 AcquireNextEventInMode + 72
    7 com.apple.HIToolbox 0x9348e278 _RunAppModalLoop + 96
    8 ...pple.osax.standardadditions 0x05d1bfec dyldstub__keymgr_get_and_lock_processwideptr + 97418156
    9 com.apple.AE 0x914ff960 aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned char*) + 208
    10 com.apple.AE 0x9150afc0 sendToSelf(AEDesc const*, AEDesc*, long, long) + 372
    11 com.apple.AE 0x915038f8 AESendMessage + 648
    12 com.apple.AE 0x915033d4 aeSend + 224
    13 com.apple.HIToolbox 0x933468c8 AESend + 108
    14 com.apple.applescript 0x9898ed60 AEDefaultSendProc(AEDesc const*, AEDesc*, long, short, long, unsigned char ()(EventRecord, long*, OpaqueRgnHandle**), unsigned char ()(EventRecord, long, long, AEDesc const*), long) + 16
    15 com.apple.openscripting 0x930d5c5c InvokeOSASendUPP + 24
    16 com.apple.applescript 0x9898ed2c ComponentSend(AEDesc const*, AEDesc*, long, long) + 112
    17 com.apple.applescript 0x989cb708 TUASApplication::Send(TStackFrame_UASRemoteSend*, AEDesc*, AEDesc*, unsigned char, unsigned char, unsigned char) + 1424
    18 com.apple.applescript 0x989edfd8 UASRemoteSend(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char*) + 368
    19 com.apple.applescript 0x989fe354 UASValue_Send(unsigned char, unsigned char, TUASClassIndex, unsigned char) + 352
    20 com.apple.applescript 0x989cf910 UASExecute1() + 328
    21 com.apple.applescript 0x989b18c8 ASExecuteEvent(AEDesc const*, unsigned long, long, unsigned long*) + 900
    22 ...ple.CoreServices.CarbonCore 0x90bdf11c CallComponentFunctionCommon + 1112
    23 com.apple.applescript 0x98985418 AppleScriptComponent + 1712
    24 ...ple.CoreServices.CarbonCore 0x90bdec60 CallComponent + 260
    25 com.apple.applescript 0x98984694 AGenericManager::HandleOSACall(ComponentParameters*) + 72
    26 com.apple.applescript 0x989842e4 GenericComponent + 216
    27 ...ple.CoreServices.CarbonCore 0x90bdec60 CallComponent + 260
    28 com.apple.openscripting 0x930ea878 OSAExecuteEvent + 52
    29 com.apple.Foundation 0x92cdd9dc -[NSAppleScript(NSPrivate) _executeAppleEvent:withMode:error:] + 164
    30 com.apple.MessageFramework 0x9a31fdb0 -[NSAppleScript(MessageRuleAdditions) executeHandlerWithEventClass:eventID:andArguments:error:] + 596
    31 com.apple.MessageFramework 0x9a31f8e0 +[NSAppleScript(MessageRuleAdditions) executeHandlerWithEventClass:eventID:inScriptAtPath:withArguments:error:] + 112
    32 com.apple.MessageFramework 0x9a2d2be4 -[MessageRule _performAppleScriptActionWithMessages:] + 264
    33 com.apple.MessageFramework 0x9a2c178c -[MessageRule performActionsOnMessages:destinationStores:rejectedMessages:messagesToBeDeleted :] + 172
    34 com.apple.MessageFramework 0x9a2c15f0 _routeMessagesInDictionary + 168
    35 com.apple.MessageFramework 0x9a2c0b58 -[MessageRouter routeMessages:fromStores:] + 1660
    36 com.apple.mail 0x000eeedc 0x1000 + 974556
    37 libobjc.A.dylib 0x90a461f4 objc_msgSendv + 180
    38 com.apple.Foundation 0x92bdcc94 -[NSInvocation invoke] + 944
    39 com.apple.MessageFramework 0x9a24e800 -[MonitoredInvocation invoke] + 144
    40 com.apple.MessageFramework 0x9a24e67c +[WorkerThread _execute:] + 76
    41 com.apple.Foundation 0x92be11a0 forkThreadForFunction + 108
    42 libSystem.B.dylib 0x9002be88 pthreadbody + 96
    Thread 10:
    0 libSystem.B.dylib 0x90055468 semaphoretimedwait_signaltrap + 8
    1 libSystem.B.dylib 0x90071be8 pthreadcond_timedwait_relativenp + 556
    2 ...apple.AddressBook.framework 0x94dcdcac -[ABRemoteImageLoader workLoop] + 132
    3 com.apple.Foundation 0x92be11a0 forkThreadForFunction + 108
    4 libSystem.B.dylib 0x9002be88 pthreadbody + 96
    Thread 0 crashed with PPC Thread State 64:
    srr0: 0x00000000947d154c srr1: 0x000000000200f030 vrsave: 0x0000000000000000
    cr: 0x44482224 xer: 0x0000000000000004 lr: 0x00000000947d1530 ctr: 0x0000000000000000
    r0: 0x00000000947cbb40 r1: 0x00000000bfffdac0 r2: 0x0000000000000000 r3: 0x0000000005e136d0
    r4: 0x000000000000002a r5: 0x0000000000000010 r6: 0x0000000000000006 r7: 0x0000000000000000
    r8: 0x0000000000000001 r9: 0x0000000005e136d0 r10: 0x0000000005f0026d r11: 0x0000000028482222
    r12: 0x000000009012a680 r13: 0x0000000005e12c50 r14: 0x00000000bfffe720 r15: 0x0000000005e13680
    r16: 0x0000000005e13900 r17: 0x0000000000000000 r18: 0x0000000000000000 r19: 0x00000000bfffdb50
    r20: 0x0000000005e13900 r21: 0x00000000052fb230 r22: 0x0000000005e14770 r23: 0x0000000000000001
    r24: 0x0000000005e136e4 r25: 0x0000000000000000 r26: 0x0000000000000000 r27: 0x0000000005e12cb0
    r28: 0x0000000000000000 r29: 0x0000000005e136d0 r30: 0x0000000005e136d0 r31: 0x00000000947d1530
    Binary Images Description:
    0x1000 - 0x199fff com.apple.mail 2.1 (752) /Applications/Mail.app/Contents/MacOS/Mail
    0x5565000 - 0x5578fff com.apple.Mail.Syncer 1.1 (752.2) /System/Library/Frameworks/Message.framework/Versions/B/Resources/Syncer.syncsc hema/Contents/MacOS/Syncer
    0x5c5e000 - 0x5c60fff com.apple.AutomatorCMM 1.0 (48) /System/Library/Contextual Menu Items/AutomatorCMM.plugin/Contents/MacOS/AutomatorCMM
    0x5c63000 - 0x5c67fff com.apple.FolderActionsMenu 1.3 /System/Library/Contextual Menu Items/FolderActionsMenu.plugin/Contents/MacOS/FolderActionsMenu
    0x5c73000 - 0x5c73fff com.apple.SpotLightCM 1.0 (121.36) /System/Library/Contextual Menu Items/SpotlightCM.plugin/Contents/MacOS/SpotlightCM
    0x5c85000 - 0x5c85fff com.apple.applescript.component 1.10.7 /System/Library/Components/AppleScript.component/Contents/MacOS/AppleScript
    0x5ca0000 - 0x5ca0fff com.apple.osax.digihub 1.0 /System/Library/ScriptingAdditions/Digital Hub Scripting.osax/Contents/MacOS/Digital Hub Scripting
    0x5d0c000 - 0x5d49fff com.apple.osax.standardadditions 1.10.7 (???) /System/Library/ScriptingAdditions/StandardAdditions.osax/Contents/MacOS/Standa rdAdditions
    0x8fe00000 - 0x8fe52fff dyld 46.12 /usr/lib/dyld
    0x90000000 - 0x901bdfff libSystem.B.dylib /usr/lib/libSystem.B.dylib
    0x90215000 - 0x9021afff libmathCommon.A.dylib /usr/lib/system/libmathCommon.A.dylib
    0x9021c000 - 0x90269fff com.apple.CoreText 1.0.3 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreText.framework/Versions/A/CoreText
    0x90294000 - 0x90345fff ATS /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ATS.framework/Versions/A/ATS
    0x90374000 - 0x9072ffff com.apple.CoreGraphics 1.258.61 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/CoreGraphics
    0x907bc000 - 0x90895fff com.apple.CoreFoundation 6.4.7 (368.28) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x908de000 - 0x908defff com.apple.CoreServices 10.4 (???) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    0x908e0000 - 0x909e2fff libicucore.A.dylib /usr/lib/libicucore.A.dylib
    0x90a3c000 - 0x90ac0fff libobjc.A.dylib /usr/lib/libobjc.A.dylib
    0x90aea000 - 0x90b5cfff com.apple.framework.IOKit 1.4 (???) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x90b72000 - 0x90b84fff libauto.dylib /usr/lib/libauto.dylib
    0x90b8b000 - 0x90e62fff com.apple.CoreServices.CarbonCore 681.9 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonC ore.framework/Versions/A/CarbonCore
    0x90ec8000 - 0x90f48fff com.apple.CoreServices.OSServices 4.1 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServi ces.framework/Versions/A/OSServices
    0x90f92000 - 0x90fd3fff com.apple.CFNetwork 4.0 (129.20) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwo rk.framework/Versions/A/CFNetwork
    0x90fe8000 - 0x91000fff com.apple.WebServices 1.1.2 (1.1.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/WebServ icesCore.framework/Versions/A/WebServicesCore
    0x91010000 - 0x91091fff com.apple.SearchKit 1.0.5 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchK it.framework/Versions/A/SearchKit
    0x910d7000 - 0x91100fff com.apple.Metadata 10.4.4 (121.36) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadat a.framework/Versions/A/Metadata
    0x91111000 - 0x9111ffff libz.1.dylib /usr/lib/libz.1.dylib
    0x91122000 - 0x912ddfff com.apple.security 4.6 (29770) /System/Library/Frameworks/Security.framework/Versions/A/Security
    0x913dc000 - 0x913e5fff com.apple.DiskArbitration 2.1 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
    0x913ec000 - 0x91414fff com.apple.SystemConfiguration 1.8.3 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfi guration
    0x91427000 - 0x91432fff libgcc_s.1.dylib /usr/lib/libgcc_s.1.dylib
    0x91437000 - 0x9143ffff libbsm.dylib /usr/lib/libbsm.dylib
    0x91443000 - 0x914befff com.apple.audio.CoreAudio 3.0.4 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
    0x914fb000 - 0x914fbfff com.apple.ApplicationServices 10.4 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Application Services
    0x914fd000 - 0x91535fff com.apple.AE 1.5 (297) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ AE.framework/Versions/A/AE
    0x91550000 - 0x91622fff com.apple.ColorSync 4.4.9 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ColorSync.framework/Versions/A/ColorSync
    0x91675000 - 0x91706fff com.apple.print.framework.PrintCore 4.6 (177.13) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ PrintCore.framework/Versions/A/PrintCore
    0x9174d000 - 0x91804fff com.apple.QD 3.10.24 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ QD.framework/Versions/A/QD
    0x91841000 - 0x9189ffff com.apple.HIServices 1.5.3 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ HIServices.framework/Versions/A/HIServices
    0x918ce000 - 0x918effff com.apple.LangAnalysis 1.6.1 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ LangAnalysis.framework/Versions/A/LangAnalysis
    0x91903000 - 0x91928fff com.apple.FindByContent 1.5 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ FindByContent.framework/Versions/A/FindByContent
    0x9193b000 - 0x9197dfff com.apple.LaunchServices 182 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ LaunchServices.framework/Versions/A/LaunchServices
    0x91999000 - 0x919adfff com.apple.speech.synthesis.framework 3.3 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ SpeechSynthesis.framework/Versions/A/SpeechSynthesis
    0x919bb000 - 0x91a01fff com.apple.ImageIO.framework 1.5.4 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/ImageIO
    0x91a18000 - 0x91adffff libcrypto.0.9.7.dylib /usr/lib/libcrypto.0.9.7.dylib
    0x91b2d000 - 0x91b42fff libcups.2.dylib /usr/lib/libcups.2.dylib
    0x91b47000 - 0x91b65fff libJPEG.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libJPEG.dylib
    0x91b6b000 - 0x91c22fff libJP2.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libJP2.dylib
    0x91c71000 - 0x91c75fff libGIF.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libGIF.dylib
    0x91c77000 - 0x91cdffff libRaw.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libRaw.dylib
    0x91ce4000 - 0x91d21fff libTIFF.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libTIFF.dylib
    0x91d28000 - 0x91d41fff libPng.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libPng.dylib
    0x91d46000 - 0x91d49fff libRadiance.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libRadiance.dylib
    0x91d4b000 - 0x91e29fff libxml2.2.dylib /usr/lib/libxml2.2.dylib
    0x91e49000 - 0x91e49fff com.apple.Accelerate 1.2.2 (Accelerate 1.2.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
    0x91e4b000 - 0x91f30fff com.apple.vImage 2.4 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.fr amework/Versions/A/vImage
    0x91f38000 - 0x91f57fff com.apple.Accelerate.vecLib 3.2.2 (vecLib 3.2.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/vecLib
    0x91fc3000 - 0x92031fff libvMisc.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libvMisc.dylib
    0x9203c000 - 0x920d1fff libvDSP.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libvDSP.dylib
    0x920eb000 - 0x92673fff libBLAS.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libBLAS.dylib
    0x926a6000 - 0x929d1fff libLAPACK.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libLAPACK.dylib
    0x92a01000 - 0x92aeffff libiconv.2.dylib /usr/lib/libiconv.2.dylib
    0x92af2000 - 0x92b7afff com.apple.DesktopServices 1.3.6 /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/Desk topServicesPriv
    0x92bbb000 - 0x92de6fff com.apple.Foundation 6.4.8 (567.29) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x92f04000 - 0x92f0efff com.apple.framework.AppleTalk 1.2.0 (???) /System/Library/Frameworks/AppleTalk.framework/Versions/A/AppleTalk
    0x92f13000 - 0x92f31fff libGL.dylib /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
    0x92f3c000 - 0x92f96fff libGLU.dylib /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
    0x92fb4000 - 0x92fb4fff com.apple.Carbon 10.4 (???) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
    0x92fb6000 - 0x92fcafff com.apple.ImageCapture 3.0 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture. framework/Versions/A/ImageCapture
    0x92fe2000 - 0x92ff2fff com.apple.speech.recognition.framework 3.4 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecogni tion.framework/Versions/A/SpeechRecognition
    0x92ffe000 - 0x93013fff com.apple.securityhi 2.0 (203) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.fr amework/Versions/A/SecurityHI
    0x93025000 - 0x930acfff com.apple.ink.framework 101.2 (69) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework /Versions/A/Ink
    0x930c0000 - 0x930cbfff com.apple.help 1.0.3 (32) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framewor k/Versions/A/Help
    0x930d5000 - 0x93102fff com.apple.openscripting 1.2.5 (???) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting .framework/Versions/A/OpenScripting
    0x9311c000 - 0x9312bfff com.apple.print.framework.Print 5.2 (192.4) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framewo rk/Versions/A/Print
    0x93137000 - 0x9319dfff com.apple.htmlrendering 1.1.2 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering .framework/Versions/A/HTMLRendering
    0x931ce000 - 0x9321dfff com.apple.NavigationServices 3.4.4 (3.4.3) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationSer vices.framework/Versions/A/NavigationServices
    0x9324b000 - 0x93268fff com.apple.audio.SoundManager 3.9 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.f ramework/Versions/A/CarbonSound
    0x9327a000 - 0x93287fff com.apple.CommonPanels 1.2.2 (73) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels. framework/Versions/A/CommonPanels
    0x93290000 - 0x9359efff com.apple.HIToolbox 1.4.9 (???) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.fra mework/Versions/A/HIToolbox
    0x936ee000 - 0x936fafff com.apple.opengl 1.4.7 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
    0x936ff000 - 0x9371ffff com.apple.DirectoryService.Framework 3.3 /System/Library/Frameworks/DirectoryService.framework/Versions/A/DirectoryServi ce
    0x93773000 - 0x93773fff com.apple.Cocoa 6.4 (???) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
    0x93775000 - 0x93da8fff com.apple.AppKit 6.4.7 (824.41) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
    0x94135000 - 0x941a7fff com.apple.CoreData 91 (92.1) /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
    0x941e0000 - 0x942a4fff com.apple.audio.toolbox.AudioToolbox 1.4.5 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
    0x942f6000 - 0x942f6fff com.apple.audio.units.AudioUnit 1.4 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
    0x942f8000 - 0x944b8fff com.apple.QuartzCore 1.4.12 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
    0x94502000 - 0x9453ffff libsqlite3.0.dylib /usr/lib/libsqlite3.0.dylib
    0x94547000 - 0x94597fff libGLImage.dylib /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dyl ib
    0x945a0000 - 0x945b4fff com.apple.CoreVideo 1.4 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
    0x945f9000 - 0x9463efff com.apple.bom 8.5 (86.3) /System/Library/PrivateFrameworks/Bom.framework/Versions/A/Bom
    0x946c5000 - 0x946e1fff com.apple.securityfoundation 2.2 (27710) /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoun dation
    0x946f5000 - 0x94739fff com.apple.securityinterface 2.2 (27692) /System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInter face
    0x9475d000 - 0x9476cfff libCGATS.A.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libCGATS.A.dylib
    0x94774000 - 0x94781fff libCSync.A.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libCSync.A.dylib
    0x947c7000 - 0x947e0fff libRIP.A.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libRIP.A.dylib
    0x94b80000 - 0x94bf1fff libstdc++.6.dylib /usr/lib/libstdc++.6.dylib
    0x94d8c000 - 0x94ebcfff com.apple.AddressBook.framework 4.0.4 (485.1) /System/Library/Frameworks/AddressBook.framework/Versions/A/AddressBook
    0x94f4e000 - 0x94f5dfff com.apple.DSObjCWrappers.Framework 1.1 /System/Library/PrivateFrameworks/DSObjCWrappers.framework/Versions/A/DSObjCWra ppers
    0x94f65000 - 0x94f92fff com.apple.LDAPFramework 1.4.1 (69.0.1) /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
    0x94f99000 - 0x94fa9fff libsasl2.2.dylib /usr/lib/libsasl2.2.dylib
    0x94fad000 - 0x94fdcfff libssl.0.9.7.dylib /usr/lib/libssl.0.9.7.dylib
    0x94fec000 - 0x95009fff libresolv.9.dylib /usr/lib/libresolv.9.dylib
    0x95507000 - 0x95635fff edu.mit.Kerberos 5.5.23 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
    0x95722000 - 0x957b0fff com.apple.WebKit 419 /System/Library/Frameworks/WebKit.framework/Versions/A/WebKit
    0x9580c000 - 0x958a2fff com.apple.JavaScriptCore 418.3 /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/JavaScriptCor e.framework/Versions/A/JavaScriptCore
    0x958df000 - 0x95bebfff com.apple.WebCore 418.21 /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.frame work/Versions/A/WebCore
    0x95d74000 - 0x95d9dfff libxslt.1.dylib /usr/lib/libxslt.1.dylib
    0x95da5000 - 0x95e21fff com.apple.syncservices 2.5 (194) /System/Library/Frameworks/SyncServices.framework/Versions/A/SyncServices
    0x95fc9000 - 0x95ffbfff com.apple.PDFKit 1.0.3 /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/PDFKit.framew ork/Versions/A/PDFKit
    0x96013000 - 0x96018fff com.apple.URLMount 2.1.3 /System/Library/PrivateFrameworks/URLMount.framework/Versions/A/URLMount
    0x96f6f000 - 0x96f8efff com.apple.vecLib 3.2.2 (vecLib 3.2.2) /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib
    0x975ff000 - 0x97624fff com.apple.speech.LatentSemanticMappingFramework 2.2 /System/Library/PrivateFrameworks/LatentSemanticMapping.framework/Versions/A/La tentSemanticMapping
    0x97a61000 - 0x97a77fff com.apple.AppleShareClient 1.5.1 /System/Library/Frameworks/AppleShareClient.framework/Versions/A/AppleShareClie nt
    0x97a81000 - 0x97abffff com.apple.AppleShareClientCore 1.5.1 /System/Library/Frameworks/AppleShareClientCore.framework/Versions/A/AppleShare ClientCore
    0x9801d000 - 0x9802bfff com.apple.DMNotification 1.0.4 (37) /System/Library/PrivateFrameworks/DMNotification.framework/Versions/A/DMNotific ation
    0x9823c000 - 0x9830dfff com.apple.QuartzComposer 1.2.4 (32.22) /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuartzCompose r.framework/Versions/A/QuartzComposer
    0x9838a000 - 0x9838afff com.apple.quartzframework 1.0 /System/Library/Frameworks/Quartz.framework/Versions/A/Quartz
    0x98503000 - 0x9851bfff com.apple.slideshow 1.0.4 (1.0) /System/Library/PrivateFrameworks/Slideshow.framework/Versions/A/Slideshow
    0x988d8000 - 0x9891bfff com.apple.ISSupport 1.0.3 (16) /System/Library/PrivateFrameworks/ISSupport.framework/Versions/A/ISSupport
    0x98941000 - 0x98968fff com.apple.DotMacSyncManager 1.0.4 (155) /System/Library/PrivateFrameworks/DotMacSyncManager.framework/Versions/A/DotMac SyncManager
    0x98983000 - 0x98a2dfff com.apple.applescript 1.10.7 /System/Library/PrivateFrameworks/AppleScript.framework/Versions/A/AppleScript
    0x98a92000 - 0x98ad5fff com.apple.PAPICommon 2.5 (131) /System/Library/PrivateFrameworks/DotMacLegacy.framework/Versions/A/DotMacLegac y
    0x9a228000 - 0x9a233fff com.apple.IMFramework 3.1.4 (429) /System/Library/Frameworks/InstantMessage.framework/Versions/A/InstantMessage
    0x9a23e000 - 0x9a397fff com.apple.MessageFramework 2.1 (752.2) /System/Library/Frameworks/Message.framework/Versions/B/Message
    Power Mac G4 (dual 1GH mirror)   Mac OS X (10.4.9)  
    Power Mac G4 (dual 1GH mirror)   Mac OS X (10.4.9)  
    Power Mac G4 (dual 1GH mirror)   Mac OS X (10.4.9)  
    Power Mac G4 (dual 1GH mirror)   Mac OS X (10.4.9)  

    I saw that link you mentioned when I googled previously to comming here looking for similar issues.
    Here is Apple's example script, you can easily view it by turning on the Script menu bar in the AppleScript Utility application, then in Mail hold down the option key while accessing the script menu, Mail Scripts -> Rule Actions -> Sample Rule Action Script
    Sample Rule Action Script
    Copyright © 2003 Apple Computer, Inc.
    You may incorporate this Apple sample code into your program(s) without
    restriction. This Apple sample code has been provided "AS IS" and the
    responsibility for its operation is yours. You are not permitted to
    redistribute this Apple sample code as "Apple sample code" after having
    made changes. If you're going to redistribute the code, we require
    that you make it clear that the code was descended from Apple sample
    code, but that you've made changes.
    This script is an example of how to write an AppleScript that can be
    attached as a rule action. See Mail Help for details and Mail's
    AppleScript dictionary for the full terminology for the 'perform mail
    action with messages' handler.
    If you attach this script to a rule action, and the rule
    matches an incoming message, a dialog box will display, showing
    the name of the rule that matched and the subject of the message
    that matched. One dialog per matched message will appear.
    This is also an example of how you can write scripts that appear in the
    Scripts menu and can pass in parameters for the selected messages and/or
    mailboxes in Mail's main viewer window.
    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
    As far as Mail being busy I've disabled, junk mail filtering, set Check for New Mail to Manually and disabled all other rules except the one that I'm trying to debug here. Additionally Mail is only configured for 2 POP mail boxes that are completely empty except for the 1 email message that would meet the rule's condition. I run the rule by right clicking on the email and then selecting Apply Rules.
    The following AppleScript works... instead of using display dialog, I create a new mail message and set the body of the message to the text I want to display... work great!
    using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
    tell application "Mail"
    repeat with eachMessage in theMessages
    set theNewBody to subject of eachMessage & return
    set theNewBody to theNewBody & sender of eachMessage & return
    set theNewSubject to "display dialog message..."
    set newMessage to make new outgoing message with properties {subject:theNewSubject, content:theNewBody & return & return}
    tell newMessage
    set visible to true
    end tell
    end repeat
    end tell
    end perform mail action with messages
    end using terms from
    So it definitely appears to be an issue with the Display Dialog command. Makes debugging scripts kind of hard
    Thanks for your help debugging the issue. I profess I don't know how to read the crash logs, how could you tell that it was the display dialog command, causing Mail to crash? Is there any other info that is in there that could help us figure out why it only crashes about 95% of the time?
    Is there anyway to tell if this has been submitted to apple as a mail/applescript bug? But is there any know work around?
    Regards,
    -- Greg

  • Mavericks Mail rules broken, run wild on Update 1.0

    I see lots of people have had issues with Mavericks Mail and rules no longer working. Mine worked fine until the update 1.0 fix was released. This is what I am experiening - seemingly different from everyone else's broken rules - I wonder if anyone has any ideas:
    This is on a POP mail account:
    - Rules re-run on already downloaded mail every time mail is checked for. So for example, a rule that sends an automatic reply resend that repy every time mail is checked (every 5 minutes) even though the mail is already downloaded. The original mail is also marked as 'unread' again, even after its been read (if relevant: Mail is set to delete server messages immediately, but it makes no difference what that setting is.)
    - If I uncheck the rule in the list, close preferences, then reopen preferences and re-check the rule, it stops its rerunning.
    - Rules with a 'move' command either dont move the mail, or copy instead of move, or occasionally do indeed move the mail.
    - Rules with a 'run applecript' command: the applescript generates an error when trying to access the mail details eg sender, and stops running. This even happens with the sample Applescript provided by Apple for accessing mail with Applescript.
    - Rules that set or remove a flag - mostly do nothing, occasionally setor remove the flag, but as soon as Mail checks for Mail, the flag reverts to its previous state.
    I also note that while update 1.0 corrected the 'unread count' bug. the same bug continues to exist in the mail activity window, if you have it open - the number of outgoing or incoming mails is cumulative since approx the last time the compter was restarted (does not seem to be related to when Mail itself was restarted.)
    I have repaired permissions as well as the home folder permissions using the magical resetpassword command in the recovery mode, but nothing changes.
    Any ideas? I'd be so grateful, although I suspect we need to wait for 10.9.3 (in my past experience, all OS X releases break Mail, and they are fixed by .3. Great.)

    In our office we use Thunderbird everywhere (OSX, Windows, Linux), and we are really happy with it.
    Its gui it's not nice as Mail's, but it can do everything you ask it to do, and more.

  • Applescript process message body from mail rule help please

    Would someone be kind enough to help me figure out how to do this?  I've been reading for hours on other posts and I can't get this to work.
    Here is an example:
    I would like to set up a mail rule to run an applescript that searches the body of the email for "-Front Door- Open".  I then want to parse the body and sets myDevice= "-Front Door-" and myState="Open".  After I have these variables set, I want to make an call to something like https://foo.me.com/api/token/${state.accessToken}/smartapps/installations/${app.id}/Notify?device=${myDevice}&type=ContactSensor&state=${myState}
    I understand how to do the mail rule, I just can't figure out the applescript part of it.

    The script works just fine - at least, as designed if not as expected.
    When the script runs, Mail and/or AppleScript looks for a perform mail action handler. If that is found, the commands within are executed.
    If there is no perform mail action handler then the script is run as-is (i.e. as if you clicked 'Run' in AppleScript Editor).
    And that's exactly what's happening here. In the first case (that works) the script is running because there's no (visible) perform mail action handler.
    In the second case where it apparently doesn't work, there is a handler, so that handler is being executed. Any code outside that handler is ignored (unless it's called from within the perform mail action handler.
    Since your 'say' command is outside the handler, it is ignored. However, if you move it inside the perform mail action handler you'll hear your speech.

  • Mail rule message content as variable

    I run a minecraft serer, and i need a way to promote a player when they fill in a form on the website. Every time a player filles in the form, I get an email like this:
    New application for member:
    Naam:  <name of the pearson>
    Username:  <minecraft username of the person>
    Skype naam:  <skype name of the person>
    E-mail:  <email of the person>
    Nieusbrief:  <Whether they want to get the newsletter or not>
    I know there is a way to setup a mail rule that runs an applescript, and from that I can run a shel script, but is it posible to feed the playername to the shel script script as a variable? So from the mesage body to the apple script, and from the apple script th the shel script. First problem I face is getting the username to the apple script. Then there is the second problem: I know there is an run-shel-script thingy, but i'm not sure how to pass the variable on from the apple script to the shel scrip. (I don't have anny experience with apple scripts...)
    Anny help is appreciated.

    Hi Stefan,
    Thanks for your reply.  I am glad to hear that I am wrong again )
    In your opinion is it possible to force the Outlook Exchange server to add the content attachment every time?  I mean by doing some configuration on it...?
    The reason why we would like to do this is because when - in the content tag of a Mail Package message - we have MIME message parts that are of content-type text/html we are having problems in decoding the html back to a readable format.
    To do this we use the apache QuotedPrintableCodec Java class.
    This works fine when the content type of the message is just text/plain but we get an exception when we try with text/html.
    The exception we get is:
    org.apache.commons.codec.DecoderException: Invalid URL encoding: not a valid digit (radix 16): 13
    I don't know if this is because of the two character sets we have in the payload (utf-8 and iso-8859-1) or if it is for other reasons...
    If you could help me figure out how to forward any HTML email to another system in a readable format it would be great.
    Thanks for your support,
    Aldo

  • Applescript run from Mail rule does not run

    I am attempting to run an Applescript from a Mail rule. Basically, the Applescript does not run.
    Stripped to the bare essentials, the following script runs fine when Applying a rule in Mail:
    say "Hello"
    as well as this one:
    say "Hello"
    using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
    tell application "Mail"
    -- statements to process each message in theMessages
    end tell
    end perform mail action with messages
    end using terms from
    But, when I remove the comments from the block lifted verbatim from the Applescript manual:
    say "Hello"
    using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
    tell application "Mail"
    -- statements to process each message in theMessages
    end tell
    end perform mail action with messages
    end using terms from
    the script does not even say Hello.
    I am trying to go as far as having the Applescript create a new ToDo based on specific incoming emails, but I can't get any but the simplest Applescript to run.
    Can anyone help me?
    Tom

    The script works just fine - at least, as designed if not as expected.
    When the script runs, Mail and/or AppleScript looks for a perform mail action handler. If that is found, the commands within are executed.
    If there is no perform mail action handler then the script is run as-is (i.e. as if you clicked 'Run' in AppleScript Editor).
    And that's exactly what's happening here. In the first case (that works) the script is running because there's no (visible) perform mail action handler.
    In the second case where it apparently doesn't work, there is a handler, so that handler is being executed. Any code outside that handler is ignored (unless it's called from within the perform mail action handler.
    Since your 'say' command is outside the handler, it is ignored. However, if you move it inside the perform mail action handler you'll hear your speech.

  • Mail Rules window says "No Scripts Installed" next to "Run AppleScript"

    I'm trying to create a rule in Mail that will run an AppleScript. But when I choose "Run AppleScript" in the action section of the rule-creation window, the dropdown to the right says "No Scripts Installed".
    If I click on that dropdown, it has one option: "Open in Finder". When I choose that, a Finder window opens to the folder Library/Application Scripts/com.apple.mail/. I dropped my AppleScript file into that folder, but when I tried again to make a rule, I still got the "No Scripts Installed" dropdown.
    I'm running Mail version 6.3 in OS X 10.8.3.
    Any idea how to get this working properly? Thanks.

    When Finder opens the directory for your AppleScript (in the case of OS 10.9.1, "Library>Application Scripts>com.apple.mail"), make sure your script (not a shortcut to your script) is copied there. Once it is, you will see the script in the dropdown menu where you initially saw "No Scripts Installed".
    Hope this helps.

  • Problem with Mail Rule

    I am trying to set up a mail rule that triggers an Applescript. The Applescript will open all attachments with Preview in this case. I know the rule is being triggered because I have two actions for the rule, run the Applescript and Make a sound, and I hear the sound.
    Here is the script:
    using terms from application "Mail"
    on perform mail action with messages theMessages
    tell application "Finder" to set pathToAttachments to (path to desktop folder as string)
    tell application "Mail"
    repeat with theMessage in theMessages
    set theText to content of theMessage
    if theMessage's mail attachments is not {} then
    repeat with theAttachment in theMessage's mail attachments
    set theFileName to pathToAttachments & (theMessage's id as string) & space & theAttachment's name
    try
    save theAttachment in theFileName
    on error errnum
    end try
    tell application "Preview" to open theFileName
    tell application "Finder" to delete theFileName
    end repeat
    end if
    end repeat
    end tell
    end perform mail action with messages
    end using terms from
    (* tell application "Mail"
    set myMessages to selection
    tell me to perform mail action with messages myMessages
    end tell
    If I comment out the stub at the bottom, and run the script, it runs perfectly all the time.
    If I select the e-mail in question and trigger using *Apply Rules*, the script runs some of the time.
    I have yet to get the script to trigger on newly arriving e-mails.
    The rule is checked and I haven't found a +Apply Rules to Incoming Emails+ check box. I thought that happen automatically. Anyone have any ideas on what is going wrong or further ways I could debug it?

    Testing your script, I found that, in the few cases where it didn't work well, I could have it work properly with the following modification:
    *tell application "Preview" to open theFileName*
    *delay 1*
    *tell application "Finder" to delete theFileName*
    It should also be possible to replace *delay 1* with something better, like *repeat while … end repeat*.
    Hope it can help.

  • RSS + Mail rules

    Hi,
    I subscribe to a RSS feed that links to free MP3s to download. Until recently, I was using Safari to monitor the feed but I found myself downloading just about every file. Inspiration struck the other day when I remembered that I can subscribe to RSS feeds in Mail as well. I thought I'd be able to set up a mail rule that would trigger an AppleScript that would download the linked songs.
    Well, I was half right. I can set up a mail rule that triggers an AppleScript when a new RSS article arrives, but it can't do anything with those articles. It keeps saying something like "Cannot access account "RSS"." That's not exact, btw. I'm not on my Mac right now and I don't remember the specific error.
    Is there any way to use AppleScript to extract information from an RSS article?
    I thought I could work around this limitation by forwarding the RSS articles to an email account and have the AppleScript work on them. Unfortunately, the "read more" link doesn't get forwarded and that's where this feed links to the MP3s. Is that normal?
    I'm about ready to give up and just run a shell script every 30 minutes. That's a lot more work on my part because I have to figure out which articles I've already seen on my own, but at least it would work.
    Are there any plans to update Mail's AppleScript to support RSS? Is there any way to make Mail include an RSS article's Read more link in forwarded RSS messages?

    Same problem here.

  • Mail Rule seems to be confusing messages

    This script extracts email addresses from the body of a message and resends the message to each of the extracted addresses. It works well when one message arrives at a time. However, when several messages arrive at once, it often sends a message to the wrong address. The script is very straight forward, yet I am not sure what is going on. Any ideas?
    property debug : false
    property choAddress : "[email protected]"
    using terms from application "Mail"
       on perform mail action with messages theMessages for rule theRule
           tell application "Mail"
               repeat with aMessage in theMessages
                   -- Extract addresses from message content
                   set messageContent to aMessage's content
                   set messageSubject to aMessage's subject
                   set mAddresses to my extractAddresses(messageContent)
                   -- Build a unique list of addresses
                   set uAddresses to {}
                   repeat with mAddress in mAddresses
                       set mAddress to contents of mAddress
                       if mAddress ≠ choAddress and mAddress is not in uAddresses then set end of uAddresses to mAddress
                   end repeat
                   -- Forward messages to each extracted address
                   repeat with uAddress in uAddresses
                       set newMessage to make new outgoing message at the beginning of outgoing messages with properties {sender:choAddress, subject:messageSubject}
                       tell newMessage
                           make new to recipient at beginning of to recipients with properties {address:uAddress}
                           set content to aMessage's content
                           if debug then
                               set visible to true
                           else
                               send
                               delay 1
                           end if
                       end tell
                   end repeat
                   delay 1
               end repeat
           end tell
       end perform mail action with messages
    end using terms from
    on extractAddresses(mContent)
       try
           -- Thanks Nigel Garvey
           set extractedAddresses to paragraphs of (do shell script "echo " & quoted form of mContent & " | grep -Eo '[[:alnum:]][^[:space:]<>@\":;]+@[^ <>\"]+[][:alpha:]]'")
       on error
           error number -128
       end try
    end extractAddresses

    Sorry but my AppleScript is too rusty to wade through your script. However, a while ago I wrote a script to extract email addresses from an emailed web form with a defined format and send a reminder 4 days later with a specified message.
    I opted to use a mail rule to put a copy of specified messages into another mail folder - this may be more reliable for you.
    For my 4 day delay I set a 'Users Daemon' to run an AppleScript every hour. This is more efficient and reliable than setting delays in AppleScript.
    The most tedious task is parsing for all possible email formats - check email RFCs if you doubt this.
    This script was not completed but the sections I tested on Leopard worked well. Here is the incomplete script - just in case you find something useful:
    tell application "Mail"
      set fourDays to 345600 -- normally 345600 but can be 0 for testing
              repeat with lastMsg from (count messages of mailbox "Pending") to 1 by -1
      try
                                  set thisMsg to message lastMsg of mailbox "Pending"
      end try
      if (current date) - (date sent of thisMsg) > fourDays then
      set txt to content of thisMsg
      set AppleScript's text item delimiters to {"Email id"}
      set newRecipient to paragraph 3 of text item 2 of txt
      set html to source of thisMsg
                                  set AppleScript's text item delimiters to {"<body bgcolor=\"#FFFFFF\" text=\"#000000\">"}
      set bodyPlus to text item 2 of html
      set AppleScript's text item delimiters to {"</html>"}
      set oldBody to text item 1 of bodyPlus
      set newMsg to make new outgoing message with properties {sender:"[email protected]"}
      tell newMsg
      make new to recipient with properties {address:newRecipient}
                                            set subject to "Your Heating Oil Order"
                                            set html content to "<html><body bgcolor='#FFFFFF' text='#000000'>
    <!-- Use normal html with inline style after this line - do not use double quotes -->
    <br>
    <hr style='color:pink; background-color:pink; height:4px; width:60%; text-align:middle'>
    <br>
    <p style='color:red; font-size:xx-large'>Thank you for placing your heating oil order with us.</p>
    <p style='color:brown; font-size:x-large'>I would appreciate feedback (good or bad) about how your oil delivery went.</p>
    <p style='color:blue; font-size:medium'>Please contact me if you experienced any difficulties with your order.</p>
    <br>
    <p style='color:navy; font-size:medium'>Sincerely,<br>
    <br>
    Peter Pan</p>
    <br>
    <hr style='color:pink; background-color:pink; height:4px; width:60%; text-align:middle'>
    <!-- End of extra html - original message follows -->
    <br>" & oldBody & "</html>"
      send -- normally send but can be set to save to put email in Drafts for testing
      end tell
      delete thisMsg -- normally delete thisMsg but can be removed for testing
      end if
      end repeat
    end tell

  • Mail rules are not applied to IMAP subfolders

    Hi
    I've set up a mail rule to run for 'Every Message' which runs an applescript of mine.
    The issue I have is that the script is only called for mail in the root of IMAP accounts and not mail in subfolders.
    I've searched google and the forums but cannot find any explanation. Can anybody here help?
    Thanks,
    Jason

    I should point out that the new mails in the sub folders were put there by a sieve script on the server.

  • Mac mail rules do not display properly

    I use Mac Mail rules to manage my mail, but I am having trouble using them because, many time the "Perform the following actions:" display gets so scrunched together that I cannot see what I've already entered or, if I'm editing a rule, what needs to be changed (see image capture, below).  This does not happen with every rule but it happens on many of them.  It occasionally (but less often) happens with the conditions entries too.
    I've had this problem for some time, but it's gotten much worse since I upgraded to Yosemite.
    Another problem I'm having with the mail rules is that sometimes the "Stop evaluating rules" option is grayed out and I can't enter it as an action.
    Does anyone know how to fix this?

    Hi wret audio,
    Welcome to the Support Communities!
    The article below may be able to help you with this.  The best place to start filtering spam is at your email provider's website, before it even reaches your computer.
    iCloud: Why am I getting junk mail (spam)?
    http://support.apple.com/kb/ts4019
    iCloud: Identifying and filtering junk mail
    http://support.apple.com/kb/HT4899
    Mail (Mavericks): Manage messages using rules
    http://support.apple.com/kb/PH14906
    Cheers,
    - Judy

  • ICloud and Mail rules

    I have set up my computer (2.66 GHz iMac core 2 duo, OSX 10.9.4) with two users to separate my fishing club activities from the rest of my life.  I would like to use different MAIL RULES to sort mail on each of the user accounts.  I would also like to sync some of my activities such as Calendar, Contacts, Reminders, Notes between the accounts.  If I link both accounts over iCloud, the MAIL RULES are synced period!!  Unselecting mail for either or both accounts using the iCloud preference has no effect.  To prevent syncing RULES requires signing one or the other account out of iCloud.  This means, of course, that I am unable to sync Calendars, Contacts, etc.  Does anyone know of a work-around for this dilemma?
    Thanks in advance.
    TomJF

    I'm using the same Apple ID for both accounts to allow syncing. 
    I use QUICKEN to track finances.  The main reasons I set up two users is to separate fishing club finances from my personal finances and to separate documents.  At this point I have decided to combine the two accounts; sort documents; and open separate QUICKEN accounts as needed.  I do think that Apple Mail needs attention to correct inconsistencies such as the one I pointed out.
    Thank you for your Comments
    TomJF

  • Running AppleScript from Mail rules

    Hi.
    I'm pretty new to this, so sure it's a basic question....
    I've created An AppleScript that calls an Automator application.  This runs fine if I open the script in the editor and click run.
    I've now created a mail rule which should run this script if a mail is received with defined subject, but it doesn't....
    Whatever I try, it's just not running the script.
    Any help?

    Yes.
    tell application "iTunes"
      quit
    end tell
    delay 60
    tell application "iTunes"
      activate
    end tell
    Change 60 seconds in delay to the delay you need.
    (still might not work as a Mail Rule, but give it a try)

Maybe you are looking for

  • Transaction marked rolled back

    Hi I'm have a FacadeBean F1 which uses Required transaction attribute which calls another Session Bean S1 which has default transaction attribute(Supports).This uses customized UserTransaction. In bean S1 this is the sequence of steps Method{ insert

  • Process flow- Assigning Versoins and Scenarios

    Hi John, I tried the new version Process flow in 11.1.2 and created a Planning hierarchy. Assigned an Owner and reviewer to it. When trying to assign scenarios and versions, I was able to select the Scenario but the Version drop down is showing the V

  • Oracle Dev Suite and Oracle DB Server on same machine

    I have Oracle 10g database server already installed. Now I want to install Oracle Development Suite 10g on the same machine. Should they be installed in the same or separate Oracle home? Is their anything I need to be aware of when installing? Thanks

  • Rule Based System

    Hi all, I am currently working on a project which required to Implemented 500-600 rules in the System. Some of them are global Rules and some are just module level rules. Is there any pattern exist for Rule Based System? Thanks in Advance Rashmikant

  • Multiple User with different Password

    Hii I am looking for a router which has the best range and allow multiple users to connect to the router using their own different passwords, and further it may allow the admin to manage the Bandwidth and data of each user.