[futurebasic] Re: applescript

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2005 : Group Archive : Group : All Groups

From: David Bailey <dabs@...>
Date: Sat, 26 Mar 2005 09:37:36 -0800
>
> David A. Bailey a écrit :
>> I have been working on a program that responds to filemaker by 
>> creating a
>> bar chart and copying the results to the clipboard that filemaker 
>> takes
>> and displays.  Kind of a poor mans plug-in.
>>
>> This simple script sends the data
>>
>> Tell application "My Application"
>> do shell script "100,100,300,120,blue"
>> end tell
>>
>> And by usng     on appleevent("****","****") fn domyfunction  in FB
>>
>> APPLEEVENTMESSAGE$ returns the correct text.
>>
>> I can create the chart and return the image to the clipboard.  The 
>> only
>> way I have been able to receive this text is to use the shell script
>> command from filemaker and use the "****" wild card to receive ALL 
>> events.
>>  Can anyone tell me the correct class, type, kind?  or the correct 
>> way to
>> send text using applescript from another application such as 
>> filemaker?
>>
>
> David,
>
> In FileMaker, create the script that will send the AppleEvent, you will
> have then the opportunity to designate the application that should
> receive the message. You probably know how to retrieve the values you
> want to send (I don't know how you would do it, but there's a field 
> that
> is meant to hold that text value).
>
> In your program, you can use the following statement :
>
> On AppleEvent("misc","dosc") Fn domyfunction
>
> You must probably build your application before setting it as the 
> target
> of the script in FileMaker because the later will use the creator code
> of your app.
>
> The AppleEventMessage$ will still retrieve the message sent.
>
> Not sure if all this is correct, but the test I have performed has
> worked as it seems.
>
> Alain
>
Thanks for the feedback.  I had to choose the "Do Applescript" command 
in Filemaker because Filemaker does not recognize ANY program created 
by FB including PG and any others.  If you select the "Send Event" 
option in Filemaker you are asked to select a target application.  All 
of FB programs are appearing noted as "Document" when the dialog box is 
displayed for selecting.  If you select it then "unknown" does not 
change in the Filemaker dialog. The one exception to this is the FB 
Editor, while it is labeled "Document" in the dialog box selecting it 
is successful and shows your choice.  I looked for something like the 
old "high level event aware" option using Resorcerer but found nothing. 
  Compiled with and without plst resources and nothing.  All other 
applications from mail to chess applications appear as applications and 
not documents.  Any idea why?

If I can get FIlemaker to recognize my application as an application 
then I can define the event and type and only check for that type and 
event in my program. Thanks again the for the response.

David