yuryg
Well Even though AppleScript is not supported by TheBrain I managed to make an AppleScript to do some automation. 

This script an be activated by adding the script menu to your apple system, or by selecting it from the folder. Or by using one of the add-ins to automatically select the scripts, via command key.

There is a reply below that shows the way you can automate it.

--- About the Script ---

What is this script?

Well The Brain has an addition of the Address Book Entries in to the Brain but unfortunately I do not think it is done in the most convenient way. The process of search for the name, select the name, add, just takes way too long in my opinion. A lot of time I do not have the luxury of waiting a few minutes for the search to complete, and then go through all the E-Mails, thoughts, etc containing the name.

So I created this script ... How to use it?
  1. Create a thought in your brain, and call it anything (it is temporary, so I use one or two letters garbage)
  2. Open Address Book and select an entry.
  3. Activate the Script.

What does it do, well this one is not advanced:
  1. It just renames the name to the Name in the Address Book (it is configurable as to how you want to add it by looking at the script comments. Default is First name Last Name)
  2. It creates a link to the ID of the address book thought in the attachments.
  3. It takes all the information from the record and pastes it as Text in to the Brain Notes field. Unfortunately there is no easy way to add HTML (as there is no way to switch to HTML portion of browser, otherwise I would. I opened a request to add this so I can make this look very nice so if you would like to have it go vote for it in the suggestions topics)
  4. It takes all the Emails and attaches them as a Mailto to the attachement section so that they are able to be clicked on.
  5. It takes all the URL's and attaches them to the section as well so that way they are able to be clicked on.
-- If you have any suggestions.... I would welcome it.
Quote
yuryg
Some Resource Links of how to do things on Apple Mac:



Also any input would be appreciate it, as I am looking for ways to extend this a lot further.
Quote
yuryg
Version 1.02 of the Script.

Release Date: 12/30/2012

Changes of the script:
  • Added Comments in case you want to see how I do things.
  • Saved the Clipboard so that it is restored at the end of the script instead of me replacing it with the things that I use it for.
  • Fixed a bug in Notes when a note did not exist and it would try to paste a missing value.
Note: Any comments would be appreciate it, if you have other ideas post it as well. Would love to see if I can do things more.
 
Quote
zenrain
I downloaded the script and unzipped, but was unable to open in Applescript Editor. Any chance you can also post as a .txt file? Then I can copy-paste and save it. 

Thanks!
macOS 10.14.6
TheBrain 11.0.119
Quote
yuryg
Version 1.03

Changes:

1. Added some delay for computers that are busy with resources
2. Fixed a bug that would not attach notes

-- Address Book PLUS script
-- Written by Yury German <yury (at) technologysecure.com>
-- Version: 1.03
-- Date of Change: 2013-01-07
-- 
-- About this script:
-- This is the more advanced Script for address book import. 
--
-- 1. Takes the Name from the address book selection and renames the thought with the name
-- 2. Takes the URL identifier for the Address Book entry and attaches it to the Attachments
--    so it can be clicked and activated.
-- 3. Add the full text of address record to clipboard and paste it in to the text
-- 4. Attach every Email to attachment as Mailto
-- 5. Attach every Web to the attachemnt as mailto 
-- Also the Clipboard you currently have is stored and then replaced.



set oldClipboard to the clipboard
tell application "Contacts"
-- Set the Selection (Only handling 1)
set theSelection to selection
-- Gets the First name of the selection
set FirstName to first name of item 1 of theSelection
-- Gets the last name of the selection
set lastName to last name of item 1 of theSelection
-- Gets the ID of the selection
set thisPerson to the id of item 1 of theSelection
-- Creates the URL with the ID of the selection
set myAddress to "addressbook://" & thisPerson

