MetDick Posted August 2, 2013 Posted August 2, 2013 Goedenmorgen! ik probeer met een calculated applescript een contact in het Address Book van mijn Mac te zetten. Ik zou daar variables voor willen gebruiken Dat gaat niet zoals ik verwacht. Dit is mijn script: "tell application " & "\"Contacts\"" & "¶" & "set thePerson to make new person with properties {first name:"& "\"$$Voornaam\"" & ", middle name:" & "\"$$Tussenvoegsel\"" & ", last name:" & "\"$$Achternaam\"" & ", organization:" & "\"$$Bedrijf\"" & "}¶" & "make new email at end of emails of thePerson with properties {label:" &"\"Work\"" & ", value:" &"\"$$Email\"" & "}¶" & "make new phone at end of phones of thePerson with properties {label:" & "\"Work\"" & ", value:" &"\"$$Telefoon\"" & "}¶" & "make new url at end of urls of thePerson with properties {label:" & "\"Work\"" & ", value:" &"\"$$Website\"" & "}¶" & "make new address at end of addresses of thePerson with properties {label:" &"\"Work\"" & ", street:" &"\"$$Adres\"" & ", city:" &"\"$$Plaats\"" & ", zip:" &"\"$$Postcode\"" & ", country:" &"\"$$Land\"" & "}¶" & "save" & "¶" & "end tell" & "¶" Maar in plaats van de waarden van de variables worden de namen van de variables geplaatst. Ik doe dus iets fout met de dubbele quotes, blijkbaar. Maar wat? Vriendelijke groeten, Dick Quote
0 PJ007 Posted August 2, 2013 Posted August 2, 2013 Volgens mij zou het zo moeten werken: "tell application " & "\"Contacts\"" & "¶" & "set thePerson to make new person with properties {first name:\""& $$Voornaam & "\", middle name:\"" & $$Tussenvoegsel & "\", last name:\"" & $$Achternaam & "\", organization:\"" & $$Bedrijf & "\"}¶" & "make new email at end of emails of thePerson with properties {label:\"Work\", value:\"" & $$Email & "\"}¶" & "make new phone at end of phones of thePerson with properties {label:\"Work\", value:\"" & $$Telefoonl & "\"}¶" & "make new url at end of urls of thePerson with properties {label:\"Work\", value:\"" & $$Websitel & "\"}¶" & "make new address at end of addresses of thePerson with properties {label:\"Work\", street:\"" & $$Adres & "\", city:\"" & $$Plaats & "\", zip:\"" & $$Postcode & "\", country:\"" & $$Land & "\"}¶" & "save" & "¶" & "end tell" & "¶" Als je Filemaker Advanced hebt, dan is het bij het debugging handig om de calculated applescript in een variabele te zetten. Met de script debugger en de gegevensinzage kun je het script met ingevulde waarden bekijken. Quote
Question
MetDick
Goedenmorgen!
ik probeer met een calculated applescript een contact in het Address Book van mijn Mac te zetten.
Ik zou daar variables voor willen gebruiken
Dat gaat niet zoals ik verwacht.
Dit is mijn script:
"tell application " & "\"Contacts\"" & "¶" &
"set thePerson to make new person with properties {first name:"& "\"$$Voornaam\"" & ", middle name:" & "\"$$Tussenvoegsel\"" & ", last name:" & "\"$$Achternaam\"" & ", organization:" & "\"$$Bedrijf\"" & "}¶" &
"make new email at end of emails of thePerson with properties {label:" &"\"Work\"" & ", value:" &"\"$$Email\"" & "}¶" &
"make new phone at end of phones of thePerson with properties {label:" & "\"Work\"" & ", value:" &"\"$$Telefoon\"" & "}¶" &
"make new url at end of urls of thePerson with properties {label:" & "\"Work\"" & ", value:" &"\"$$Website\"" & "}¶" &
"make new address at end of addresses of thePerson with properties {label:" &"\"Work\"" & ", street:" &"\"$$Adres\"" & ", city:" &"\"$$Plaats\"" & ", zip:" &"\"$$Postcode\"" & ", country:" &"\"$$Land\"" & "}¶" &
"save" & "¶" &
"end tell" & "¶"
Maar in plaats van de waarden van de variables worden de namen van de variables geplaatst.
Ik doe dus iets fout met de dubbele quotes, blijkbaar.
Maar wat?
Vriendelijke groeten,
Dick
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.