Re: FileMaker - Scripting Remote DataBase
Re: FileMaker - Scripting Remote DataBase
- Subject: Re: FileMaker - Scripting Remote DataBase
- From: Geoff Graham <email@hidden>
- Date: Wed, 16 Jun 2010 12:21:20 -0400
You're right. It didn't used to be this way. I get the same results on 10.4 and 10.6; FM10 and FM11. The following works fine on the local frontmost database:
tell application "FileMaker Pro Advanced"
activate
set NewRecord to (create new record)
go to NewRecord
tell NewRecord
set cell "test" to "blah"
end tell
end tell
on a remote database, it creates the record; it just wont go to it, although It gets what appears to be a valid reference:
record id 5.0 of window "test" of application "FileMaker Pro Advanced"
I'm sure (well I hope) there's still a way to address a record, I bet they have just moved/changed some hierarchy (again). What you're doing (and what I tried to do) is supposed to (and used to) work though; I'm not sure when it stopped. God help you trying to consistently address a record by number instead of ID down there.
I'd like to sit down with Script Debugger and explore the new FM from the backside, but due dates prevent me from having this fun :)
good luck man and sorry I couldn't help you.
Geoff
On Jun 16, 2010, at 10:58 AM, Steve Valenti wrote:
> Here’s an insane way to search and refer to a record on a Remote Database. It takes a lot of time to search a cell of every record. There has to be a way to script a Remote Database or why would they include a command like “get remote URL”. Two basic commands set MyRequest to create new request andset NewRecord to create new record can’t return a result from a remote DB. WHY??? Am I not addressing it correct for a remote db???
>
>
> set InsigniaDB to "Whatever" --Contents of a cell to search for
>
> tell application "Runtime"
> tell database "NameOfDataBase.fp7"
> --Search for existing record
> show every record
> set AllRecords to count of records of window "NameOfWindow"
> repeat with i from 1 to AllRecords
> if cell "Insignia" of record i is InsigniaDB then
> go to record i of window "NameOfWindow"
> exit repeat
> end if
>
> --No matching record found, make new record
> if i = AllRecords then
> create new record of window "NameOfWindow"
> set LastRecord to count of records of window "NameOfWindow"
> go to record LastRecord of window "NameOfWindow"
> set i to (i + 1)
> end if
>
> end repeat
>
> tell record i
> --Do whatever
> end tell
>
> end tell
> end tell
>
> From: Steve Valenti
> Sent: Tuesday, June 15, 2010 4:12 PM
> To: 'liste AppleScript US'
> Subject: RE: FileMaker - Scripting Remote DataBase
>
> Adding the "go to layout layoutname" didn’t help. If you take the command “create new record” it does make a new record but the set variable gets no reference to it. Then if you try to add “go to MyRequest” on the next line it will error because the object can’t be found. What is with Remote Databases. This is like buying on off-road vehicle and only allowed to drive it on a road…
> Steven
>
>
>
>
> Try throwing a "go to layout layoutname" in there right after the tell database. For what you're doing, you really shouldn't have to, but I've seen that work before.
>
> Geoff
>
> On Jun 15, 2010, at 1:41 PM, Steve Valenti wrote:
>
>
> I built scripting to automatically populate a database and everything works great when I open the database on the machine. Now I need to move this database to FileMaker Server and open it on a client as a remote database and run my scripting to keep populating it. However scripting of a remote database doesn’t behave the same. Here are two examples when trying to script a remote database that you don’t get any results to work with. If you were to run one at a time it really shouldn’t error. FileMaker Server 11 doesn’t seem to be the trouble because I tried just sharing from FileMaker Pro 10 software with the same results.
>
> tell application "FileMaker Pro Advanced"
> tell database "NameOfDataBase.fp7"
> show every record
> delete every request
> set MyRequest to create new request --Error
> --Object not found. (-1728)
>
> set NewRecord to create new record --Error
> --Object not found. (-1728)
> end tell
> end tell
>
> Does anyone have any experience in scripting remote databases? The show every record command works. What makes remote DB different?
>
> Thanks!!!
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden