Applescript to modify contacts custom field?

Hi-
I want to be able to search my address book the way I used to on my palm... by first initial followed by last name. For instance, if I wanted to search for John Smith, I'd enter "jsm". It's a highly efficient way to search, and I miss it dearly.
So, I would like to write an applscript that I could run on a nightly basis that would go through my entire contact list and look at the "Maiden Name" field. If the field is empty, the script would fill it with the first letter of the first name, followed by the entire last name (if a last name exists). Obviously, it would skip businesses where no names existed.
Bonus points would be doing this in a custom field, but I can't figure out how to get Applescript to read custom field labels at all!
Thoughts?
Thanks!

HI,
This may help you to write your script.
tell application "Contacts"
activate
          set the_people to every person
          repeat with tp in the_people
                    try -- lazy way of skipping companies
                              set fn to first name of tp
                              set l_n to last name of tp -- ln is apparently a reserved variable name
                              if l_n is not missing value then -- it's probably a person and not a business
                                        if maiden name of tp is in {"", missing value} then -- this person doesn't already have a maiden name
                                                  set mn to text 1 of fn & l_n
                                                  set maiden name of tp to mn
                                        end if
                              end if
                    end try
          end repeat
save
end tell
If you decide you don't like it, this will remove all maiden names - including real ones.
tell application "Contacts"
set the_people to every person
repeat with tp in the_people
          try
                    set maiden name of tp to ""
          end try
end repeat
save
end tell
I have a vague memory of trying and failing to get anywhere with scripting custom fields. I'll give it a go though.

