executeProgram

I’m trying to find an example of how to use the “application.executeProgram(Object)” function. Since I’m on OS X, what does “specify the cmd as you would do in a console” mean for me?

I would like to be able to call an applescript somehow from Servoy and was hoping I could do something along the lines of: “application.executeProgram(‘osascript script_file_name’)” where “osascript script_file_name” is what I would type in OS X Terminal application to run an applescript contained in a file.

  • david

The correct syntax is:

application.executeProgram('program','argument1','argument2',.........,'argumentx')

in your case:

application.executeProgram('osascript','script_file_name') 

I’ll ask the docs team to update the documenation accordingly

:shock: ← my stunned look first time running an applescript from Servoy…

:P ← me realizing I can do anything now!

:twisted: ← including ruling the world :wink:

I’ve just been waiting to play with those little things…

  • david

This works with developer with the file “beep” is in the Servoy application folder:

application.executeProgram(‘osascript’, ‘beep’);

Where do I put the file so Servoy client will run it? I’ve tried the local folder where the servoy client app is at as well as Java Web Start directory where there are a bunch of servoy client files.

Or is executeProgram() limited to developer only?

  • david

the best is to specify a full path. On client it could be different places where your current path is.

or a URL if that is supported by Applescript

jaleman:
the best is to specify a full path. On client it could be different places where your current path is.

or a URL if that is supported by Applescript

You can’t put the script text in a text field or variable? Or store a compiled script in a blob?

Bruce Robertson:

jaleman:
the best is to specify a full path. On client it could be different places where your current path is.

or a URL if that is supported by Applescript

You can’t put the script text in a text field or variable? Or store a compiled script in a blob?

Both are possible