Search Again:

Re: Events Error

From: Franklin Marmon
Date: Friday, July 18, 2003
Time: 12:12:47 pm


Ahh, this syntax seems to work (last two commands commented out for
testing) for the most part anyway.

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


The script "select_first_domain" doesn't seem to properly fill in the
values however. Since I am not deleting the new record, I can go into
the DB after running this from either the web interface or the GUI and
manually run 'select_first_domain' from the scripts menu and it works
fine. But running it from here seems to fail.

Boggle.

frm

On Friday, July 18, 2003, at 12:25 PM, Shawn Hogan wrote:

> 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
> ---------------------------------------------------

--Apple-Mail-2-791408318



Messages In This Thread:



Return to Digital Point Solutions' Home Page