• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Procedure Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Procedure Problem


  • Subject: Procedure Problem
  • From: Darwin Zins <email@hidden>
  • Date: Tue, 11 Mar 2003 08:45:05 -0600

Can anyone tell me why I can't do this:

tell application "Address Book"
repeat with aPerson in every person
my set_a_vars(aPerson)
end repeat
end tell

on set_a_vars(aCard)
repeat with aPhone in (every phone of aCard)
tell aPhone
set phoneLabel to (get the label as Unicode text)
if phoneLabel is equal to "home" then
set a_home_phone to (get the value as Unicode text)
else if phoneLabel is equal to "mobile" then
set a_home_mobile to (get the value as Unicode text)
else if phoneLabel is equal to "home fax" then
set a_home_fax to (get the value as Unicode text)
else if phoneLabel is equal to "work" then
set a_business_phone to (get the value as Unicode text)
else if phoneLabel is equal to "work fax" then
set a_business_fax to (get the value as Unicode text)
end if
end tell
end repeat
end set_a_vars

I get an error: "Expected class name but found identifier." and it
highlights phone in the (every pphone of aCard).

Also, the code that I was looking at does the get the value as Unicode
text, do I really need the as Unicode text part?

Thanks,

Darwin
_______________________________________________
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.

  • Follow-Ups:
    • Re: Procedure Problem
      • From: Andrew Oliver <email@hidden>
    • Re: Procedure Problem
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: way to get XML attributes (From: has <email@hidden>)

  • Prev by Date: Re: way to get XML attributes
  • Next by Date: QXP5 and Layers
  • Previous by thread: Re: way to get XML attributes
  • Next by thread: Re: Procedure Problem
  • Index(es):
    • Date
    • Thread