jdenver Posted January 8, 2008 Posted January 8, 2008 (edited) I have a program that returns a phone number when a person calls, the properties are CIDnumber. Ive create a layout with a number field in my database called CIDinfo, this field is on the new layout. How do I get the number stored in CIDnumber to be entered into the field CIDinfo box on the layout? or have I gone about this in the wrong way. Ive used applescript to start FM when a person rings but not sure where to go from there. Any help will be appreciated. Edited January 8, 2008 by Guest
Lee Smith Posted January 8, 2008 Posted January 8, 2008 What program is [color:blue] CIDnumber a part of? If it isn't in a FileMaker database, you will have to import it, into your database. If is is part of a FileMaker database, then should be able to populate your [color:blue] CIDinfo via a calculation, or script using a relationship. HTH Lee
jdenver Posted January 8, 2008 Author Posted January 8, 2008 Hi the CIDnumber is from a program called CallerID. When a call is received this program will display the callers number, it can also be set to run a script. At the moment it runs a Address book script that it came with, this opens address book and displays the callers details if in the Address book. The only info I have from the program regarding scripting is: [color:blue](* Copyright, ©2007, Apimac Software Caller ID Test Script This script only show the use of properties passed from Caller ID availables for using in scripting. When executed from Caller ID the following properties are available: CIDDate The date and time of the call This property must be converted to an AppleScript date object first CIDname The caller name associated to the phone number This property can be " " if a name is not available CIDnumber The caller number This property can be " " if a number is not available CIDcardID The Address Book ID for the caller card This property can be " " if the caller is not in Address Book CIDscript The script file called *) -- convert Caller ID date to AppleScript date object set CIDDate to date CIDDate set theMessage to "A phone call was received from " & CIDname & "(" & CIDnumber & ") on " & CIDDate if CIDcardID is not equal to " " then set theMessage to theMessage & ". Address Book card ID is: " & CIDcardID end if display dialog theMessage buttons {"OK"} default button 1 with title "Caller ID" with icon note giving up after 10 I just need some pointers in the right direction - Thanks
Lee Smith Posted January 8, 2008 Posted January 8, 2008 I'm not the AppleScript expert, that would be Fenton, but can you export or save the data as text, or in a database format?
jdenver Posted January 8, 2008 Author Posted January 8, 2008 That I don't know whether it can be saved or not, How can I get hold of Fenton?
Lee Smith Posted January 8, 2008 Posted January 8, 2008 (edited) In the phone program, what options do you have under the File Menu? Fenton is a member of the Forum, who usually will speak up on topics involving AppleScript, however, his participation would be based on his being available, and having some knowledge of your particular problem. In other words, you don't contact him, but he will reply if he wants to. In the mean time, You need to investigate the abilities of this other program. Start by reading the manual, and see if it has a export, or if you can print the reports to text documents. I used to use FAXstf (prior to OS X), and I could save my reports to Text. This could then be imported into FileMaker. Lee p.s., I just did a search for CallerID, and I don't see a Mac version. Can you point to their Site, or give me the company that owns it. tks Edited January 8, 2008 by Guest p.s.
jdenver Posted January 8, 2008 Author Posted January 8, 2008 Thanks for your help lee, the web site is http://www.apimac.com/ There is a log file that logs the calls, but thats not what I want. At present the phone rings and Address Book opens displaying the details of the caller because the script that came with the program opens AB and passes the callers phone number over, AB then searches for the number. I need to write a script that opens FM and passes the number over for FM to search instead of AB. All this needs to happen within seconds of the phone ringing.
Lee Smith Posted January 8, 2008 Posted January 8, 2008 I didn't hook this up to my modem yet, so I can't see on screen the information record at the time the call is received. However, there is a big Button that says Export, and it seems to export the data. What is not in the export that you want? Lee
jdenver Posted January 8, 2008 Author Posted January 8, 2008 I see what you are saying but thats not what I want. As a call comes in I want FM to open and after searching the database using the phone number passed to it, displays the address details of the customer calling. As far as I know the properties the caller ID program passes over is CIDnumber and some how via a script that needs to be entered into FM.
Lee Smith Posted January 8, 2008 Posted January 8, 2008 (edited) The way I read the info on this, is that it is able open a local address book. Aren't they talking about the in OS X? There is a support line at the site you posted, have you posted your questions there? Lee Edited January 8, 2008 by Guest
Fenton Posted January 8, 2008 Posted January 8, 2008 Something like: tell app "your caller program" set CID_number to CIDnumber end tell set database_name to "your FileMaker database" set layout_name to "Call Log" tell application "FileMaker Pro" go to database database_name tell layout layout_name set newRec to create new record go to newRec set cell "CID_number" of current record to CID_number end tell end tell
Søren Dyhr Posted January 8, 2008 Posted January 8, 2008 Is the script you mention in: http://www.fmforums.com/forum/showpost.php?post/277246/ ...executed each time the phone rings? If it does the rewrite the line where the set theMessage to "A phone call was received from " & CIDname & "(" & CIDnumber & ") on " & CIDDate occures and issue something like tell application "Filemaker Pro" Go to (create new record) set cell 1 of current record to CIDName set cell 2 of current record to CIDDate set cell 3 of current record to CIDnumber end tell Alright I've meanwhile seen you ask the same thing here: http://www.apimac.com/forums/showthread.php?t=6043 So it actually appears that you in the prefs assign a script to when the phone rings this means the logic from the AB script following the download should be converted to Filemakers applescript implementation. The above will make a new record each time, but you could make a search in your filemaker base, to see if the caller was known. tell application "Filemaker Pro" show (every record whose cell 2 is CIDNumber) set sourceRec to get current record end tell What you need to realize here is that the last line gives you the entire records data including the stuffstored in the portal rows if the scrollbar has been assigned. This will give you a listing in the visinity of {"1", {"Jacob Lavetz", "Søren Dyhr"}, {"03/01/2008", "03/01/2008"}, {"52", "52"}} where each inner bracket is a column in the portal while the outmost is the parentrecords data in the above set just "1", and if you need to add a new record in the portal should the portal at least allow creation of related records - but you data needs to their respective column brackets via applescript commands like "at the end of" - hope you're getting it? you're bound tinker a lot before you can make it work. The portal is an urgent detail, since some contacts might call more than once. Next thing you need to worry about is if no record exist yet! --sd
jdenver Posted January 8, 2008 Author Posted January 8, 2008 Thanks for that Fenton, I've entered in the relevant info and it almost works. Its pointed me in the right direction. I need to learn applescript. Thanks again lee for your help
jdenver Posted January 8, 2008 Author Posted January 8, 2008 Thanks Søren Dyhr for your help, I will have a tinker with all the info given and see how we get on. Any ideas on the best way to learn applescript? What Books or internet sites would you recommend.
Søren Dyhr Posted January 8, 2008 Posted January 8, 2008 http://bbs.applescript.net/viewforum.php?id=2 --sd
comment Posted January 8, 2008 Posted January 8, 2008 I would say start at: http://applescriptsourcebook.com/index.php and: http://www.apple.com/applescript/learn.html and perhaps: http://www.mactech.com/articles/mactech/Vol.22/22.04/ScriptingFileMakerPro/index.html
Søren Dyhr Posted January 9, 2008 Posted January 9, 2008 Unfortunately doesn't any of these linkings provide methods to write a new portalrow of logging, the links provides two methods to locate a record of a CIDNumber if it exists, but you have to facilitate your layout with a way to create new portal rows, and here doesn't IMHO exist a good method to deal with the record regarded and entire object, allthough you set "Allow to create related..." on for the portal, will the as- object not be recognized by filemaker except when creating a completely new record: http://tokerud.typepad.com/filemaker/2006/06/index.html ...I envision multiuser problems here, if you make a new record with your addition to the end of the object, and then via an internal script seek to dedupe in the parent record table, if two users fires the script almost simultaneously will each make his her own dupe, and delete the collegues newly created record. No another way to circumvent the "Allow creation of..." needs to be made in the layout, until just yet did I believe that the "New Record Only" technique mentioned in page 479 in "Special Edition Using Filemaker 8" have stopped working with the later upgrades. Well it seems so at least, but then did I discover that if you executes this applescript: tell application "FileMaker Pro Advanced" tell current record set aVar to cell "RecordID" set cell "Loggings 2::ForeignKey" to aVar set cell "Loggings::SomeData" to "aaa" end tell end tell ...with the attached template, could you at least create the new portal row and write to the first record in the relation, this means the relations sortorder needs to be the reverse of the creation order, bringing the latest to the top of the portal. Now what I write as "aaa" in the second line of the AS could be whatever. What I here utilize is a typecast between the two keyfields, primarykey in the creator method is text, and the enherited key value gets then typecast and the connection breaks immidiately after the primary key from the current record is written as normal field in the creater relation. It seems like you can't leave the trigger field out of the layout, but it never gets any lasting value I've prevented user actions to the field by hiding it under an invisible button and plucked it out of the tab-order. Beyond this is the location of the callers ID pretty straight forward reading in the MacTech article Comment provided us with an URL to. --sd phoneLog.zip
jdenver Posted January 9, 2008 Author Posted January 9, 2008 Thanks Søren for your input and time in this. Im going to have to sit down and work through this. I have installed the FM layout and run the script you attached and it all worked. I need to understand more on how applescript and FM works before I can move forward. Thanks again
Recommended Posts
This topic is 6161 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now