On Jan 25, 2006, at 2:43 PM, Paul Young wrote:

Using RB 2006 Rev 1 on Mac OS 10.4.5

I have successfully called an AppleScript without a parameter from a PushButton's Action but I have not been able to call an AppleScript with a parameter.

Hi Paul -

It wasn't clear, but it appears that you may have inadvertently tried to enter some AppleScript code in the REALbasic IDE.

Try this:

Open the Applescript Script Editor and enter this code:

   on run {theText}
        display dialog theText
   end run

Save this script with the name "TestScript".
Drag this script into your REALbasic project.
Put this line of code in a button (or somewhere appropriate):

  TestScript "hello"


in case you want this in the future, here's an example of how to return a value from an AppleScript:

AppleScript code:

   on run {x}
        return x * 2
   end run

REALbasic code:

MsgBox testScript("3") //Even though we're dealing with numbers everything is passed as strings.


Hope this helps, David
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to