Re: Filemaker waiting for AS
Re: Filemaker waiting for AS
- Subject: Re: Filemaker waiting for AS
- From: Malcolm Fitzgerald <email@hidden>
- Date: Thu, 1 Mar 2007 08:38:10 +1100
On 01/03/2007, at 1:52 AM, Mirko Gude wrote:
Hi,
with a Filemaker DB (Version 5.5) I would like to open other FM files
with a FilemakerScript that goes to an AS like this:
tell application "Finder"
open file "xxxx"
end tell
After opening the file the same Filemaker DB should update some cells
with AS, but it does not work: the Filemaker DB xxxx is not open
(because it takes a few seconds). So the update runs into an error. I
tried to stopp the AS with delay oder the FilemakerScript with wait
Script, but it does not work. I put the two scripts into the script
editor and it works fine, but in filemaker it will not.
Any ideas?
You might try something like this. I've found it to be pretty good. I
find that passing the routine a generous number of seconds, like 120,
is enough.
--
to WaitUntilWindowExists(win, n)
-- subject windows take a while to open, so we should wait for them,
giving up after N seconds
set winExists to false
set counter to 0
repeat n times
if my WindowExists(win) then
delay 1 -- don't remove.
-- A deliberate pause after application creates window helps gives
better results
return
else -- wait
set counter to counter + 1
delay 1
end if
end repeat
return
end WaitUntilWindowExists
to WindowExists(win)
-- is the window there?
tell application "Filemaker Pro"
return name of every window contains win
end tell
end WindowExists
malcolm
_______________________________________________
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