|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Apprentice |
I have been struggling for ages trying to send bulk emails to an organization. I ended up writing this fScript to do it. Its my first time making one of these so it is probably not the best way. Feel free to modify it and make it better. I was thinking it would be good if it cycled through the contacts associated with that organization first, getting their email addresses, and then if you dont have a contact, or a contacts email address, it returns the organizations email address.
To use just copy and paste into AppleScript. Select the organizations you want to export in daylite. Hit run and it will generate a text file on the desktop called 'organizations.txt' ********* tell application "Daylite" set obj_val_list to eval " s := NSString string. document := (NSApplication sharedApplication) firstDayliteDocument. objects := (document firstMainWindowController) selectedObjects. start := 0. total := objects count. [start < total] whileTrue: [ object := objects at:start. val := (object valueForKeyPath:'contacts'). val == nil ifTrue: [ \"add an empty string as a place holder\" s := s ++ ''. ] ifFalse: [ s := s ++ ((val count) stringValue). s := s ++ '; '. ]. val := (object valueForKeyPath:'name'). val == nil ifTrue: [ \"add an empty string as a place holder\" s := s ++ ''. ] ifFalse: [ s := s ++ val. s := s ++ '; '. val := (object valueForKeyPath:'electronicAddresses.typeString'). totalemailadded := 0. starta := 0. totala := val count. [starta < totala] whileTrue: [ vala := (val at:starta). vala = 'Email' ifTrue: [ valb := (object valueForKeyPath:'electronicAddresses.url'). valc := (valb at:starta). s := s ++ (valc). s := s ++ '; '. totalemailadded := totalemailadded + 1. ]. starta := starta + 1. ]. ]. s:= s ++ ' '. start := start+ 1. ]. s writeToFile " end tell display dialog obj_val_list as string buttons {"OK"} |
||
|
|
Apprentice |
Watch out for that sad face after writeToFile at the bottom, it should be : ( without the space
|
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

