VoiceMail Applescript

Hi,
I am trying to write an applescript that works as follows:
If Mail.app receives a message from my phone provider that contained a voice mail message (just an email with a WAV attached) it would:
1) Read the body of the message (e.g. "You have a voicemail from <2048513621>")
2) Lookup the phone number in Addressbook
3) Take the associated name from the Addressbook
4) Change the sender (My Provider) into the name associted with the number.
In this way I could easily see who had left a voice message, and I could sort these message by sender, etc.
Here's what I have so far, but it doesn't seem to work....
on performmailaction(info)
tell application "Mail"
set theMessages to |SelectedMessages| of info
repeat with thisMessage in theMessages
set AppleScript's text item delimiters to {""}
set thisSender to content of thisMessage as string
set brkpos to offset of "<" then
set AppleScript's text item delimiters to {"\""}
set thisSender to text item 2 of thisSender as string
end if
else
if (brkpos is equal to 1) then
set thisSender to (text items 2 through -1) of thisSender as string
end if
set AppleScript's text item delimiters to {"@"}
set thisSender to text item 1 of thisSender as string
end if
tell application "Address Book"
repeat with thePerson in the people
set theNumber to value of phone of thePerson as string
if theNumber contains thisSender then
set theName to name of thePerson as string
--else
--set theName to WhatNumber
end if
end repeat
end tell
set sender of eachMessage to theName
end repeat
end tell
end performmailaction
<br>
G5 Quad   Mac OS X (10.4.10)  

I've updated the code so all i need is a way to put a the variables 'first_name & last_name' into the subject of an existing mail.app message
thanks!
on performmailaction(info)
tell application "Mail"
set theMessages to |SelectedMessages| of info
repeat with thisMessage in theMessages
set AppleScript's text item delimiters to {""}
set thisSender to content of thisMessage as string
set brkpos to offset of "<" then
set AppleScript's text item delimiters to {"\""}
set thisSender to text item 2 of thisSender as string
end if
else
if (brkpos is equal to 1) then
set thisSender to (text items 2 through -1) of thisSender as string
end if
set AppleScript's text item delimiters to {"@"}
set thisSender to text item 1 of thisSender as string
end if
set phn to thisSender
set a1 to (first character of phn)
set a2 to (second character of phn)
set a3 to (third character of phn)
set f1 to (fourth character of phn)
set f2 to (fifth character of phn)
set f3 to (sixth character of phn)
set s1 to (seventh character of phn)
set s2 to (eighth character of phn)
set s3 to (ninth character of phn)
set s4 to (tenth character of phn)
set phn to "(" & a1 & a2 & a3 & ")" & " " & f1 & f2 & f3 & "-" & s1 & s2 & s3 & s4
tell application "Address Book"
set found to false
repeat with u in people
set ph to (every phone of u whose value contains phn)
if ph is not {} then
set found to true
exit repeat
end if
end repeat
if found then
set first_name to first name of u
set last_name to last name of u
end if
end tell
-- move thisMessage to mailbox "VoiceMail" of account of mailbox of thisMessage
end repeat
end tell
end performmailaction

