Contacts db in Database Exchange

Now available in the Database Exchange is a Contacts database with full access to the forms and procedures. I’m offering this to the Panorama community as a learning tool but also with the hope that others will contribute and help develop it further. It is not for sale or repackaging.

Contacts is a database designed for maintaining extensive notes, reminders and data on all of the people with whom you are in contact. Contacts is a work in progress and is being offered for free under the Creative Commons Attribution-Non Commercial-ShareAlike 4.0 International License.

You have the right to use and modify it to suit your needs and, if desired, to share your modifications for the use of others and possible addition to the distribution copy of database for use by others.

This database can be used to connect to other Panorama X databases for job tracking, invoicing, communications or any other tasks. The recID field provides a positive link to make connections.

Ideally users will contribute enhancements to be added to this distribution copy for further sharing within the Panorama X community.

The right to sell or use this database or parts as a commercial product is forbidden without specific written authorization.

Other than exchanges in the Panorama forums, technical support is not available.

Be sure to pay attention to the Tool Tips. Many items in the window include Tooltips when you hover the mouse over them. They often describe hidden features that allow you to set preferences or optional features.

Access to edit forms and procedures is readily gained by choosing Full menus from the Displays menu.

menus

I am having a strange problem. When I open the file, there is no visible window. The Window menu shows that “Data Record” is the window, but it is not visible on my screen. I have tried moving it (with a zoomalign statement), but it does not show up. As the database is starting, I see a window flash on the screen and then it disappear. After choosing Full Menus, I can select other windows; they all appear normally. I don’t understand what is happening. Any suggestions?

Since posting the first paragraph, I downloaded the file again and I left it in my downloads folder (previously, I moved it to my usual database folder). The new download worked! I moved a copy into my usual downloads folder, and that copy opened with no form visible. So it opens normally when the file is in one location, and abnormally when it opens in another location.

I just did the download myself and it opens just fine no matter where I put it on my drive. I just received a compliment about the file and it had clearly opened properly.

That Bluetooth icon was such a tease. Who doesn’t want to be more efficient when they make a lot of calls? Unfortunately, JNSoftware is not distributing or selling their product at this time.

Are there alternatives?

So for instance, if someone wanted to write a little code to allow the user to enter all 10 digits in the first phone field (area code), and have Panorama automatically parse that into the area code and phone number field, how would they offer or contribute that enhancement? (Or if someone entered 14 digits in that first field, the template could parse it into an area code, phone number, and 4 digit extension that a dialer would still be able to use cuz the extension got put into an extension field.) [So much fun ahead for editors to play with and enhance!!!]

Then too if someone wanted to offer multiple enhancements like when I delete a phone number, the area code gets deleted with it, is the contribution method handled in a different way?

This is a great tool for learning as it uses many methods to accomplish things. Nice work and the community will thank you greatly.

In the URL field, I put in a TLD ‘PerfectPourServices.com’ without a leading host name (www) and Panorama barked that there was no application set to open that URL and that I should choose one. Unfortunately, the Choose Application dialog had all of my applications dimmed and un-selectable. Is this an OS issue, a Panorama issue, or a template issue? (I imagine I could fix this by adding the www but I’m more curious about the inability of the Choose Application dialog to not recognize applications.)

Ok. So I played a bit more and gave it the www thinking that a default had not yet been set, but it still did not open the url nor was the Choose Application dialog happy. I am imagining that with a bit of code editing, we could put in a FTP host url as well as a www host url and we could have the appropriate applications handle our need.

I am really looking forward to seeing what other users might contribute in code edits. The key will always be to keep it generic for many to benefit from while also giving the template greater value through creative, universally desired features like the bluetooth dialing.

You’ve asked more than I can answer right now (life away from the computer beckons), but providing it as Open Source is new territory for me. I want this to be available to the Panorama community for co-development. Managing updates and adding submitted features in a controlled manner will be challenging.

On the BlueTooth, yes, Dialectic vanished after promising to reappear. Sadly I’ve found no replacement for this very useful feature that was working well.

In the .web procedure change the first case to:

