Changes between Version 8 and Version 9 of AppleAddressBookDatasource
- Timestamp:
- 12/21/05 16:51:03 (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AppleAddressBookDatasource
v8 v9 6 6 * [http://people.no-distance.net/ol/software/ab-foaf/ AB-FOAF by Olivier Gutknecht] - a cocoa / python program. 7 7 * [http://search.cpan.org/~kjetilk/XML-FOAFKnows-FromvCard/ XML-FOAFKnows-FromvCard] by KjetilK. Does only foaf:knows creation 8 * [http://b4mad.net/datenbrei/archives/2005/12/20/putting-my-address-book-online/ ab-new.py] a new python script to get the address book. [http://b4mad.net/2005/12/18/ab-new.py.txt ab-new.py.txt] 8 9 9 10 Sources: Libby Miller, [http://leobard.twoday.net/stories/778100/ This blog entry]. … … 38 39 39 40 I uploaded a script I made a couple of years ago, but it's appeared as 0 bytes. So here's the script. To use it, you need to create a group called "FOAF" and add anyone you want in your knows list to that group. If you have a URL for their FOAF file, select their card in the Address Book, choose Card>Add Field>URL, change the URL title to FOAF and but the URL in the URL box. 40 41 {{{ 41 42 property foaf : "FOAF" 42 43 43 44 tell application "Address Book" 44 45 45 set m to properties of my card 46 47 46 set the_file to (((path to desktop) as string) & first name of m & last name of m & ".rdf") as file specification 48 49 47 set rdf to "<rdf:RDF" & return 50 51 48 set rdf to rdf & "xmlns:rdf=" & quote & "http://www.w3.org/1999/02/22-rdf-syntax-ns#" & quote & return 52 53 49 set rdf to rdf & "xmlns:rdfs=" & quote & "http://www.w3.org/2000/01/rdf-schema#" & quote & return 54 55 50 set rdf to rdf & "xmlns:foaf=" & quote & "http://xmlns.com/foaf/0.1/" & quote & return 56 57 51 set rdf to rdf & "xmlns:admin=" & quote & "http://webns.net/mvcb/" & quote & ">" & return 58 59 52 set rdf to rdf & "<foaf:Person rdf:nodeID=" & quote & "me" & quote & ">" & return 60 61 53 set rdf to rdf & "<foaf:name>" & first name of m & " " & last name of m & "</foaf:name>" & return 62 63 54 if nickname of m ≠ "" then 64 65 set rdf to rdf & "<foaf:nick>" & nickname of m & "</foaf:nick>" & return 66 55 set rdf to rdf & "<foaf:nick>" & nickname of m & "</foaf:nick>" & return 67 56 end if 68 69 57 if group foaf exists then 70 71 repeat with this_person in every person of group foaf 72 73 set rdf to rdf & "<foaf:Person>" & return 74 75 set rdf to rdf & "<foaf:name>" & first name of this_person & " " & last name of this_person & "</foaf:name>" & return 76 77 repeat with e in emails of this_person 78 79 set rdf to rdf & "<foaf:mbox>mailto:" & value of e & "</foaf:mbox>" & return 80 81 end repeat 82 83 if ((count of urls of this_person) > 0) then 84 85 if label of url 1 of this_person is "FOAF" then 86 87 set rdf to rdf & "<rdfs:seeAlso rdf:resource=" & quote & value of url 1 of this_person & quote & "/>" & return 88 89 end if 90 91 end if 92 93 set rdf to rdf & "</foaf:Person>" & return 94 58 repeat with this_person in every person of group foaf 59 set rdf to rdf & "<foaf:Person>" & return 60 set rdf to rdf & "<foaf:name>" & first name of this_person & " " & last name of this_person & "</foaf:name>" & return 61 repeat with e in emails of this_person 62 set rdf to rdf & "<foaf:mbox>mailto:" & value of e & "</foaf:mbox>" & return 95 63 end repeat 96 64 if ((count of urls of this_person) > 0) then 65 if label of url 1 of this_person is "FOAF" then 66 set rdf to rdf & "<rdfs:seeAlso rdf:resource=" & quote & value of url 1 of this_person & quote & "/>" & return 67 end if 97 68 end if 98 99 100 69 set rdf to rdf & "</foaf:Person>" & return 70 end repeat 71 end if 101 72 set rdf to rdf & "</rdf:RDF>" 102 103 104 105 106 107 73 end tell 108 74 109 110 111 75 try 112 113 76 open for access the_file with write permission 114 115 77 set eof of the_file to 0 116 117 78 write (rdf) to the_file starting at eof 118 119 79 close access the_file 120 121 80 on error 122 123 81 try 124 125 82 close access the_file 126 127 83 end try 128 129 84 end try 130 85 }}}