Similar Messages

  • HT1245 Google contact sync to Contacts - custom fields

    What happens to the custom fields I created in both Apple and Google that aren't the same in the other product, do they merge as a new field? Thank you.

    Same problem here, but happened on my first sync.

  • Editing of contacts: "custom" fields?

    Another feature missing from my 925 wp: when we edit a contact, on the old symbian devices, we had as a last option "custom" in the field area. For example, it may be that a contact has three or more email addresses, but we can only have the option of using three, the same with phones: there are a lot of options amitedly, but a cusomisable one would be great. ("work 3", "Company 2" , and it would be great if within the "company" or work" fields, we could perhaps specify
     a "sub" field for a works extension, which would automatically dial, when the contact has been dialled..
    Perhaps another WP upgrade possibility?

    Windows Phone Feature suggestions
    http://windowsphone.uservoice.com/forums/101801-feature-suggestions

  • MS Project to detect task level changes and record a date modified in custom field

    I need to know the date and time that a task field (mainly task name, start, finish) has been changed. 
    I found this topic within EE and it works great but...
    http://www.experts-exchange.com/Software/Office_Productivity/Project_Management/Q_27879745.html#a38636192
    If (for instance) you change a duration which affects predecessors and only the task that you changed gets a date/time stamp.

    John,
    Thanks for the help.
    I have posted this to EE and received one response from the guy who answered the question in the link I provided.  Here is his recommendation to a similar question (underlined at end) and it works great but does not work for changes to successors. 
    Only the record that receives the actual change gets stamped.
    I did think of the change highlighting but not sure how to take advantage of it.  I need to know the order that the changes occur in a session as well as the time of day.  That is why I thought a time date/time stamp would work for both. 
    Is there and event for rescheduling of successors?
    What is project looking at to see changes for the "change highlighting" format.  Is it an event that can be captured.
    Hi,
    the pointer to events above is correct. This is what you need to do:
    1. in Microsoft Project open the VBA Editor (Alt+F11). On the left side you'll see the "ProjectExplorer". Expand the "ProjectGlobal (Global.MPT)" piece.
    2. In the first section of "ProjectGlobal(Global.MPT)
    " you see "Microsoft Project Objects" and below that "ThisProject(Global.MPT)".Doubleclick it and insert the text between
    the --- into the Editor window on the right.
    Sub Project_Open(ByVal pj As Project)
        Call modEvents.StartEvents
    End Sub
    3.  In the second section "Modules" add a new MODULE. Name it "modEvents". Copy the text between the --- into the new module:
    Private oMSPEvents As clsEvents
    Sub StartEvents()
            Set oMSPEvents = New clsEvents
    End Sub
    4. In the third section "Class Module" insert a NEW CLASS MODULE. Name it "clsEvents". Doubleclick and insert the text between the --- into it
    Private WithEvents MyMSPApplication As Application
    Private Sub Class_Initialize()
        Set MyMSPApplication = Application
    End Sub
    Private Sub MyMSPApplication_ProjectBeforeTaskChange(ByValtsk
    As Task, ByVal Field As PjField, ByVal NewVal As Variant, Cancel As Boolean)
        tsk.Date1 = Now()
    End Sub
    Sounds like hell? Yes, but that's how it works: the first part is always executed when you open a project -> the "StartEvents" initialises the new class and tells Microsoft Project to use events (which
    is does NOT in the default). The last part "watches" all changes and whenever you change something it sets the Date1 field to the current date and time.
    Please let me know if you need any help!
    Regards
    Thomas

  • Template inclusion/Javascript issue for doc header's custom fields

    Hi all gurus,
    premise: I'm absolutely a newbie about templates and Jscript.
    I'm facing a strange behaviour for a field and I'd like to get your help on it, I'm running out of ideas.
    I modified a custom field, a checkbox, which automatically makes a second custom field active and editable.
    The logic is really simple: if the checkbox ( ZZ0LEGGE ) is checked, then the second field ( ZZ0DESCR ) is editable.
    This is managed in the template by using a Jscript function that is triggered by the event OnClick related to the checkbox.
    These two field are part of a template, say T1, which is used as an include in a pair of "main", custom templates, say T2 (additional header custom data) and T3 (document variant). These two screens are custom on an old SRM3 system.
    When working on the additional header custom data (Template T2), both buttons work fine; each time the checkbox is checked/unchecked, the screen is updated and the second field turns into active/not active as consequence.
    Working instead on the document variant screen (Template T3) leads to a wrong behaviour.
    Checking/unchecking the checkbox doesn't refresh the screen accordingly to the selection, but loads the T2 template.
    Guess there's something missing on the Javascript fuction associated with the checkbox in T1, because it will always trigger a refresh of T2, no matter the template in which it is included.
    Here are the templates:
    Template T1: [SAPLBBP_PDH_CUF 100 |http://pastebin.com/U39i5j7N]
    Template T2: [SAPLBBP_CTR_UI_ITS 9001|http://pastebin.com/3AhKRjt7]
    Template T3: [SAPLBBP_CTR_UI_ITS 9003|http://pastebin.com/4ZHtjz0r]
    The checkbox field in T1 is called ZZ0LEGGE; the "controlled" field is instead ZZ0DESC.
    Waiting for your help... thanks once again

    Ok I found an interesting starting point to focus on... I changed the simple fuction associated to the event onClick(), triggered when the checkbox is set/unset, simply using the parameters for TargetOkCode used in Template 3:
    function zOkRefresh(){
            TargetSetOkCode('`PB_OKCH.okcode`','','`bbpformname`'); //new (works for T3)
    //        TargetSetOkCode('=ZCTR_CUST1','','BBPForm');                //old one (worked for T2)
    and now the checkbox works properly in Template 3 but - obviously - stops working in Template 2.
    So it seems that zOkRefresh should dynamically decide which parameters must be used, depending on the "upper" template:
    - if the template that includes T1 is T2, then call TargetSetOkCode('=ZCTR_CUST1','','BBPForm'); if T1 is used in T3, then call TargetSetOkCode('`PB_OKCH.okcode`','','BBPForm').
    Since I'm not able to write down the script described above, can anyone help me putting that IF statement in script code? How to determine what's the "including" template in Javascript?
    Thanks again!

  • Add customer fields in Shopping cart and purchase order

    Hi,
    I have to add fields(moder of transport, country origin, country destination and more) in Shopping cart and purchase order in SRM system and remotle i have to update the same data in R/3 System.
    could you please guide how to add the fields in screen.
    regards
    Shakeer

    Hi
    We have done this type of requirement several times in our previous SRM Implementations.
    <b>You need to create an Append Structure in the Standard Structure to create the custom fields in your case.</b>
    <u>Refer this link below for details.</u>
    http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb61446011d189700000e8322d00/frameset.htm
    <b>Define the fields of the append structure. You can proceed as when creating a normal structure with two restrictions (see Creating Structures).
    The fields of an append structure must lie in the customer namespace, that is the field names must begin with ZZ or YY. This prevents conflicts with fields inserted in the table by SAP.</b>
    http://help.sap.com/saphelp_srm50/helpdata/en/5b/c9df3b6ac34b44e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/28/857a1867b52e4f8472c5d49209a675/frameset.htm
    <u>BBP_CUF_BADI_2 BADI will be used to control the properties (hide/unhide, input/output enable or disable) for those customer fields you created in the above append structures.
    BBP_DOC_CHANGE_BADI for defaulting or modifying the customer field contents, incase required.
    BBP_DOC_CHECK_BADI for issuing customer messages for the customer field contents (incase data is entered incorrectly) , incase required.</u>
    Let me know incase you face any issues.
    Regards
    - Atul

  • Error Custom Fields MB_MIGO_BADI

    Hi all,
    I am implementing MB_MIGO_BADI and calling a screen with an additional fields not standard to migo.
    In the method LINE_MODIFY have put:
    MOVE:    ls_extdata_new-zzfield TO cs_goitem-zzfield.
    In the execution on having modified the field it jumps the following message MIGO049; "BAdI:  is not allowed to modify the field content of zzfield".
    I have added the field zzfield in the table mseg and goitem, but it do not belong why it jumps this message.
    I have seen the method line_modify_badi (include LMIGOKL3) and is called to the method lcl_migo_screenmodification=>get. This one reads of a table of active fields in this execution and the field zzfield is not. Because of this jumps the message.
    Not where this table is refilled (probably in the method screen_modify_mode?).
    There is a loop where it is said in order that fields to do this checkup but I am not capable of creating an ENHANCEMENT-SECTION in this point. It jumps the message " In this way only can treat implementations of extension " (ED286).
    Can you help me, please?
    Thanks in adavance.
    Regards
    Husalban.

    Hi Prabhu,
    I see the sample code, but use a standard field. The code that I have put is similar but with a custom field.
    My problem is in the method LINE_MODIFY, it gives me a mistake on having tried to modify a custom field of the structure cs_goitem.
    Not if I have to do something on having inserted a custom field to this structure in order that it works correctly.
    Thanks,

  • How can I create a custom field in contacts and have it appear in ICal?

    How can I create a custom field in contacts (death date) and have it appear in calendar?
    Birthdays seems to work fine but I'd like to do the same for a custom field called Date of Death

    By default, iTunes convert files to type AAC which has an extension of .m4a
    For iTunes to recognize them as Audiobook files, the extension needs to change from .m4a to .m4b
    This can be done a number of different ways. Here are 2 (beginner and advanced)
    . simply, by renaming each file from windows explorer
    . more complex, by using Start/Run/cmd to get a "DOS" type window,
    using the command "cd" to change to the directory that your files are in
    and entering "ren *.m4a *.m4b"

  • CProjects -error after modifying and then reverting custom field control

    Hi,
    We want to make a field non-mandatory in cProjects. We first changed the config of the field in the custom field control  in SPRO by making it changeable.But after that cProjects is giving a dump when we try to view or create any project.
    We reverted this change and restarted the servers but still see the dump.
    Any pointers on how to solve this issue will be helpful.
    Thanks,
    Simmi

    Vivek, Thanks for your reply.
    We did not modify the standard field control.We just tried to make the one of the standard fields 'Changeable' in the custom field control we have.But we got the dump, so we reverted the change back to 'Mandatory'.
    Now everything is same in the development server as other servers.. but still the dump shows up. Tried clearing IE cache , restarting server.. but the dump doesn't want to leave it seems.. Any ideas on what else we can try ?
    Thanks,
    Simmi
    Edited by: Simmi Balakrishnan on Sep 15, 2010 4:15 PM

  • PARTNER_UPDATE modify custom field

    Hi all,
    I need to do some modifications in partner data, the problem is that the badi PARTNER_UPDATE is only triggered if a standard field is changed.  The same happens with others badis like BUPA_ADDR_UPDATE.
    I've added a custom field and I want to modify it and other things when the user push "Save".
    Do you know if is possible to trigger this badi manually?
    Thanks in adavance.

    Solved adding an enhancement point in the FM BBP_CHANGE_ORGANIZATION.

  • SAP CLM: Modifying Item detail to include a custom field

    Hello,
    Is it possible to modify the line item page to include another custom field ?
    I navigated through Extension Definition configuration but there is no Class for Line Item. Is this even possible?
    Thanks,
    Arijeet

    Hi Prasad,
    Thank you for your help. But I am unable to find out the correct class to include the extensions. As per the Reference Guide the class ID is 1604 but I am unbale to see this while trying to add the fields in Extension Definition Configuration.
    It would be great if you could provide some more concrete steps.
    Thanks,
    Arijeet

  • Can you retrieve  contact custom made fields with the BC API?

    I have added Custom Fields atatched to my Contact CRM
    I can ContactList_Retrieve the contacts list but would like to add the custom fields  attached to each contact..
    but so far had no success yet! Is it possible?

    Thanks Liam!
    Got them.
    Also is it possible  to retrieve contact list not with the last update date but created date?
    and can we pass a range date?
    as i have found that it is quite slow if you go back in time, as it downloads all the records until the present time.

  • Can Me_REQ_POSTED (in ME54) be used to modify custom fields in EBAN?

    Hi ,
    I have a requirement that I have to validate the approver authorization when he tries to approve the PR. I am using the badi ME_REQ_POSTED and the method is 'POSTED'. I have created a z implemetation including this method and the validation are working fine, But at the same time I need to update some custom fields while this check in the BADI.
    I have tried BAPI_PR_CHANGE, direct using update statement but still unable to update the custom fields in EBAN TABLE.
    I have noticed that at point of update custom field is  getting updated but when later on the release status gets updated from the system my custom field value also vanishes.

    After BAPI you need to use CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    Are you using it?
    Apps

  • In Address Book, why does Apple let you create custom fields in the Template cards but not have them available for importing?

    I open Address Book, go into Preferences, select Template and under the Names field (friend, assistant, father, etc) I add a custom field called "Principal".
    I also add two more custom fields in the Email area.
    Quit Address Book then relaunch. Add a new contact and the new custom fields, Principal, etc. are there. All good so far.
    I have a Now Contact file with about 200 contacts in it. I export all fields as a Text file, Tab delimited. No problems there. With Address Book launched, select Import, pick the text file, leave Text Encoding on Automatic and click Open.
    The window that shows the fields for Address Book and fields for the text file side by side opens. This is where you match up the correct fields for importing. If I go to one of the fields from the text file that I created a custom field for, click under the Address Book heading on the Do not import, scroll thru the Apple choices of fields, none of the custom fields show up. Only the original Apple ones are there. Why does Apple let you create them in the Template area but not have them available for importing? Does anyone have suggestions on getting around this?

    While most likely not of interest to you, Spotlight can also tell you where the files it finds are located
    Hover the mouse pointer over the name, and press Command-Option and the path to the file will be displayed.
    As for opening a terminal session in the directory where a file is located, there is Applescripts that do just that as well as specific features in Lion/Mountain Lion terminal:
    <http://stackoverflow.com/questions/420456/open-terminal-here-in-mac-os-finder>
    <http://hints.macworld.com/article.php?story=20110729034827358>
    <http://www.macworld.com/article/1047793/folderinterm.html>
    <http://www.macworld.com/article/1161876/open_finder_folder_in_terminal.html>
    <http://www.macobserver.com/tmo/article/os_x_lion_open_a_folders_location_in_term inal>

  • How to add custom field to ical

    Hi
    I run a small business from my mac pro and my iphone. I would like to get a good workflow but it seems I am missing a few bits of information.
    First I would like to add custom fields to ical so that I can gather all the information I need in one spot. For example, I create a meeting with new client Tim Smith on Friday so I want to enter his name and contact info into ical because I need his address and phone number on the event so I can reference it.
    Then I would like to find a way to automatically create a contact card based on that information. If I can find an apple script that reads the fields in Ical and creates new contacts based on new events that I created.
    Then I would like to automate extracting the email addresses to send out preformed group mailers for people who were in my calendar that day ie "Thanks for meeting with me, I think we got a lot accomplished and hope to see you at the next meeting." etc etc
    Then also automate reports based off of my ical events such as "Report for how many times I had a meeting in the Blue Room this week" or "How many times did I meet with Timothy Smith"  this year
    I have tried automator and it doesn't seem strong enough to do this so I am thinking AppleScript but I am not very good at it. Anyone have any ideas on any of these issues?

    Tried the iCal forum and support
    www.apple.com/support/ical
    Tried Lion Community?
    you have notebook and tower?
    www.apple.com/support/macbookpro

Maybe you are looking for

  • Can't create a new real track...

    Ok I've encountered another problem, and this one prohibits me from doing basically anything. The last problem in the post I made with the title "Mysterious crackling/buzzing" seems to have worked itself out (yes!!!). First I'll tell you my setup. I

  • Re-running Payment run

    Here is confusing and a challenging one for you. We use the tcode F110  to pick up the to-be paid documents, create a proposal, and then run the payment for them. We had 5 documents that were to be paid. Ran F110. Proposal worked fine. However 3 docu

  • Luminosity and saturation blending modes in FW CS4 differ from their equivalents in PSE 7

    Example: Upper bitmap is filled with RGB(232,168,89) color and the lower with RGB(61,114,158) . Blending results are as follow: Luminosity in FW CS4: RGB(67,121,175) Luminosity in PSE 7: RGB(137,190,234) Saturation in FW CS4: RGB(60,109,158) Saturati

  • It is possible to define the ranges of the quantities?

    I have this chart, i put this ranges(300,350,400,450,500,550,600,650,700) !http://img242.imageshack.us/img242/8468/rangosn.png! I want to show ranges per 100(300,400,500,600,700) i found in the documentary and i didn´t find nothing. This is my code c

  • IMac G5 shuts down from Sleep mode

    My iMac G5, PPC, 10.4.11 goes to sleep when told or scheduled. Clicking the mouse or a key to wake up the system causes it to power down. We have been running 10.4.11 for some time, no system upgrades. Any thoughts?