-- Clear the myFile variable so we can add things to it.
set myFile to ""
-- ** Now for the work **
-- Adding Names (Full Name)
set theName to name of item 1 of theSelection
set myFile to (myFile & "Name:               " & theName & "
") as string
-- Check if we have a Nickname if we do use it
set theNickname to nickname of item 1 of theSelection
if (theNickname is not missing value) then
set myFile to (myFile & "Nickname:         " & theNickname & "
") as string
end if
-- Seperating between the sections
set myFile to (myFile & "
")
-- If the Tilte is there use it
set theTitle to job title of item 1 of theSelection
if (theTitle is not missing value) then
set myFile to (myFile & "Title:                 " & theTitle & "
") as string
end if
-- If the Deaprtment is there use it
set theDepartment to department of item 1 of theSelection
if (theDepartment is not missing value) then
set myFile to (myFile & "Department:       " & theDepartment & "
") as string
end if
-- If the organization is there use it
set theOrganization to organization of item 1 of theSelection
if (theOrganization is not missing value) then
set myFile to (myFile & "Organization:     " & theOrganization & "
") as string
end if
-- Seperating between the sections
set myFile to (myFile & "
")
-- *** Telephone Section ***
set myFile to (myFile & "Phones:
")
-- This is a loop to add every phone to the information
set PhoneCount to count every phone of item 1 of theSelection
repeat with PhoneNo from 1 to count every phone of item 1 of theSelection
set myPhLabel to (label of phone PhoneNo) of item 1 of theSelection
set myPhone to (value of phone PhoneNo) of item 1 of theSelection
set myFile to (myFile & "     " & myPhLabel & ":          " & myPhone & "
")
end repeat
-- *** EMail Section ***
-- This is to put the EMail heading in
set myFile to (myFile & "
EMail:
")
-- A loop for every E-Mail address
repeat with EmailNo from 1 to count every email of item 1 of theSelection
set myEmailLabel to (label of email EmailNo) of item 1 of theSelection
set myEmail to (value of email EmailNo) of item 1 of theSelection
set myFile to (myFile & "     " & myEmailLabel & ":          " & myEmail & "
")
end repeat
-- *** Address Section ***
-- Putting in a section for Address even if we do not have any now
set myFile to (myFile & "
Address:
")
-- This is the loop for the Address Section
repeat with AddressNo from 1 to count every address of item 1 of theSelection
set myAddrLabel to (label of address AddressNo) of item 1 of theSelection
set myStreet to (street of address AddressNo) of item 1 of theSelection
set myCity to (city of address AddressNo) of item 1 of theSelection
set myState to (state of address AddressNo) of item 1 of theSelection
set myZip to (zip of address AddressNo) of item 1 of theSelection
set myCountry to (country of address AddressNo) of item 1 of theSelection
set myFile to (myFile & "     " & myAddrLabel & ":
                        " & myStreet & "
                        " & myCity & ", " & myState & "  " & myZip & "
                        " & myCountry & "

")
end repeat
-- *** Web Page Section ***
set myFile to (myFile & "
Web Pages:
")
-- Loop to add  Web Page Section
repeat with urlNo from 1 to count every url of item 1 of theSelection
set myWebLabel to (label of url urlNo) of item 1 of theSelection
set myWebPage to (value of url urlNo) of item 1 of theSelection
set myFile to (myFile & "     " & myWebLabel & ":
                          " & myWebPage & "
")
end repeat

-- If the BirthDate is there use it
set theBirthDate to birth date of item 1 of theSelection
if (theBirthDate is not missing value) then
set myFile to (myFile & "
Birth Date:         " & theBirthDate & "
") as string
end if
-- Finally the NOTES
set myFile to (myFile & "

***** NOTES *****
")
set myNotes to note of item 1 of theSelection
if (myNotes is not missing value) then
set myFile to (myFile & myNotes) as string
end if
end tell
-- ** Now we are going to work with the Brain **
tell application "TheBrain" to activate
tell application "System Events"
tell application process "TheBrain"
-- We are going to rename the thought to First Name and Last Name
-- If you want to change it to Last Name first name just comment out
-- The field below with First Name using the double dash and then
-- delete the dashes in front of the one with the Last Name first
set the clipboard to (FirstName & " " & lastName) as string
delay 0.2
-- set the clipboard to (lastName & ", " & FirstName) as string
keystroke return using {command down}
delay 0.2
keystroke "v" using {command down}
delay 0.2
keystroke return
delay 0.2
-- This activates the Notes field using the default selector for the
-- Notes field.
keystroke "m" using {command down}
delay 0.2
-- This pastes the information we added to myFile to the Notes Field
set the clipboard to myFile
delay 0.5
keystroke "v" using {command down}
delay 0.2
end tell
end tell

-- ** This is how we are going to Add the Attachments **
tell application "Contacts"
set theSelection to selection
-- Repeat for Email address and attach them to the Brain
repeat with EmailNo from 1 to count every email of item 1 of theSelection
set myEmail to (value of email EmailNo) of item 1 of theSelection
tell application "TheBrain" to activate
tell application "System Events"
tell application process "TheBrain"
set the clipboard to ("mailto://" & myEmail) as string
delay 0.2
click menu item "Add Attachment..." of menu "Thought" of menu bar item "Thought" of menu bar 1
-- Pause for .5 second for pop-up
delay 0.5
keystroke tab
delay 0.2
keystroke tab
delay 0.2
keystroke tab
delay 0.2
keystroke tab
delay 0.2
keystroke space
delay 0.2
keystroke "v" using {command down}
delay 0.2
keystroke return
delay 0.2
end tell
end tell
end repeat
-- Repeat for adding URL's to the system
repeat with urlNo from 1 to count every url of item 1 of theSelection
set myWebPage to (value of url urlNo) of item 1 of theSelection
tell application "TheBrain" to activate
tell application "System Events"
tell application process "TheBrain"
set the clipboard to myWebPage as string
delay 0.2
click menu item "Add Attachment..." of menu "Thought" of menu bar item "Thought" of menu bar 1
-- Pause for .5 second for pop-up
delay 0.5
keystroke tab
delay 0.2
keystroke tab
delay 0.2
keystroke tab
delay 0.2
keystroke tab
delay 0.2
keystroke space
delay 0.2
keystroke "v" using {command down}
delay 0.2
keystroke return
delay 0.2
end tell
end tell
end repeat
-- Adding the URL to the actual card
tell application "TheBrain" to activate
tell application "System Events"
tell application process "TheBrain"
-- We are actually adding an attachment
set the clipboard to myAddress as text
delay 0.2
click menu item "Add Attachment..." of menu "Thought" of menu bar item "Thought" of menu bar 1
-- Pause for .5 second for pop-up
delay 0.5
tell front window
delay 0.2
keystroke tab
delay 0.1
keystroke tab
delay 0.1
keystroke tab
delay 0.1
keystroke tab
delay 0.1
keystroke space
delay 0.5
keystroke "v" using {command down}
delay 0.2
keystroke return
delay 0.2
end tell
end tell
end tell
end tell
-- Set the Old Clipboard 
set the clipboard to oldClipboard
Quote
danlandrum
Yury,

Are you still using this script, perhaps with Yosemite? 

Thanks in advance, Dan

OSX 10.13 
iMac (Retina 5K, 27-inch, Late 2015)
3.3 GHz Intel Core i5
32 GB 1867 MHz DDR3
Quote
yuryg
I just upgraded not too long ago on a new laptop, and have not had time to test. Have you tried and is it working or failing?

Quote
danlandrum
Just tried it. Excellent!!! It appears to be bringing in all the info properly into notes. This is exactly what I wanted.

Should it be creating a link that reopens Contacts and the appropriate contact? If so, then this part isn't working, though I may be misunderstanding your intent. In other words, the info appears to be added as an attachment, which I assume should then open in Contacts as the appropriate contact (like a file to its correct app), but doesn't. It's no big deal for me, though. It already does what I wanted. Thanks so much, Yury. You are appreciated.

OSX 10.13 
iMac (Retina 5K, 27-inch, Late 2015)
3.3 GHz Intel Core i5
32 GB 1867 MHz DDR3
Quote
yuryg
So it depends where the data is stored. I just checked the script and on my system it generates an addressbook://  link.


Quote
danlandrum
I'm on the run and can't check this right now, but didn't Apple change the name from Address Book to Contacts recently? It could just be a simple syntax problem. 
OSX 10.13 
iMac (Retina 5K, 27-inch, Late 2015)
3.3 GHz Intel Core i5
32 GB 1867 MHz DDR3
Quote
yuryg
Yes they did.. but you have to have it open, and you have to select the address. I think internally via AppleScripts it still uses address book. I guess in the future they will take it away... but for now it works.

Quote

Newsletter Signup  Newsletter        Visit TheBrain Blog   Blog       Follow us on Twitter   Twitter       Like Us on Facebook   Facebook         Watch Us on Youtube  YouTube       

TheBrain Mind Map & Mindmapping Software     Download TheBrain Mind Mapping Software