Changes between Version 7 and Version 8 of AppleAddressBookDatasource


Ignore:
Timestamp:
12/12/05 20:32:40 (19 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AppleAddressBookDatasource

    v7 v8  
    4343tell application "Address Book" 
    4444 
     45set m to properties of my card 
    4546 
    46 set m to properties of my card 
    4747set the_file to (((path to desktop) as string) & first name of m & last name of m & ".rdf") as file specification 
     48 
    4849set rdf to "<rdf:RDF" & return 
     50 
    4951set rdf to rdf & "xmlns:rdf=" & quote & "http://www.w3.org/1999/02/22-rdf-syntax-ns#" & quote & return 
     52 
    5053set rdf to rdf & "xmlns:rdfs=" & quote & "http://www.w3.org/2000/01/rdf-schema#" & quote & return 
     54 
    5155set rdf to rdf & "xmlns:foaf=" & quote & "http://xmlns.com/foaf/0.1/" & quote & return 
     56 
    5257set rdf to rdf & "xmlns:admin=" & quote & "http://webns.net/mvcb/" & quote & ">" & return 
     58 
    5359set rdf to rdf & "<foaf:Person rdf:nodeID=" & quote & "me" & quote & ">" & return 
     60 
    5461set rdf to rdf & "<foaf:name>" & first name of m & " " & last name of m & "</foaf:name>" & return 
     62 
    5563if nickname of m ≠ "" then 
     64 
    5665set rdf to rdf & "<foaf:nick>" & nickname of m & "</foaf:nick>" & return 
     66 
    5767end if 
     68 
    5869if group foaf exists then 
     70 
    5971repeat with this_person in every person of group foaf 
     72 
    6073set rdf to rdf & "<foaf:Person>" & return 
     74 
    6175set rdf to rdf & "<foaf:name>" & first name of this_person & " " & last name of this_person & "</foaf:name>" & return 
     76 
    6277repeat with e in emails of this_person 
     78 
    6379set rdf to rdf & "<foaf:mbox>mailto:" & value of e & "</foaf:mbox>" & return 
     80 
    6481end repeat 
     82 
    6583if ((count of urls of this_person) > 0) then 
     84 
    6685if label of url 1 of this_person is "FOAF" then 
     86 
    6787set rdf to rdf & "<rdfs:seeAlso rdf:resource=" & quote & value of url 1 of this_person & quote & "/>" & return 
     88 
    6889end if 
     90 
    6991                        end if 
     92 
    7093                        set rdf to rdf & "</foaf:Person>" & return 
     94 
    7195                end repeat 
     96 
    7297        end if 
     98 
    7399         
     100 
    74101        set rdf to rdf & "</rdf:RDF>" 
     102 
    75103         
     104 
    76105         
     106 
    77107end tell 
    78108 
     109 
     110 
    79111try 
     112 
    80113        open for access the_file with write permission 
     114 
    81115        set eof of the_file to 0 
     116 
    82117        write (rdf) to the_file starting at eof 
     118 
    83119        close access the_file 
     120 
    84121on error 
     122 
    85123        try 
     124 
    86125                close access the_file 
     126 
    87127        end try 
     128 
    88129end try 
     130