[MacOS X] RubyAEOSA and Address Book

i'm trying RubyAEOSA with Address Book, it works great and much more
faster than AppleScript :wink:

actually i get 12 s to get the result with AppleSCript and only 0.868 s
with RubyAEOSA script (not finished yet)

however i have a syntax prob using Address Book.

the prob comes only when attempting to retrieve attributes related to
address.

if in RubyAEOSA i write :

set al to label of every address of every person

that's ok, i'm able to retrieve the label of the address howver, when
adding :

set as to street of every address of every person

i get an error :

[0m~/work/Ruby/rubyaeosa-0.2.3/sample> ./AddressBook2vCardXml.rb
/opt/local/lib/ruby/site_ruby/1.8/osx/aeosa/osacomponent.rb:32:in
`compile_execute': (-1753) OSACompileExecute (RuntimeError)
聽聽聽聽聽聽聽聽from
/opt/local/lib/ruby/site_ruby/1.8/osx/aeosa/osacomponent.rb:32:in
`do_script'
聽聽聽聽聽聽聽聽from
/opt/local/lib/ruby/site_ruby/1.8/osx/aeosa/osacomponent.rb:17:in
`do_osascript'
聽聽聽聽聽聽聽聽from ./AddressBook2vCardXml.rb:12:in `album_list'
聽聽聽聽聽聽聽聽from ./AddressBook2vCardXml.rb:57

same error when doing :

聽聽聽聽聽聽聽聽聽聽聽聽set {al,as,az,ac,ast,aco} to {label, street, zip, city,
state, country} of every address of every person
聽聽聽聽聽聽聽聽聽聽聽聽{c,o,d,t,f,l,n,el,ev,ul,uv,pl,pv,al,{al,as,az,ac,ast,aco}}

what surprised me here is in the fact i'm using the same approach for
email address :

聽聽聽聽聽聽聽聽聽聽聽聽set el to label of every email of every person
聽聽聽聽聽聽聽聽聽聽聽聽set ev to value of every email of every person

and that IS working...

what do you think is the good syntax for address ???

in case you have some light for me !

interested part of my AppleScript version :

路路路

-------------------------------------------
tell application "Address Book"
聽聽聽聽聽聽聽聽set theCount to count of every person
聽聽聽聽聽聽聽聽set companies to company of every person
聽聽聽聽聽聽聽聽set organizations to organization of every person
聽聽聽聽聽聽聽聽set departments to department of every person
聽聽聽聽聽聽聽聽set titles to title of every person
聽聽聽聽聽聽聽聽set firstNames to first name of every person
聽聽聽聽聽聽聽聽set lastNames to last name of every person
聽聽聽聽聽聽聽聽set {emailLabels, emailValues} to {label, value} of every email
of every person
聽聽聽聽聽聽聽聽set {urlLabels, urlValues} to {label, value} of every url of
every person
聽聽聽聽聽聽聽聽set {phoneLabels, phoneValues} to {label, value} of every phone
of every person
聽聽聽聽聽聽聽聽set {addressLabels, addressStreets, addressZips, addressCities,
addressStates, addressCountries} to {label, street, zip, city, state,
country} of every address of every person
聽聽聽聽聽聽聽聽set notes to note of every person
end tell
-------------------------------------------

interested part of my RubyAEOSA version :
-------------------------------------------
def album_list
聽聽result = OSX.do_osascript %{
聽聽聽聽聽聽聽聽tell application "Address Book"
聽聽聽聽聽聽聽聽聽聽聽聽set c to company of every person
聽聽聽聽聽聽聽聽聽聽聽聽set o to organization of every person
聽聽聽聽聽聽聽聽聽聽聽聽set d to department of every person
聽聽聽聽聽聽聽聽聽聽聽聽set t to title of every person
聽聽聽聽聽聽聽聽聽聽聽聽set f to first name of every person
聽聽聽聽聽聽聽聽聽聽聽聽set l to last name of every person
聽聽聽聽聽聽聽聽聽聽聽聽set n to note of every person
聽聽聽聽聽聽聽聽聽聽聽聽set el to label of every email of every person
聽聽聽聽聽聽聽聽聽聽聽聽set ev to value of every email of every person
聽聽聽聽聽聽聽聽聽聽聽聽set ul to label of every url of every person
聽聽聽聽聽聽聽聽聽聽聽聽set uv to value of every url of every person
聽聽聽聽聽聽聽聽聽聽聽聽set pl to label of every phone of every person
聽聽聽聽聽聽聽聽聽聽聽聽set pv to value of every phone of every person
聽聽聽聽聽聽聽聽聽聽聽聽set {al,as,az,ac,ast,aco} to {label, street, zip, city,
state, country} of every address of every person
聽聽聽聽聽聽聽聽聽聽聽聽{c,o,d,t,f,l,n,el,ev,ul,uv,pl,pv,al,{al,as,az,ac,ast,aco}}
聽聽聽聽聽聽聽聽end tell
聽聽聽聽聽聽}
聽聽co = result[0].map {|i| i.to_s}
聽聽org = result[1].map {|i| i.to_rbobj }
聽聽de = result[2].map {|i| i.to_rbobj }
聽聽ti = result[3].map {|i| i.to_rbobj }
聽聽fn = result[4].map {|i| i.to_rbobj }
聽聽ln = result[5].map {|i| i.to_rbobj }
聽聽no = result[6].map {|i| i.to_rbobj }
聽聽el = result[7].map {|i| i.to_rbobj }
聽聽ev = result[8].map {|i| i.to_rbobj }
聽聽ul = result[9].map {|i| i.to_rbobj }
聽聽uv = result[10].map {|i| i.to_rbobj }
聽聽pl = result[11].map {|i| i.to_rbobj }
聽聽pv = result[12].map {|i| i.to_rbobj }
聽聽return ln.map {|k| [ rand(10000),
[co.shift,org.shift,de.shift,ti.shift,fn.shift,k,no.shift,el.shift,ev.sh
ift,ul.shift,uv.shift,pl.shift,pv.shift]]}
end
-------------------------------------------
i don't use {al,as,az,ac,ast,aco} to this time because it's buggy ))
--
une b茅vue

sorry for the noise, i've forgotten that even if the script is written
in Ruby, in the AppleScript tell part i don't to use a reserved word as
"as" )))

路路路

Une b茅vue <pere.noel@laponie.com> wrote:

however i have a syntax prob using Address Book.

--
une b茅vue