Search Again:

Re: Events Error

From: Shawn Hogan
Date: Friday, July 18, 2003
Time: 11:26:23 am

Franklin Marmon wrote:

> After significant debugging what I've found is that the script works
> fine if the 'ApacheConf.fp5' db is in the foreground (executed from
> ScriptEditor) but fails if MainMenu.fp5 is in the foreground.
> FileMaker seems to be requiring db in the foreground to execute 'create
> new record'. This script, when executed from within the OG GUI creates
> a new, empty, 'Event' record in OG, rather than a new record in
> 'ApacheConf.fp5'. I get the same behavior if I change 'tell window' to
> 'tell database' within FileMaker (note: tell database doesn't seem to
> work from ScriptEditor).
>
> the 'Object not found.' error is appearing when filemaker tries to 'go
> to record newrecord' because 'newrecord' doesn't exist since 'create
> new record' created a record in the wrong file.
>
> I've tried entering various gross hacks like 'open file apacheConf'
> where apacheConf is the path to the ApacheConf.fp5 file. This didn't
> work. I also tried doing this, which didn't work with an odd error ('A
> number can't got after this property')
>
> tell window "ApacheConf.fp5" of application "FileMaker Pro"
> set index 1
> end tell
>
> As I understand the FileMaker Pro AppleScript dictionary, you use 'set
> index #' to reposition a window within the program. I could be wrong
> there, but it looks that way to me.
>
> Ideas?

Use the "in database" clause... for example:

tell application "FileMaker Pro"
set maxrecords to count records in database "ApacheConf.fp5"
create new record in database "ApacheConf.fp5"
set newrecord to maxrecords + 1
go to record newrecord in database "ApacheConf.fp5"
set data field "Login" to "<Login>" in database "ApacheConf.fp5"
set data field "Product_ID" to "<BProdID>" in database "ApacheConf.fp5"
do script "select_first_domain" in database "ApacheConf.fp5"
do script "do_recalc" in database "ApacheConf.fp5"
do script "do_ssh" in database "ApacheConf.fp5"
delete record newrecord in database "ApacheConf.fp5"
end tell

Of course I have not tested it, but it should work I think.

- Shawn

----------------------------------
Shawn D. Hogan
President, Digital Point Solutions
http://www.digitalpoint.com
(858) 452-3696


---------------------------------------------------
To subscribe, unsubscribe or to search list archive
please visit http://www.optigold.com/lists/isp.html
---------------------------------------------------



Messages In This Thread:



Return to Digital Point Solutions' Home Page