I’m trying to trouble shoot the following script for someone. It runs fine on my computers (Big Sur and El Capitan) with a few hundred names, but on his (Catalina), Panorama apparently hangs up. I’ve yet to find a way to determine how many are in his Contacts, but after an hour he figures it should be done.
The procedure is intended to extract email addresses from his Mac Contacts and put them into his Panorama database using fields Name and Email.
FileGlobal fgResult AppleScript ||| set EList to "" tell application "Contacts" to repeat with p in people if emails of p is {} then set e to "" else set e to value of email 1 of p end if -- set EList to EList & e & ";" & first name of p & " " & last name of p & linefeed set EList to EList & first name of p & " " & last name of p & ";" & e & linefeed end repeat EList |||,fgResult SelectAll fgResult = lftocr(fgResult) Local lvThis, lvCount lvCount = 0 Loop lvThis = ArrayFirst(fgResult,¶) fgResult = ArrayRange(fgResult,2,5000,¶) If ArrayFirst(lvThis,";") ≠ "" and ArrayLast(lvThis,";") ≠ "" Find Name = ArrayFirst(lvThis,";") If info("Found") = -1 Email = ArrayLast(lvThis,";") lvCount = lvCount+1 EndIf EndIf Until fgResult = "" Message "Done - "+pattern(lvCount,"#,")+" email addresses entered."