challo!
I am a real newbie in AppleScript but tried my best and now I have no clue anymore although I searched the internet, these (and other) forums and worked through some tutorials…
What i wanna do is:
first, finding duplicated contacts in PalmDesktop 4.2.1´s address list, displaying them and
(still far away from that) giving the option to select one of the duplicated for deleting it…
This is my script:
using terms from application "Palm Desktop"
tell application "Palm Desktop"
set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to "" --> I suppose this is wrong, I need something to ignore empty fields
set addList to full name of every address as string -->gets the whole contact list with full name
set compList to company of every address --> gets the whole list of companies, didn´t know how to get both in one list
--> I want to iterate through the list end compare the items to figure out if there is one duplicated
repeat with i from 1 to the count of addList
repeat with j from 2 to the count of addList
repeat with k from 1 to the count of compList
repeat with l from 2 to the count of compList
set aName to item i of addList
set bName to item j of addList
set aComp to item k of compList
set bComp to item l of compList
try
if {aName is equal to bName and aComp is equal to bComp} then
display dialog aName & " from " & aComp & "is a duplicated contact!" buttons {"Cancel", "Delete"} default button 2
if the button returned of the result is "Cancel" then
beep
else
say "Contact deleted" --> well, here would be the code for deleting... ??
end if
end if
end try
end repeat
end repeat
end repeat
end repeat
set AppleScript's text item delimiters to oldDelim
end tell
end using terms from
It´s kind of embarassing, I know, because I think, some basic knowledge is missing (like comparing items in a list). I am really sorry, but I coudn´t figure it out
Any help/suggestions would be appreciated.
greez.
Browser: Safari 312
Operating System: Mac OS X (10.3.9)