Jump to content
  • 0

hulp gevraagd bij calculated applescript


MetDick

Question

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

Link to comment

3 answers to this question

Recommended Posts

  • 0

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...