Re: FileMaker 10 - asynchronous commands?
Re: FileMaker 10 - asynchronous commands?
- Subject: Re: FileMaker 10 - asynchronous commands?
- From: Simon Forster <email@hidden>
- Date: Tue, 5 Jan 2010 11:49:51 +0000
Hi Wayne
My FileMaker Pro AppleScripts are peppered with:
do script FileMaker script <someScript>
--Call "modified"
--Forces handler to wait for the database to complete script
modified
Not too sure if this is still an issue with FileMaker 10 but old habits...
Having said this, I've always found FileMaker to be tediously synchronous when it comes to straight AppleScript commands - so your show command should work if strName exists.
FWIW, (and I'm happy to be corrected on this by those more knowledgeable) I've found that the easiest way to script FileMaker to give consistent results is to be boringly long-handed and code as if one were using FileMaker's GUI. With this in mind "show" is out. Instead, go to layout. Delete any existing searches. Create new search, yadda, yadda:
--IP
go to layout "ip"
if (count of request) > 0 then delete every request
create request
set cell "ip_IP" of request 1 to contents of item 2 of thisItem
find
if (count of record) = 0 then
--display dialog (count of record)
create new record
set cell "ip_IP" of current record to contents of item 2 of thisItem
end if
--Queries
go to layout "queries"
create new record
tell last record
set cell "kf_ip_ip_QUERIES" to contents of item 2 of thisItem
set cell "kf_source_QUERIES" to sourceRef
set cell "number_Queries" to contents of item 1 of thisItem
end tell
I guess I'm sacrificing some speed for reproducibility/reliability.
HTH
Simon
On 5 Jan 2010, at 10:19, Wayne Melrose wrote:
> Hi all,
>
> I've done a fair amount of FileMaker scripting in the last few years, I rarely run into problems that I can't fix.
>
> My current issue I solved by changing my code entirely (I did it with FileMaker commands instead), which has probably made it more solid anyway. But the issue raised some questions that I thought would be worth asking..
>
> When running an applescript within a FileMaker script, are all commands asynchronous?
>
> My problem was that an old Pentium MacMini seemed to cause my script to crash when switching from one layout to another and showing all records...
>
> Here's a basic model of the script..
>
> tell application "FileMaker Pro"
> tell database "contacts"
> tell front window
> tell current record
> set strName to cell "name"
> end tell
> -- ### these next two lines seemed to take place after the error
> go to layout "B"
> show every record
> -- ###
>
> -- this line would error, because the record was not currently in the found set (the "show every record" command had not run)
> show (every record whose cell "name" = strName)
> end tell
> end tell
> end tell
>
> Any thoughts?
>
> Thanks
>
> Wayne
> _______________________________________________
> 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