1) Do you want to run AppleScripts from Servoy? It's easy and it works in Developer and Client (on a Mac of course).
Create a sample script:
>tell application "Finder"
> say "sweet!"
>end tell
Save it as text format.
Load the file into a blob field. (Make sure the field type is 'media', then you can right-click on the field to load a file into the field.)
Create a method that will run the script stored in the blob field:
>application.writeFile('my_script', blob_field);
>application.executeProgram('osascript','my_script');
Storing the AppleScript in a blob field has a major advantage: you don't have to worry about whether or not the script is present on the client machine in the correct directory. The disadvantage is that if the script is large and you use it a lot, saving the script every time adds a lot overhead.
2) Let's run an AppleScript that runs a shell command that returns the contents of the current working directory.
Here's the AppleScript:
>set my_folder to (do shell script "ls")
Here's the Servoy method:
>application.writeFile('my_script', blob_field);
>globals.terminal_result=application.executeProgram('osascript','my_script');
To see the results, put "globals.terminal_result" on a form as a text area field.
Summary: don't blow your machine up with all this power.
- david