OS X Technologies :: Apple Script For Mail Headers?
Mar 19, 2012
I am currently trying to generate a report using the headers from Apple Mail. The script I have works, but I would like to be able to pull out messages that are sent to a specific recipient ( a certain distribution group in this case...).
Apple Mail has a preference to 'Trust junk mail headers in messages' but I can not find a list of what those headers are.By trial and error I've learned the "X-Spam-Flag: YES" will work (exactly that, no extra info), but I'd like to know what other options there are... particularly if I can send a score/rating back and have it look at that.But I can't find a list of supported headers.The Internet is full of "common spam headers" and yet none of them actually seem to work and lots of people who can't get it working with spamassassin which is incredibly common.
The following Applescript segment works in Snow Leopard and fails in Lion with "AppleEvent handler failed. number -10000" tell application "Mail"set new mail sound to "Glass"end tell In addition, the Apple-supplied, Mail Applescript for gathering Mail information "Display All Accounts and Preferences.scpt" fails (again with "AppleEvent handler failed. number -10000") on the line set displayString to displayString & my formatFields("New mail sound", new mail sound) & return
The Console Log reports the following error.
Mail: [<MailApp 0x7fd6a9e009a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key newMailSound. The Mail Applescript property "new mail sound" appears not to be recognized correctly. I do not have any Mail plugins. Several additional sounds have been added to the system sound set. Mail reports no problems using them.
Under Snow Leopard, I used the same Applescripts (fired off by iCal) which turned on/off Mail's New Mail Sound depending on the time of day, i.e. I set the new mail sound to be "Silent Alert" in the evening and restored it to my default new mail alert in the morning. Any guidance as to what might be wrong and how to solve this problem would be very welcome.
I have a problem with my inbox, seems its corrupted in some way. I can see the headers, but no contents, cant delete or move message. All other folders seem Ok. Its from a POP3 mailbox where the originals are deleted off the server when downloaded so I'd prefer to try and recover it but I can live with losing the contents if necessary. Any ideas? Is there a tool or way to repair? I have Time Machine but I doubt the TM backup will have caught these files between them being downloaded (they came in one batch) and being corrupted as it was only a few minutes. Not sure how I could tell if TM did catch them either. TM did recover them, now I just need to work out how to empty the inbox of the corrupt messages. Worst case I can create a new email account but I'd rather not as configuring it was troublesome. Mailbox > rebuild, then move the messages from the TM mail recovered folder back to inbox.
For no apparent reason, now when I create a new mailbox, the first column header contains a mystery icon consisting of two arrows, one pointing northwest and the other pointing southeast. When I right-click on the headers, there is no corresponding item in the pop-up menu (e.g. Attachments, To, From), so I have no clue what it is, nor can I hide it. Mailboxes I created prior to whatever it is that changed do not have this icon. I have not changed my OS, nor the version of Mail I am using. Can anyone tell me what this icon/column is for, and how I can get rid of it??
How can I get the mail headers to "gray" out or be colored when they've been read? Right now, ALL messages in the list are bold black. Once I read an email, it still shows bold and black. I need some sort of identification to show what is NEW and what HAS BEEN READ.
I've been using Outlook, which grays out read messages.
Successfully moved mail to another partition ~ however not getting Spotlight (or Mail) to index or search email since the move.Tried adding the folder to Spotlight privacy settings ~ then removing but no luck.Tried contacting Apple however moving mail from Libraries is not 'supported' so no love there. how to get Spotlight to search mail residing on another partition?
this is my second script im trying to create. What i would like this script to do is have the user input and ip and ping that address my problem lies in getting ip address from the dialouge box into the "do shell script", this is my script so far set Ip_address to ""set Dialog_1 to display dialog "Enter Ip Address" default answer "" with title "Ping"set the Ip_adress to the text returned of Dialog_1set ping to (do shell script "ping -c 2 & Ip_address & ")if ping contains "64 bytes" then display dialog "Connection Secessful"
And also how do i make a variable so if it comes back i unresponsive i can have a dialog box say "Connection Unsecessful" (I know i can do this maunally but i would like to create a script so its easier for the end user)
I manage a small deployment of different macintosh products and I currently have to run 5 different images so that the background images look right on all the various resolutions. I have been working on a piece of applescript to prompt the user on first startup to select their hardware type to apply the proper background image but I am running into a few issues. Firstly the method I am using limits me to three options and I cant seem to find any documentation on how the list function works..Second, I keep getting errors saying the files can't be found. [code]
I am just starting out with applescript and could do with a pointer please. I have written a script which saves two pdf files from an active Illustrator document in the source folder of that document. The issue I am have now is that I cannot get the two files to combine into a single PDF file. The whole script is quite long and is works apart from the combine PDF part?
tell application "Finder" try open (every document file of container of file_path whose name contains ".pdf") on error display dialog "no PDF file located"
[code]....
Both PDF documents open and are set as the variables docRefA and docRefb, but the acrobat command 'bring to front' and 'insert page' do not seem to be working. I get an error come up in an illustrator dialog box saying "Adobe Acrobat Pro got an error: document "84056_R1.pdf" doesn't understand the bring to front message".
I am trying to make a script that allows me to call a number in Address Book in my Avaya Softphone app. Everything works great except that all numbers need to have "9-1" or "91" before the phone number. This is needed to access the outside line and all calling requires the country code. how to add the 91 to the script so that all phone numbers in the script have this added.
HiThe usual tale of an Applescript beginner getting lost but, I want to be able to search for a selected membership number within a Numbers spreadsheet, extract that member’s email address and send a message. I have managed to create a script that creates and sends the email but after several attempts I cannot work out how to start searching cells for a particular value and how to extract data from cells in the selected row.
I'm just now upgrading from 10.6 to 10.7, and I'm having trouble with a script that I wrote that worked fine under 10.6. In part, it executes the following command: osascript -e "tell application "Finder" to set destop picture to POSIX file "<path>"" to change the desktop background image to one of two different files based on other conditions. In 10.7, this command completes with no error code, but it only changes the background of one of my four desktops. Is there a way to programmatically change the background image of all of my desktops simultaneously? Failing that, is there a way to a) find out how many desktops I have and b) loop through them, setting each of their backgrounds in turn? osascript -e "tell application "System Events" to set picture of every desktop to "<path>"" Unfortunately, that also changes only the current desktop's picture. The larger script is in Perl, so I'd prefer a technology that works well with that language, but if I have to change to a different scripting language, that's not the end of the world.
I'm using the following script below using an external libarary to query mysql database on external server. works. gives results. How do I save them to do something with the. when I run it, the results of the call to the library show up in the results window. that makes sense. ie {rows:1, cols:1, record_data:{{"85016 "}}} I want to assign the results to a variable to use it later, particularly the 85016. I try "set testVariable to tell db_link to do_select(theDBCommand)" no good. Not sure how to do this.Script follows: -- links to the mysql tools -[URL]set library_path to "js_aux_scripts:mysql_objects.scptd" set app_support to (path to application support folder) as stringset DB_Library to (load script file (app_support & library_path)) set db_link to new_link("lala.yadayada.com", "user", "pass", "db") of DB_Library -- collect the job number you want to run-- Get the Numberset displayString to "Enter Job Number"set the theIcon to 1set theJobNumber to ""repeat display dialog displayString default answer theJobNumber with icon
I’ve found this script that copies the names of multiple selected files in the Finder to clipboard: try set theNames to {} tell application "Finder" repeat with i in (get selection) set end of theNames to name of i end repeat end tell set {TID, text item delimiters} to {text item delimiters, return} set the clipboard to theNames as text set text item delimiters to TIDend try I need to prepend to each result a string like [URL] where “folder” is the parent folder relative to the files.
im looking for a more elegant way to list of folders in a popup for users to select at the beginning of my script and use as a path variable.the path i need to filter through to make the list is similar to the following: /Volumes/Network Drive/A/Client Name(s) starting with A//Volumes/Network Drive/B/Client Name(s) starting with B/ other folders will be created in the folder they select. The complications: All the folders i want to list are divided into folders labelled with each letter of the alphabet.Also there could potentially be hundreds of these folders once consolidated to a list The current script lists the entire file path in the popup. I want the entire path to be set as the variable but just the folder name to be listed in the popup These are the scrips i have started with but would love a better way to combine and clean up.
(*set mainList to {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "XYZ"}choose from list mainList with prompt "Choose Client"set listchoice to result as text*)set the_folder to (path to desktop) as stringset with_subfolders to trueset inc_folders to true set the_files to get_folder_list(the_folder, with_subfolders, inc_folders)return the_files on get_folder_list(the_folder, with_subfolders, inc_folders) set the_files to {}
I'm looking for an applescript to detect if a cd is inside my mac, if cd inside (possible to detect if empty?) do one thing.Otherwise do another thing.
I'm running 10.7and I'm trying to create an applescript to install printers. I'm able to run the first command without issues but the other two keeps giving me error messages in applescript. I assume its because the other two commands have spaces? These are the commands I run when in Terminal:
I have an little program that iniciates an apple script from an arduino, so when the arduino prints a letter it gos from one video to another and back and fourth between videos in Itunes.I would like for the videos to start from the begining everytime, However, they always start where they left off. How can I create an apple script that makes each video start From the begining every time? Here are the scripts
I'm having trouble with my Apple Mail program. I have a number of e-mail accounts (some with Optimum online, a g-mail, yahoo, etc.) Apple Mail has no problem at all reading and downloading any mail from any of the services. My problem is with Optimum Mail (Optonline.net). Mail refuses to send anything through that set-up. I've been on the phone for hours with Optimum and the settings are all correct. I've tried connecting directly to the cable modem and mail gets sent. This would make me believe that it is the Apple Airport Extreme router that is at fault. I've tried restarting it, re-initializing it and setting it up again and the problem continues. All my Optimum mail is picked up and can be read but it will not send anything through Optimum. It asks if I want to send it through another server (like g-mail or yahoo) and if I pick yes the mail sends.
It happens on all my computers a G-3 and pre Intel iMac G-5 on Tiger and my Macbook on Leopard.
Anyone else hear of this problem? Both Apple support and Optimum online say they have never heard of it. Talking for hours with their tech departments have found no solutions.
I need an AppleScript to restore a bunch of partitions from a master drive to a stack of external target drives. I don't mind partitioning them 1st, if necessary.The master drive has 16 partitions, all equally sized, and I'd like a script to run that will have Disk Utility to just go down the list restoring each partition to the matching 16 partitions on one of the target drives.