Re: [X-Post] Triggering a FileMaker Script with AppleScript
Re: [X-Post] Triggering a FileMaker Script with AppleScript
- Subject: Re: [X-Post] Triggering a FileMaker Script with AppleScript
- From: Deivy Petrescu <email@hidden>
- Date: Mon, 08 Mar 2010 18:26:25 -0500
On 08/03/2010, at 18:21 , sono-io wrote:
> I added some code to my solution, which I thought should work, but I probably didn't do it correctly. This should repeat up to 3 times, with a pause of 5 seconds between attempts, before exiting, or exit when FileMaker receives the input.
>
> set numberOfTries to 1
> set isFileMakerReady to false
>
> repeat until isFileMakerReady
>
> if numberOfTries = 3 then
> exit repeat
> end if
>
> try
> tell application "FileMaker Pro Advanced"
> activate
> go to database "Call Log"
>
> set data cell "g_Dialectic_Number" of table "Call_Log" to "711-222-3456"
> set data cell "g_Dialectic_Name" of table "Call_Log" to "contact_name"
>
> do script FileMaker script "Dialectic Caller ID Lookup"
>
> set isFileMakerReady to true
> end tell
>
> on error e
> display dialog "Error: " & e buttons {"OK"} default button 1 with icon 0 giving up after 30 -- for testing only
> delay 5
> set numberOfTries to numberOfTries + 1
> end try
>
> end repeat
>
> The problems I'm seeing are:
>
> 1] the loop is not exiting
> 2] the display dialog that I added for testing purposes to the on error handler is never shown
> 3] when FileMaker does become free, I get double entries in the db
> 4] FileMaker is no longer coming to the foreground when this script is triggered
>
> What am I doing wrong?
>
> Thanks,
> Marc
Try this
set numberOfTries to 1
set isFileMakerReady to false
repeat until isFileMakerReady
if numberOfTries = 3 then
exit repeat
end if
try
tell application "FileMaker Pro Advanced"
activate
go to database "Call Log"
set data cell "g_Dialectic_Number" of table "Call_Log" to "711-222-3456"
set data cell "g_Dialectic_Name" of table "Call_Log" to "contact_name"
do script FileMaker script "Dialectic Caller ID Lookup"
set isFileMakerReady to true
end tell
on error e
display dialog "Error: " & e buttons {"OK"} default button 1 with icon 0 giving up after 30 -- for testing only
end try
-- outside the try block!
delay 5
set numberOfTries to numberOfTries + 1
end repeat
Deivy Petrescu
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