Jump to content

Prepending text to 'notes' field in Contacts


Recommended Posts

Hi all,

 

I'm looking for a way of prepending notes to a contact using Alfred. After a conversation I want to be able to add a note to a Contact with a datestamp. I'm ok to put the datestamp in myself (using text expander) but I'm wondering if this is feasible using Alfred?

 

Eventually each contact will have a series of notes on meetings with that contact.

 

I'd appreciate the help!

Thanks!

Link to comment

In theory, the following AppleScript should prepend $1 to the notes of the contacts currently selected in Contacts.app.

Unfortunately, it isn't working right now on my machine (it updates the notes, but Contacts.app doesn't show the update).
 

on run (argv)
    -- Quit if no note was provided
    if (count of argv) is 0 then
        log "No note provided"
        return
    end if
    set theNote to first item of argv
    tell application "Contacts"
        set thePeople to selection
        if (count of thePeople) is 0 then
            log "No contacts selected"
            return
        end if
        
        repeat with aPerson in thePeople
            set curNote to the note of aPerson
            if curNote is missing value then set curNote to ""
            set newNote to theNote & linefeed & curNote
            log newNote
            set note of aPerson to newNote
            log "Prepended note to " & (name of aPerson)
        end repeat
    end tell
    
end run
Link to comment

Thank you for this. Interesting that this is technically possible!

 

Do you know of an app that is designed to work like this? Basically, when I remember something about someone that I want as reference info (not as an action), I wanna be able to effortlessly note that down in an appropriate place. I find by the time I've opened the contacts app, found the person, and the app hasn't crashed, I've forgotten what that fact was.

 

 

In theory, the following AppleScript should prepend $1 to the notes of the contacts currently selected in Contacts.app.

Unfortunately, it isn't working right now on my machine (it updates the notes, but Contacts.app doesn't show the update).
 

Link to comment
  • 2 years later...

Hi all,

 

are there any news on this topic? I have the same issue, but can't get any workflow plus applescript to work. Ideally...

1 - I type a note in Alfred, to

2 - then chose a contact, so

3 - the notes field gets prepended with a date stamp + the content of my note.

 

As I'm not the expert on Applescript, the ones I found online and modified didn't work, and I didn't even figure out how to pass {query} into the script. ;-(((

 

Any helpful hints would be greatly appreciated. 

 

Hans

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...