Changes between Version 8 and Version 9 of AppleAddressBookDatasource


Ignore:
Timestamp:
12/21/05 16:51:03 (18 years ago)
Author:
sauermann
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AppleAddressBookDatasource

    v8 v9  
    66 * [http://people.no-distance.net/ol/software/ab-foaf/ AB-FOAF by Olivier Gutknecht] - a cocoa / python program. 
    77 * [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] 
    89 
    910Sources: Libby Miller, [http://leobard.twoday.net/stories/778100/ This blog entry]. 
     
    3839 
    3940I 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{{{ 
    4142property foaf : "FOAF" 
    4243 
    4344tell application "Address Book" 
    44  
    4545set m to properties of my card 
    46  
    4746set the_file to (((path to desktop) as string) & first name of m & last name of m & ".rdf") as file specification 
    48  
    4947set rdf to "<rdf:RDF" & return 
    50  
    5148set rdf to rdf & "xmlns:rdf=" & quote & "http://www.w3.org/1999/02/22-rdf-syntax-ns#" & quote & return 
    52  
    5349set rdf to rdf & "xmlns:rdfs=" & quote & "http://www.w3.org/2000/01/rdf-schema#" & quote & return 
    54  
    5550set rdf to rdf & "xmlns:foaf=" & quote & "http://xmlns.com/foaf/0.1/" & quote & return 
    56  
    5751set rdf to rdf & "xmlns:admin=" & quote & "http://webns.net/mvcb/" & quote & ">" & return 
    58  
    5952set rdf to rdf & "<foaf:Person rdf:nodeID=" & quote & "me" & quote & ">" & return 
    60  
    6153set rdf to rdf & "<foaf:name>" & first name of m & " " & last name of m & "</foaf:name>" & return 
    62  
    6354if 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 
    6756end if 
    68  
    6957if 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 
    9563                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 
    9768        end if 
    98  
    99          
    100  
     69        set rdf to rdf & "</foaf:Person>" & return 
     70        end repeat 
     71        end if 
    10172        set rdf to rdf & "</rdf:RDF>" 
    102  
    103          
    104  
    105          
    106  
    10773end tell 
    10874 
    109  
    110  
    11175try 
    112  
    11376        open for access the_file with write permission 
    114  
    11577        set eof of the_file to 0 
    116  
    11778        write (rdf) to the_file starting at eof 
    118  
    11979        close access the_file 
    120  
    12180on error 
    122  
    12381        try 
    124  
    12582                close access the_file 
    126  
    12783        end try 
    128  
    12984end try 
    130  
     85}}}