newbie question re lists
newbie question re lists
- Subject: newbie question re lists
- From: peter <email@hidden>
- Date: Mon, 14 Apr 2003 13:46:01 +0200
I'm trying to load a text view in my applescript studio application
with a phone list derived from the OSX address book
I just keep getting errors telling me that the variable " contact_list"
is not defined
any idea why I can't get it to work?
many thanks
Peter
on awake from nib theObject
tell application "Address Book"
set the contact_list to {}
repeat with i from 1 to the count of people
set this_person to person i
set these_props to the properties of this_person
set the first_name to the first name of these_props
set the last_name to last name of these_props
set the phone_list to the value of every phone of this_person
if the first_name is missing value and the last_name is missing
value then
set this_entry to ""
else if the first_name is missing value and the last_name is not
missing value then
set this_entry to last_name
else if the first_name is not missing value and the last_name is
missing value then
set this_entry to first_name
else
set this_entry to last_name & ", " & first_name
end if
if this_entry is not "" then
set the end of the contact_list to this_entry & ", " & phone_list
end if
end repeat
end tell
end awake from nib
on clicked theObject
tell window "main"
set contents of text view "address" of scroll view "scroll" to
contact_list
end tell
end clicked
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.