Similar Messages

  • AppleScript to compile audio files into a sequence

    Here's the challenge: I use Skype as my office phone and everyday have to record a voicemail greeting specific to that day: "Hi this is Brian and for today, Wednesday, September 28th, I am in the office. Please leave a message and I will return your call as soon as possible. Thanks." Some mornings, I might be in a noisy environment, have a hoarse voice, or whatever, (or forget to record the greeting) and I would like to prerecord the greeting audio elements ahead of time and use an AppleScript to assemble them automatically.
    I am thinking the assembly would involve two audio "constants" and three audio "variables".
    [constant: greeting open] Hi this is Brian and for today
    [variable: day of week] Wednesday
    [variable: month] September
    [variable: date] twenty-eighth
    [constant: greeting close] I am in the office. Please leave a message...
    I'm not really worried about special circumstances, like when I am out of the office, as I could record those individually.
    Can anyone think of how this could be done in AppleScript so that it would automatically recognize the day, month, and date, pick the audio elements, then send (perhaps through Soundflower) the combined audio file to Skype for the voicemail greeting?
    Thanks for your advice!

    Pressing F will match the Playhead from the Canvas to the Viewer when the Canvas or Timeline is the active window and from the Viewer to the Canvas when the Viewer is the active window.
    Shift F will locate the source clip in the Browser
    Turning off Auto Select for the video tracks in the Timeline will match back to an independant audio track -for instance a piece of music, when you press F.

  • Jabber Options - Phone Accounts - Voicemail -- "Spinning Wheel"

    Been trying to resolve a nagging issue.   We currently have CUCM 8.6.2-20000-2, CUPS 8.6.4-10000-28 and just put up Unity Conn 9.1.  Jabber Win clients are 9.2(1).   Several people have not been able to integrate voicemail into the Jabber client.  
    We are totally MS AD integrated.   In CUPS, I had Applications -> Cisco Jabber -> Settiings  Credentials Used For Voicemail service set to CUPS so the user would not need to supply credentials.  To help me debug, I went and changed this setting to "Not Set" so that the Phone Accounts option appears in Jabber 4 Win client. 
    So far all the people who do not work access the Phone Accounts setting in the Jabber client see the "Spinning Wheel".   They can't see the fields to enter their AD creds and the voicemail server.   Reinstall of the client does not seem to help.  There seemed to be a bug that described this but I think it was fixed in 9.1(2).  You can't display the Bug description because it contains proprietary info. 
    I have attached a screen shot of my Jabber Client Phone Account -- when I enter the credentials, I log in fine.
    Anyone seen this or know how to fix? 
    TIA --- Perry

    Well, I had TAC look at this issue. Short story is that it was an issue with one of the *many* local cache files which hid the real source of the problem.  I actually had the Mailstore misconfgured in CUPS.  I used the Exchange server's CAS IP instead of Unity Connection.   We created new Mailstore definition that used the Unity Conn IP's, created a new Voicemail Profile and associated the user to that profile.   She worked....
    I deleted my all my Jabber for Windows local cache files and I then received the "spining wheel" issue.  I moved my ID to the new Voicemail Profile with correct Mailstore and I could connect fine.   TAC spent an hour pouring through files on my PC and could not find the reason why my ID was working.   TAC indicates that in 9.x, a lot of this configuration moves to CUCM and hopefully cuts down on these issues!  PRT files from the Jabber client really did not assist them in locating the problem.
    Hope this helps....

  • Shell commands in applescript noob

    Hi all this is my first post in these forums and I come seeking help with a certain script I'm writing for my current college job. The purpose of the script is to install creative cloud from a server and this is as far as I've got. First I can get as far as setting the correct directory in the server by doing:
    do script "cd /Volumes/applications/Mac/'Adobe Creative Cloud'/'Enterprise - enduser'/Build"
    now when I press run the terminal screen pops up just fine with no errors in the right directory. However I've been reading up that to do other commands in the same shell I must do do shell script. When doing this however terminal doesn't do...anything. The reason why I was trying this is because my next command would be initiating the install which is the command:
    "installer -verbose -pkg 'enterprise_Install.pkg' -target /" with adminitrator privilages
    Now my question is how would formulate this within applescript? Thanks.

    do shell script "cd /Volumes/applications/Mac/'Adobe Creative Cloud'/'Enterprise - enduser'/Build ;  installer -verbose -pkg 'enterprise_Install.pkg' -target / with administrator privilages"
    You got the double quote in the wrong place.
    do shell script "cd /Volumes/applications/Mac/'Adobe Creative Cloud'/'Enterprise - enduser'/Build ;  installer -verbose -pkg 'enterprise_Install.pkg' -target / " with administrator privilages
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set unixDesktopPath to POSIX path of "/System/Library/User Template/"
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "sudo ls -l  " & quotedUnixDesktopPath with administrator privileges
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run

  • Mobile Me CONTACTS not coming down to iOS4 and lost visual voicemail

    I updated my 3GS to iOS4 and everything seems to be working, howver my contacts haen't repopulated the phone form Mobile Me. they are all still there on Mobile Me, but when I go to contacts on the iPhone, there are none and unlike previously, opening contacts on the phone does not force a sync (no spinning clock-wheel)...
    I have tried turning off the Mobile Me setting on the iphone and then restarting it, but still no contacts...
    I also lost my visual voicemail.... when I go to voicemail, it wants me to physically dial up voicemail...
    Any ideas here?

    dmbono wrote:
    Try turning off push and instead fetch every 15 minutes. There seems to be a bug that prevents data from getting through on push. Hope they remedy this soon!
    Huh? A "bug" would affect all devices using the OS. I have no idea what you are talking about as push worked just fine here after allowing a little time for my phone to be re-provisioned by the network. That took longer than normal due, I'm sure, to the large number of folks trying to do the same thing I was. And we've all hear AT&T whine that we evil iPhone users are breaking their network.

  • IPhone 4 - 4.2 upgrade killed visual voicemail

    *iPhone 4 - 4.2 upgrade killed visual voicemail*
    Ok, I upgraded to 4.2 and deleted all previous backups, so I know I'm screwed untill the next update.
    I've synced, backed up, restored from backup and still no "Visual Voicemail".
    My voicemail only works if I restore the phone to original settings. But if I do that, I loose important data in my apps. As soon as I "Restore From Backup" I loose my "Visual Voicemail".
    If I reset my voicemail password with AT&T, I get the screen to set up a new password and greeting in Visual Voicemail. When I go through these steps I get the spinning wheel "Saving".
    It never saves, and I get an alert that says it can't connect to voicemail.
    I can set up voicemail by dialing "1", but then all I see is a blank screen in my "Visual Voicemail".
    I've also tried a full reset of my voicemail with AT&T.
    I even got a new SIM card. That didn't work.
    Can anybody figure this one out???
    -Thanks

    Well, thats the first time I've been told that after a week of phone calls. Maybe it's possible.
    I forgot to backup my phone before I upgraded to 4.2. Oops!
    When I noticed my Visual Voicemail was gone I tried to backup but ran out of memory.
    So I deleted previous backups to make more room. It backed up fine after that.
    I don't think it ran out of memory during the update, but maybe it did.
    Crap!

  • CUPC 8.6 call forward to voicemail

    Hi!
    I am using Cisco Personal Communicator (CUPC) 8.6 and also CUCM 8.6. I have CUPC in Deskphone mode, connected to a 6945 IP Phone. I also have Unity Connection where my voicemail box is hosted. When I want to setup call forward to voicemail button in cupc option, it is not working. CUPC will not handle the options I setup seconds before. If I manually put in a call forward to extension number of voice mail pilot call forwarding is working. also call forwarding to my mobile is working.
    I checked End User settings, IP Phone is associated to my user, also CTI controll is enabled on device and line settings. user privileges are correct. I tried it on jabber client where it works fine. I also restarted CTI and Callmanager Services on the Servers.
    Does anyone has an Idea if this is a general bug in CUPC or does anyone can tell me what the problem might be?
    Thanks!
    René

    Hi,
    If at least one of these phones is set to CF to VM then it will, if not, then no.
    If none of your phones is set to CF to VM CUCM will not send them to VM, that is expected, if you need to ring, phone A, and if it is not answered to go to phone B, C... and so on, and send the caller to VM after you have reached all of these then use a hunt group, (the pilot can be set to CF to VM if nobody answers), if you need to ring all phones at the same time so someone can pick this up, use a hunt group with a broadcast logic.
    If this is for a single user, check 'single number reach' (SNR) or mobility on CUCM.
    Bottom line, there is no way to send a caller to VM if none of the phones is set to CF to VM.
    HTH
    Chris.

  • Voicemail not working.

    Okay. I apologize if this has been covered, but I didn't find any solutions after a quick search. Basically, if someone calls my phone and I don't answer, it kicks into my recorded message and seems to work as it should. However, from my phone, I see that someone called but I am not receiving the voicemail. Previously, turning off the phone and turning it back on would make messages appear. That does not seem to be working at present. I have the 3GS with 3.1 software and everything else is fine. If I go into the voicemail and try to preview the greetings, default and custom, my custom greeting will not play. I get a "retrieving greeting" message at the top and a spinning wheel. It never retrieves the greeting, although the greeting is working for callers to my phone. Any suggestions for fixes would be greatly appreciated.

    I have done some investigating on carrier versions. Two friends that have not updated to 3.1 have carrier version 4.0 Another friend that has updated to 3.1 has carrier version 5.0 like myself. It appears to me that updating your phone to 3.1 updates your AT&T carrier version to 5.0 I have 2 phones I have updated to 3.1 and they both have carrier versions 5.0 The puzzlement is, how can AT&T tell me they don't support anything but version 4.0 when simply updating to the latest iPhone software updates your carrier version to 5.0 Something does not make sense here. Does anyone out there that has updated to 3.1 have a different carrier version than 5.0? Just wondering. It can be found under Settings - General - About and Carrier. I have not hacked my phone. And my voicemail is now working.

  • Jabber and Voicemail Access

    Hello,
    I've configured CUCM and IM&P v9.1 and jabber client 9.2(1), the  chat and the calls work fine but when I try to log in Phone Accounts -> Voicemail I get an error about the credentials, I have all integrated with Active Directory and the user and password that I'm using for voicemail is the same that I use to log in the jabber client wich worked fine.
    Here I attached the error screen.
    What do you think can be causing this??
    Thanks in advance.

    Hi every body,
    I have some problems but not with all the users, is only working with 3 users and the rest of them don't work, I attached the errors that I get when I try to log in Telephony Accounts in the Jabber, I used the Jabber of one User, and from here I introduce my credentials (user and password) and I can get the voice mails (only from de 3 users that is woriking fine), but when I introduce the credentials of the other user I get the error and Can't get the voicemails.
    The 127.23.0.7 is the IP address of the Cisco Unity Connection.
    Please Help Me I'm stuck with this!

  • Jabber voicemail issue

    When we click on the voicemail icon within Jabber, we get "You are not signed in to your voicemail account. Go to the phone accounts tab..."
    When I go to File>Options>phone accounts and and enter my AD credentials for username and password, it says the username or password is not correct.
    Am I entering the correct info for the username and password? Everything is sync'd with LDAP.
    Thank you.

    This may not be your case, but I had this same exact issue last week and it was because the Server Admin had changed the password to the account we used as the CN in our LDAP authentication. Once I updated the password in CUC, the problem was resolved. So, doesn't hurt to ensure the credentials are still good.

  • New Applescript version breaks old code

    Hi there,
    First off, I'm not an Applescripter, but I have one script I wrote a few years back (with help from kind people on the net) to generate and save tiny applications which, when called from within an Adobe Flash executable, would open the required file using the Mac OS native application associated with them (i.e a doc file wouldbe opened by Word if installed, TextEdit if not...)
    It used to run fine on my old Powerbook G4 on an old version of AppleScript, but times change and, one whizzy Intel processor later, I'm trying to get the same script running on OS 10.8 with AppleScipt 2.5.1, with varied results.
    Basically, what the script should do is read a comma delimited file in the same folder as the script, called 'fileNames.csv' which contains the names of all the files that I want the tiny apps to open. Each item will then have its own file created by the AppleScript, named after each item, which get saved in an pre-existing folder in the same directory as the script and fileNames.csv file, called 'fscommand'.
    The example of the fileNames.csv file I'm having issues with:
    yr2_unit_1_tn.doc,yr2_unit_2_tn.doc,yr2_unit_3_tn.doc ... etc up until  yr2_unit_20_tn.doc
    The script always used to work fine, but the new version of AppleScript seems to have broken it. When I run it now, it creates all the .app files up until 'yr2_unit_11_tn.doc.app' but then stalls in 'Running...' mode in the AppleScipts editor, and refuses to save apps for the final nine files in the .csv file.
    It still runs ok from an older AppleScript editor (2.2.1) but this only saves PowerPC applications, which won't run on Intel Macs. And this would be me running away from the problem, rather than attempting to solve it ;-)
    I'm thinking it's a filename issue, as it always seems to break when attempting to save "yr2_unit_11_tn.doc.app" when "yr2_unit_1_tn.doc.app" already exists in the 'fscommand' folder. If I create a new 'fileNames.csv' file which only contains ten entries from 'yr2_unit_11_tn.doc' to  'yr2_unit_20_tn.doc', and run the script to an empty 'fscommand' folder, it processes all the files fine. It just won't do all twenty entries from 1 to 20.
    Here's the script. I know I'm doing something really stupid here, but as a rock bottom novice AppleScripter, I can't see the error, or why it would work in one version of AppleScript and not another. I can post a link to the zipped files if this is any help in solving it. Thanks in advance for any help! :-)
    tell application "Finder" to get folder of (path to me) as Unicode text
    set cwd to result
    set fileRef to open for access alias (cwd & "fileNames.csv")
    set theList to read fileRef using delimiter ","
    close access fileRef
    set theFolder to alias (cwd & "fscommand")
    set theFolderPath to theFolder as string
    #Create the .app files and save them in theFolder
    set NL to ASCII character 10
    tell application id "com.apple.ScriptEditor2"
    launch
              repeat with theItem in theList
                        set x to make new document
                        set x to the front document
                        set theCharacters to characters of theItem
                        set theReversedCharacters to reverse of theCharacters
                        set theReversedFileName to theReversedCharacters as string
                        set theOffset to offset of "." in theReversedFileName
                        set theReversedSuffix to text 1 thru (theOffset - 1) of theReversedFileName
                        set theSuffix to (reverse of (characters of theReversedSuffix)) as string
                        set the text of document 1 to "tell application \"Finder\"" & NL & "activate" & NL & "set cwd to get folder of container of (path to me) as Unicode text" & NL & "open file (cwd & \"assets:" & theSuffix & ":" & theItem & "\")" & NL & "end tell"
      compile document 1
                        set file_path to theFolderPath & theItem & ".app"
                        save document 1 as "application" in file file_path
      close window 1
              end repeat
    end tell

    That seemed to be it. I put a tiny delay in between saving the document and closing the window and the file runs smoothly through all 20 items.
    compile document 1
    set file_path to theFolderPath & theItem & ".app"
    save document 1 as "application" in file file_path
    delay 0.3
    close window 1
    Never thought that I'd reach the day where I was trying to slow the computer down to process something more carefully :-D

  • Help! When I select "Phone" it tries to open and gives me a white screen and closes. I cannot view my missed calls or voicemails.

    If anyone knows anything about this...
    When I select "Phone" on my home screen the iPhone attempts to open it, brings up a white screen and then will shut back down. I have 8 missed calls or voicemails yesterday and I couldn't check any of them. Does this happen to anyone else?
    Also, when I receive a call and I answer it does not give me the ability to end call or any of my options (sources, keypad,etc.) during the call.
    Basically, I can't do anything with my contacts, favorites, missed calls or voicemails.
    Can someone please help?

    I have tried that multiple times. I have also made sure that I have the latest updates. Would haveing 27,000+ contacts have anything to do with it?
    Sometimes it works and sometimes it doesn't

  • Jabber and Voicemail Notifications

                       Hello guys!
    Is it possible to receive voicemail notification on both jabber and desk phone at the same time? For example, if a user has a desk phone as primary extension on CUCM 8.6, the Unity use that extension for VM. But if the user has also a jabber client version 9.x for Windows and wants to receive voicemail on jabber, what is the best design option? Assign the same DN to both jabber and desk phone?
    Also, I set up visual voicemail for jabber but left a voicemail in jabber and no notification appeared, where should i look into? The voicemail server and profile with users were added in CUP.
    Note: The scenario is a BE6000 platform with CUCM8.6, CUCxN,8.6, CUP8.6 and CUPM8.6.
    Thanks in advanced!

    Why would you have different extensions on desk phone vs. jabber? Normally this is not desired for user to manage 2 different numbers.
    If however that is a requirement you can always define alternate extension on Unity Connection.
    For VM configuration did you configure all the service in CUPS server, i.e. mailstore?
    HTH,
    Chris

  • How can I get a new copy of the Voicemail app for my LG Spectrum?

    How can I get a new copy of the Voicemail app for my LG Spectrum?  It no longer works....the screen say Loading please wait....the
    !Visual Voice Mail - A Visual Voice Mail error has occurred.  Please try again. OK   I've tryed several times with the same message.  I've
    deleted the app from my screen and replaced it from the Apps Library....still the same message.
    I cannot find an answer on MyVerizon.  Any ideas?
    Thank you,
    Dee

    OK, at least 3 is working.
    I don't know how you have a Tape Recorder icon on your Home Screen. I cannot add one myself. But, I am running Holo Launcher in replacement of the default LG "Optimus" User Interface. It's much better in my opinion.
    Try long pressing the icon and select Edit and maybe you can change some attribute of the icon.
    Another thing you could do, is long-press an empty area of your desktop, to add an icon. Select Shortcut, then Select Contact, and scroll through your contact list and choose the contact that you added for *86.
    You realize if you have voice mail you haven't heard, there is a tape recorder icon in the notification bar, which you touch and pull down, then press it to dial voicemail.
    If that functionality doesn't work, you MIGHT want to consider doing a factory data reset on your device, but that is going to nuke all your personalizations and cause you work to set up again.

  • Applescript to suck ical dates into iweb

    I was referred to this forum from the iweb forum (http://discussions.apple.com/thread.jspa?threadID=2513935&tstart=0).
    Here's what I would like to do: I am an athletic director and would I have entered all of my school's athletic contests into iCal. I would like to set up something in which iWeb can pull the events out of iCal (I have mobileme) into a "week at a glance" type of display on our athletics page (made with iweb). Ideally it would automatically update so that as events are completed, the next events would show up. I don't want to embed a calendar.
    I want something that looks like the table on the right of this page: www.twu.ca/athletics.
    Is there an applescript that could help me pull dates from iCal into a text box in iWeb?

    Hi,
    You may be able do this with an Applescript. However there is not enough information supplied to know.
    How are ther events formatted in iCal? Do they contain the full name of the person? Do they say how old they are? Are the people already in Address Book, or would they all be new cards?
    Best wishes
    John M

Maybe you are looking for

  • Need changes in standard data element

    Hi gurus, I want to change in one of SAP standard data element for adding search help into it. for this fields there is no user exit or any enhancement is present. I have taken access key from our basis guy after putting access key i am unable to cha

  • Designer Control automaticaly opens its Preview Window

    Hey Guys I am having a problem and hope you can help to fix it up Here is the code i use to open a new Report Using RDC XI with VB6 Set m_Report = Nothing Set m_Report = m_Application.NewReport CRDesignerCtrl1.ReportObject = m_Report The Above Statem

  • Contacts in Mail with Lion

    Just downloaded Lion and now I can't see my contacts when in Mail. There used to be a link to them on the toolbar ?

  • Java for Mac OS X 10.5 Update 2

    Software Update keeps telling me that this update is available, even after multiple "successful" installations and reboots. Any ideas why? $ java -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-28

  • Music not correct

    Yesterday I copied some (legal) cd's via itunes to my iPhone. When I play them, the songs start in at about 10 seconds in the song, after 10 seconds it goes to the start of the song, then it stops again to play along. Not one of the songs will play r