Applescript
- Started
- Last post
- 12 Responses
- vrmbr
Anyone an expert?
Trying to swap organization with last name in Addressbook.
In short: all the v-cards i received have organization name in the last name field. so i need to move the contents of that field to organization, there are no further names, only organization names.
so far i tried this:
tell application "Address Book"
set last name to organization
end telldoesn't work.
any ideas?
- drgs0
can't test, but try
tell application "Address Book"
set mycardlist to selection
repeat with mycard in mycardlist
set organization in mycard to last name of mycard
set last name in mycard to "some default lastname"
end repeat
end tell
- vrmbr0
thank you, drgs. i will try that now.
- vrmbr0
"some default lastname"
wasn't necessary.but it worked!
now i found out they are all listed as persons instead of companies, how would i change that with applescript? sorry i have the dutch version, but it should be marked company in that checkbox.. how would i achieve that with applescript?
- drgs0
no idea... i dont know what property defines type
- vrmbr0
ah bugger.
thanks for the help though!
- drgs0
you can try with
set company in mycard to true
in the same loop, instead of the two "set..." lines
but i dont know maybe it needs some other value type
- vrmbr0
i'll try, cheers.
- vrmbr0
you know what.. that works!
You rock, drgs!
- drgs0
=)
- vrmbr0
would there be a way to just clear the last name field?
- drgs0
thats why i had
set last name in mycard to "some default lastname"
so , to clear:
set last name in mycard to ""
- vrmbr0
yeah, empty ( only "" ) does work now! cheers...