Parsing Notes Field in Address book with Applescript

I've been working with Applescript to create a custom workflow for a mailer app that I'm creating. I want to store information about a particular contact in one of the following two formats:
Either:
Test 1
Test 2
or
[aDate] | Text text text text
The | is a delimiter. I want to get the aDate and use that as part of a text and then parse this string into the following:
{"aDate","Text text text text"}
Unfortunately all of my attempts seem to treat the notes field as one long string. Has anyone been able to parse the notes field of data?

Once you get the note paragraph into a string (noteString), useset oldDelims to Applescript's text item delimiters
set Applescript's text item delimiters to "|"
set theDate to first text item of noteString
set theText to second text item of noteString
set Applescript's text item delimiters to oldDelims
While Applescript will reset the delimiters, you should always do it yourself as I did.

Similar Messages

  • Adding Images To Note Field In Address Book

    Hello chaps,
    I'd like to be able to take a screengrab from streetmap and bung this into the notes field of Address Book so that I have a handy map of where my contact is whether I'm online or off. Anyone know of a way to do this?

    So far as I am aware, the notes field will only accommodate text. However, you could consider using the URL field for a reference to a file containing the map data, such as:
    file:///Users/username/Documents/Maps/picture%201.png

  • Activate / open the address book with applescript

    Hi,
    I try to open the address book and select a vCard with AppleScript.
    If the address book is closed I can achieve this (open / activate the address book) with:
    tell application "Address Book"
    try
    activate
         end try
    end tell
    If the address book is hidden (command+H) I can use:
    tell application "System Events" to set visible of process "Address Book" to true
    However if the address book is closed (command+W) neither of these commands are able to put the address book to the front.
    How can I activate the address book (make it visible and front) in this case?

    Hi,
    Try this:
    tell application "Address Book"
      activate
              set visible of item -1 of windows to true
    end tell
    Best wishes
    John M

  • Can not use note field in address book

    I am unable to use the note field in Address Book

    What would we do without you? Thanks, It works now, but it isn't as easy as before, you have to find EXACTLY the right spot, which is NOT GOOD!
    Hopefully, there will be a fix.

  • Unable to edit "Note:" field in Address Book

    I have updated to Mac OS X 10.6.4 one week ago (from 10.5.).
    Now for the first, I am trying to edit the "Note:" field of one of my contacts, but I am neither able to add text, nor can I delete text.
    I have 47 lines of text in that Note field and wanted to add a few words, but after typing it, it keeps disappearing after a few seconds. If I delete a few lines of text, they keep reappearing after a few seconds.
    Editing the Note field (which has less lines of text) in another contact first exhibited the same behavior, but now works flawlessly.
    Having the "Edit" button depressed or not, does not make a difference.
    Address Book Help says that this happens when there is not enough disk space, but I have over 41GB left.

    Hello Marcus and others,
    I have experienced the same issues with my Address Book (version 5.0). First things first, let me suggest you complete a back up of your address book:
    1. Go to the File drop down menu
    2. Click on Export
    3. Select *Address Book Archive* from the 2 choices
    4. Choose where you would like to store this back up. Let's just say the Desktop for now.
    5. Disclaimer, any unsaved data will be lost during this reset, so please back up all files you will need.
    6. After you have successfully archived your Address Book, turn off your computer.
    7. Now here's the important part, hold down the power button for at least 6 seconds or until you hear a loud sound or tone. This should reset your settings back to default.
    This is how I just fixed the problem with editing the Notes of my contacts in my Address Book 5.0
    Good luck and I hope this helps someone.
    Nupeologist

  • Bug in editing of "Note" field in Address Book

    If an address card starts out with an empty Note field, it stays that way,
    as there appears to be no way to enter text into that field in Edit mode.

    I think it is a protection mechanism - edit mode is for changing details of addresses etc, but the notes field does not need edit mode. I suppose it should be editable in either mode, but it isn't, so just turn of editing if you want to edit it
    AK

  • Backup Address Book with AppleScript

    I'm using Address Book : Version 4.0.3 (483)
    I try to make a script to backup the address book (database), theis line doesn't do anything : tell application "Address Book" to save addressbook
    I try to use the GUI but again it doen't work :
    tell application "System Events"
    tell application process "Address Book"
    set its frontmost to true
    click menu item "Sauvegarder le carnet d'adresses" of menu "Fichier" of menu bar item "Fichier" of menu bar 1
    delay 3
    click button "Enregistrer" of sheet 1 of window "Carnet d'adresses"
    end tell
    end tell
    In English Fichier = File & "Sauvegarder le carnet d'adresses" = "Back up Database" (menu item) and "Enregistrer" would be in english "Save"
    Thanks for your Help.
    HDR

    Hi,
    Try this:
    tell application "Address Book"
      activate
              set visible of item -1 of windows to true
    end tell
    Best wishes
    John M

  • Not all fields in Address Book are syncing

    For some reason not all the fields in my address book get synced from one computer to another. The template for all the fields in address book are the same on the different computers but the 'Department' field does not get synced. Any ideas how to fix this?

    So sorry...yes I'm using Contacts from Outlook.
    When I launch Field Mapping from the Advanced Settings for Address Book, the Handheld fields that are available for me to map to my Contacts in Outlook, do not include the fields previously mentioned so there is no way for me to map them to a destination field in Outlook.
    Maybe I'm using an old version of Desktop Manager??? Mine is version 3.6.0.63 (June 11 2003)...could you please let me know what version you have?
    Many thanks!

  • HOW TO SEND PERSONALIZED EMAILS (WITH SAME MESSAGE) TO ALL ADDRESSES IN THE ADDRESS BOOK - WITH RECIPIENTS SEEING ONLY THEIR NAME BUT NOT WHO ELSE IS GETTING IT

    HOW TO SEND PERSONALIZED EMAILS WITH THE SAME MESSAGE, BUT WITH THE INDIVIDUAL RECIPIENT'S NAME... (OR NAME AND THE EMAIL ADDRESS) TO ALL ADDRESSES IN THE ADDRESS BOOK - WITH RECIPIENTS SEEING ONLY THEIR OWN NAME WITHIN THE BODY OF THE MESSAGE TO THEM ?
    ALSO, HOW TO ELIMINATE ALL THE OTHER NAMES FROM THE LIST - SO THEY CAN NOT SEE WHO ELSE IS ON THE MAILING LIST, AND WHO ELSE IS GETTING THE SAME MESSAGE?

    In the csv file, the column headers must match the the special references in curly brackets.
    So you either change the column header in .csv file or the bit in the curly brackets in the Template email.
    To change the column header:
    In the example shown below, I wanted to use the first two columns
    'First Name', 'Last Name' note the exact spelling.
    I also wanted the email address which was in a column called 'Primary Email'.
    To make it easier for me, I copied the Primary Email column and inserted it into the third column position and then changed the column header name from 'Primary Email' to 'Email'. (This meant I still had the original column header just in case). see image below.
    But you could just change the column header name from 'Primary Email' to 'Email' without moving column about - up to you.
    At this point check that all the contacts do have a valid email address.
    then save the file.
    If you do not want to edit the .csv file, then you need to edit the template email.
    eg: {{First Name}} {{Last Name}} <{{Email}}>
    change to : {{First Name}} {{Last Name}} <{{Primary Email}}>
    If still having an issue, please post two images.
    One image needs to show the row of column headers used in .csv file.
    The other image needs to show the Template email, so I can see how you have used the curly brackets.

  • Can I merge my iPhone address book with my iMac address book? I do not want to replace one for the other, just combine.

    Can I merge my iPhone address book with my iMac address book? I do not want to replace one for the other, just combine them.
    It seems that you have to choose one or the other, keep iMAcc addresses or iPhone.

    Indeed you can merge the address book using iCloud. You can find the info here: http://support.apple.com/kb/TS3998. I am not sure if you can de-duplicate though.
    If that doesn't work or you want more out of your address book, you can always try connex.io (I work for the company). It's a service that automatically syncs, deduplicates, cleans and updates your address book across many different devices and services. If you want to try it out, you can get a free trail version at www.connex.io.
    Good luck!
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.
    <Edited by Host>

  • Contact photos are not showing up in Mail message list, even though the message will link to the contact card in Address Book with the photo in it.

    I'm using Mail 5.3 and Address Book 6.1.3 on X 10.7.5. I want my contact photos to show up in the message list on Mail, but only some of them do, even though the message will link to the contact card in Address Book with the photo in it. I've even tried replacing a photo that doesn't show up with a photo that does show up for a different contact but no luck. I am syncing to one other Mac, an iPhone and an iPad via iCloud.

    I'm using Mail 5.3 and Address Book 6.1.3 on X 10.7.5. I want my contact photos to show up in the message list on Mail, but only some of them do, even though the message will link to the contact card in Address Book with the photo in it. I've even tried replacing a photo that doesn't show up with a photo that does show up for a different contact but no luck. I am syncing to one other Mac, an iPhone and an iPad via iCloud.

  • Search option does not work in address book

    The search field (upper right corner of window) does not work in address book (version 4.0.5) of my friend's Power Book. I eliminated the possibility of a corrupt plist (preference) file by dragging them to the desktop and restarting but it still didn't help. Any other ideas?
    Meg

    If searching in Spotlight works, I don’t know what could be the problem. You may try this:
    1. Open Address Book.
    2. As an extra safety measure, do File > Back up Address Book and save the backup wherever you wish.
    3. Go to Address Book > Preferences > vCard, set the vCard Format to 3.0 and check Export notes in vCards. Close the Preferences window when done.
    4. Select the All group in the main Address Book window and do File > Export Group vCard (the command should read “Export Group vCard”, not just “Export vCard”).
    5. Quit Address Book, Mail, and any other applications that might use Address Book for something. Or just quit all applications to be on the safe side.
    6. In the Finder, go to ~/Library/Application Support/AddressBook/ and trash any ABPerson.skIndex files you may see there. Open Address Book and check whether the problem is fixed.
    7. If the problem persists, quit Address Book again, in the Finder go to ~/Library/Application Support/, and move the entire AddressBook folder out of there, e.g. to the Desktop (to be deleted after fixing the problem and making sure you don’t miss anything).
    8. Open Address Book and try doing File > Revert to Address Book Backup to restore the backup you made in step 2. If the problem persists, repeat step 7 and this time try doing File > Import > vCards to import the cards exported in step 4.
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. That is, ~/Library is the Library folder within the user’s home folder, i.e. /Users/username/Library.

  • Address Book with Thunderbird

    Hello:
    Is there a way to use Address Book with Thunderbird. I have tried to import my
    addresses from Address Book into my Thunderbird address book, but it does not happen?
    Thanks

    You might try Address Book Exporter 2.1.2:
    http://www.versiontracker.com/dyn/moreinfo/macosx/14667
    Use it to export your Address Book to a text file and then import from the text file using Thunderbird's Tools > Import. Go through each individual record by hitting the Next button and use the Move Up and Move Down buttons to match the data in the Address Book fields to the Record data to import. A bit time consuming, but it can be made to work. Good luck.

  • Sync address book with Google Problems

    I have just enabled the option to sync my address book with my Google contacts account. Before i sync'd i deleted everything in the google contacts as it was way out of date, The sync process appeared to have worked as all contact info from address book appears in my google account, but then i get a message indicating that more than 20% of the contacts in the OSX Address book are going to be changed, how can this be? ...
    Any ideas??
    thx
    John

    John, I believe the answer lies in the subtle differences between contact fields used and populated by Address Book, and those used and populated by Google Contacts: they do not utilize the same fields for what, on the surface, appears to be the same info. For example, if your Address Book entry contains two words in the last name field, Google imports this as one word for middle name and one word for last name. The sync back from Google to Address Book results in "duplicate" entries, and the warning message that your Address Book entries will be changed.
    I just spent two days trying to get this to work the way I wanted it to (I just got a new phone that syncs with Google Contacts. I did just what you did and found just what you discovered. It drove me nuts.
    I concluded it what possible to line it all up between the two, but the amount of manual actions necessary on my part was not, for me, worth the time expended to do it. That's as far as I got.

  • Cannot configure to use exchange address book with thunderbird

    Dear Support,
    I have followed the following link to configure exchange address book with my thunder bird client( I am using the latest version), it is working perfectly fine with some computers, but for few it is not working.
    the strange thing is i am not getting any error, when i am typing any name in the address book field it is not giving any results, where as same settings are working fine with other users.
    any help will be highly appreciated.

    sorry forget to post link i followed
    http://community.spiceworks.com/how_to/32654-configuring-mozilla-thunderbird-to-use-your-domain-s-global-address-book

Maybe you are looking for

  • Artwork on Safari app on dock has gone missing! How do I get it back?

    Here is a screenshot of the issue. Earlier it was the normal icon, but now it looks like this.

  • IPhoto doesn't recognise iPhone

    This is contrary to what most are experiencing! I have some photos on my 3G iPhone and cannot get them into iPhoto (08). I have tried turning off the auto-sync with iTunes. I've toggled the auto-import in iPhoto. It worked last week! All I can think

  • Block material for Sales Area & Customer.

    Hi. I want to block material for particular Sales area. For that i used  "X-distr.chain status" &" DChain-spec. status" in Saleas Org1 Tab of material Master. Now in Sales Order Creation i am getiing Warning message as "Material 95343431321 has statu

  • Idoc Process code- Inbound S.Order

    Hi!     Could any one give me the process code for inbound processing sales order update.   Looking for your Help.   Thanks in Advance   Rahul.

  • IPhoto keywords lost on iPhoto Library import

    I'm running 10.6, and as such I'm running iPhoto 2009 (v8.1.2) and Aperture v3.2.4.  I've imported my iPhoto library using the "Import->Iphoto Library" command into a newly created, blank Aperture library.  It runs smoothly, but after the import is c