Case info(“Trigger”) contains “URL” and URL ≠ “”
openurl ?(URL[1,7] = “http://”,“”,“http://”)+URL

This is a blatant but easy to fix error so I’m uploading a revision now.

I am not yet clear what Dialectic was doing and how that was incorporated into the template but this url How to make phone calls on your Mac - CNET does show that FaceTime can voice dial out through a nearby phone without using BlueTooth (it uses W-Fi.) Perhaps a bit of AppleScript can tie this in?

There is also Call Connector in the Apple Store. It was not an issueless free install, and it was not free, but it does accomplish this task via Bluetooth so it may be an option. Again, I am not yet clear as to what Panorama needs to tie into this service. Just looking to be more efficient.

Don’t forget that you will have to validate the database again if there has been changes to the file. This is from the Help file on the subject:

If the database itself has changed, you’ll need to validate it again (even if the URL hasn’t changed)

I don’t know if this will entail the full dance that the original upload requires since I have not yet tried to update one of my Exchange files. I personally hope this turns out to be trivial and allow for frequent further development of this great resource. Thanks for sharing!

Hi Jim…your brilliance is only exceeded by your good nature and dedication to your long time customers and fans. You are truly one of the good guys that one most often hears about in folklore these days.

The new Contacts file is great…exporting v6 data was well explained and importing it into the PanX version of Contacts was pretty straightforward. Just one nitpicking, inconsequential detail that I noticed in poking around the new version…in the limited menu view of Contacts, there’s a typo in the Search menu option to Remove Unselected…it reads Remove Unselecetd.

Best,
RP

Doh!

It won’t go on the ‘Urgent’ list but so noted.

If you go to Full Menus mode and open the .Initialize Menus procedure, you can correct it on line 16. It should be:
`

    +menuitem("Remove Unselected")

`

It’s working with the file replaced and no other effort applied.

That would certainly make updating Exchange files much simpler and encourage rapid bug corrections.

That was from me :slight_smile: Nice job, Jim!

I did find the cause of the Contacts file not opening correctly; it was entirely due to the opening sequence of commands that I use with every file that I open through a little navigator db that I have. It returns the first window opened to its maximum size, based on the settings in the form. Where the settings are zero, as was true of the Data Record form, it malfunctions. I need to fix my custom statement so that it handles zeros in the maximum size.

It’s been pointed out to me that Add Keyword is not functioning correctly. It’s adding “Add Keyword” which is not the general idea.

The first case in .keywords edit should be:

Case info("Trigger") = "Add Keyword"
	lvKeyword = ""
	fgAddKey = "Add Keyword"
	ShowVariables fgAddKey
	gettextokcancel  "New Keyword?",lvKeyword
	If info("Modifiers") contains "Option"
	    FormulaFill ArrayDeduplicate(ArrayStrip(Keywords+¶+lvKeyword,¶),¶)
	Else
	    Keywords = ArrayDeduplicate(ArrayStrip(Keywords+¶+lvKeyword,¶),¶)
	EndIf
	Rtn

There were circumstances that could cause the synch FROM Apple Contacts to be missing expected elements. Below is an improved procedure that replaces the contents of “.GetContact”

Local lvResult, lvFName, lvLName, lvErrors
lvErrors = ""

If fgSyncPick contains "THIS"
    ShortCall DoScript
    nsnotify ?(fgResult contains "~","Synch for "+Contact+" Completed",fgResult)
    Stop
EndIf

Alert 1014 "Synch the "+pattern(info("Selected"),"#,")+" Selected Contacts from the Apple Contacts?"
If info("DialogTrigger") = "No" Stop EndIf

FirstRecord
Loop
    ShortCall DoScript
    If fgResult notcontains "~"
        lvErrors = sandwich("",lvErrors,¶)+Contact+" - "+fgResult
    EndIf
    DownRecord
Until Info("Stopped") = -1    

Beep
If lvErrors ≠ ""
    SuperAlert lvErrors,{height=400 width=400 size=9 scroll="yes" buttons="Ok"}
Else
    nsnotify "Synch completed."
EndIf

Rtn

DoScript:
lvLName = ?(Contact≠"",?(Contact contains " ",Contact[" ",-1]["A-Z,a-z",-1],Contact),"")
lvLName = ?(length(lvLName[".",-1]["A-Z",-1])>0,lvLName[".",-1]["A-Z",-1],lvLName)
lvLName = ?(length(lvLName[1,"- "])>4 and lvLName[-1,-1]≠".",lvLName[" ",-1]["A-Z",-1],lvLName)
lvLName = ?(Contact contains "  ",extract(Contact,"  ",2),lvLName)
lvFName =strip( replace(Contact,lvLName,""))
;lvResult = "No Entry was found in the Apple Contacts for " +Contact

FileGlobal fgScript, fgResult
fgResult = ""

fgScript = “AppleScript |||
    tell application "Contacts"
	set theWho to "”+Contact+“"
	try
		set theContact to first person whose (name is theWho and organization is "”+Company+“")
	on error
		try
			set theContact to first person whose (name is theWho)
		on error
			display notification "No Entry was found in the Apple Contacts for " & theWho
			set theResult to "No Entry was found in the Apple Contacts for " & theWho
			return theResult 
		end try
	end try
	
	set selection to theContact
	set theName to name of theContact
	try
		set theOrg to organization of theContact
	on error
		set theOrg to ""
	end try
	try
		set Pos to the job title of theContact
	on error
		set Pos to ""
	end try
	try
		set Memo1 to (label of first phone) of theContact
	on error
		set Memo1 to ""
	end try
	try
		set Phone1 to (value of first phone) of theContact
	on error
		set Phone1 to ""
	end try
	try
		set Memo2 to (label of second phone) of theContact
	on error
		set Memo2 to ""
	end try
	try
		set Phone2 to (value of second phone) of theContact
	on error
		set Phone2 to ""
	end try
	try
		set Memo3 to (label of third phone) of theContact
	on error
		set Memo3 to ""
	end try
	try
		set Phone3 to (value of third phone) of theContact
	on error
		set Phone3 to ""
	end try
	try
		set Memo4 to (label of fourth phone) of theContact
	on error
		set Memo4 to ""
	end try
	try
		set Phone4 to (value of fourth phone) of theContact
	on error
		set Phone4 to ""
	end try
	try
		set Memo5 to (label of fifth phone) of theContact
	on error
		set Memo5 to ""
	end try
	try
		set Phone5 to (value of fifth phone) of theContact
	on error
		set Phone5 to ""
	end try
	try
		set Email1 to (value of first email) of theContact
	on error
		set Email1 to ""
	end try
	try
		set Email2 to (value of second email) of theContact
	on error
		set Email2 to ""
	end try
	try
		set Email3 to (value of third email) of theContact
	on error
		set Email3 to ""
	end try
	try
		set web to (value of first url) of theContact
	on error
		set web to ""
	end try
	try
		set AddSt to (street of first address) of theContact
	on error
		set AddSt to ""
	end try
	try
		set Cty to (city of first address) of theContact
	on error
		set Cty to ""
	end try
	try
		set Stt to (state of first address) of theContact
	on error
		set Stt to ""
	end try
	try
		set ZC to (zip of first address) of theContact
	on error
		set ZC to ""
	end try
	try
		set Cntry to (country of first address) of theContact
	on error
		set Cntry to ""
	end try
	try
		set Cmmnt to (note) of theContact
	on error
		set Cmmnt to ""
	end try
end tell

return theWho & "~" & theOrg & "~" & Pos & "~" & Memo1 & "~" & Phone1 & "~" & Memo2 & "~" & Phone2 & "~" & Memo3 & "~" & Phone3 & "~" & Memo4 & "~" & Phone4 & "~" & Memo5 & "~" & Phone5 & "~" & Email1 & "~" & Email2 & "~" & web & "~" & AddSt & "~" & Cty & "~" & Stt & "~" & ZC & "~" & Cntry & "~" & Cmmnt & "~"
|||,fgResult”

Execute fgScript

If fgResult beginswith “"No Entry” or fgResult = ""
    Rtn
Else


    If fgResult beginswith “"” fgResult = fgResult[2,-1] EndIf
    fgResult  = replace(arrayrange(fgResult,2,100,"~"),"missing value","")
    Local lvProcesor
    Company = array(fgResult,1,"~")
    Title = array(fgResult,2,"~")
    «Memo1» = array(fgResult,3,"~")
    lvProcesor = striptonum(array(fgResult,4,"~"))
    If lvProcesor = ""
        «Area Code1» = ""
        «Phone1» = ""
    Else
        «Area Code1» = sandwich("(",lvProcesor[1,-8],")")
        «Phone1» = lvProcesor[-7,-5]+"-"+lvProcesor[-4,-1]
    EndIf
    «Memo2» = array(fgResult,5,"~")
    lvProcesor = striptonum(array(fgResult,6,"~"))
    If lvProcesor = ""
        «Area Code2» = ""
        «Phone2» = ""
    Else
        «Area Code2» = sandwich("(",lvProcesor[1,-8],")")
        «Phone2» = lvProcesor[-7,-5]+"-"+lvProcesor[-4,-1]
    EndIf
    «Memo3» = array(fgResult,7,"~")
    lvProcesor = striptonum(array(fgResult,8,"~"))
    If lvProcesor = ""
        «Area Code3» = ""
        «Phone3» = ""
    Else
        «Area Code3» = sandwich("(",lvProcesor[1,-8],")")
        «Phone3» = lvProcesor[-7,-5]+"-"+lvProcesor[-4,-1]
    EndIf
    «Memo4» = array(fgResult,9,"~")
    lvProcesor = striptonum(array(fgResult,10,"~"))
    If lvProcesor = ""
        «Area Code4» = ""
        «Phone4» = ""
    Else
        «Area Code4» = sandwich("(",lvProcesor[1,-8],")")
        «Phone4» = lvProcesor[-7,-5]+"-"+lvProcesor[-4,-1]
    EndIf
    «Memo5» = array(fgResult,11,"~")
    lvProcesor = striptonum(array(fgResult,12,"~"))
    If lvProcesor = ""
        «Area Code5» = ""
        «Phone5» = ""
    Else
        «Area Code5» = sandwich("(",lvProcesor[1,-8],")")
        «Phone5» = lvProcesor[-7,-5]+"-"+lvProcesor[-4,-1]
    EndIf
    
    «Email Addresses» = strip(array(fgResult,13,"~")+¶+array(fgResult,14,"~"))
    
    URL = array(fgResult,15,"~")
    Address = array(fgResult,16,"~")
    City = array(fgResult,17,"~")

    State = array(fgResult,18,"~")
    «Zip Code» = array(fgResult,19,"~")
    Country = array(fgResult,20,"~")

    Comments  = array(fgResult,21,"~")
    ShowPage 
EndIf