# executeProgram

**URL:** <https://forum.servoy.com/t/executeprogram/62>\
**Category:** Classic Servoy\
**Created:** [May 22, 2003, 4:21pm UTC](https://forum.servoy.com/t/executeprogram/62 "2003-05-22T16:21:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://forum.servoy.com/u/david)\
**Post date:** [May 22, 2003, 4:21pm UTC](https://forum.servoy.com/t/executeprogram/62/1 "2003-05-22T16:21:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [May 28, 2003, 7:18am UTC](https://forum.servoy.com/t/executeprogram/62/2 "2003-05-28T07:18:46Z")

</div>

The correct syntax is:

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

```

in your case:

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

```

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

---

<div class="post-metadata">

**Author:** ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://forum.servoy.com/u/david)\
**Post date:** [May 28, 2003, 5:13pm UTC](https://forum.servoy.com/t/executeprogram/62/3 "2003-05-28T17:13:28Z")

</div>

![:shock:]( "Shocked") ← my stunned look first time running an applescript from Servoy…

![:P]( "Razz") ← me realizing I can do anything now!

![:twisted:]( "Twisted Evil") ← including ruling the world ![:wink:]( "Wink")

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

- david

---

<div class="post-metadata">

**Author:** ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://forum.servoy.com/u/david)\
**Post date:** [May 28, 2003, 7:23pm UTC](https://forum.servoy.com/t/executeprogram/62/4 "2003-05-28T19:23:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [May 28, 2003, 10:19pm UTC](https://forum.servoy.com/t/executeprogram/62/5 "2003-05-28T22:19:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bruce\_Robertson](https://avatars.discourse-cdn.com/v4/letter/b/6f9a4e/32.png) [@Bruce\_Robertson](https://forum.servoy.com/u/Bruce_Robertson)\
**Post date:** [September 9, 2003, 8:01am UTC](https://forum.servoy.com/t/executeprogram/62/6 "2003-09-09T08:01:49Z")

</div>

> 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?

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [September 9, 2003, 9:10am UTC](https://forum.servoy.com/t/executeprogram/62/7 "2003-09-09T09:10:08Z")

</div>

> 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
