# Applescript Calls into Servoy Client

**URL:** <https://forum.servoy.com/t/applescript-calls-into-servoy-client/6693>\
**Category:** Classic Servoy\
**Created:** [November 6, 2006, 1:05am UTC](https://forum.servoy.com/t/applescript-calls-into-servoy-client/6693 "2006-11-06T01:05:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [November 6, 2006, 1:05am UTC](https://forum.servoy.com/t/applescript-calls-into-servoy-client/6693/1 "2006-11-06T01:05:56Z")

</div>

I really need applescript support into the Servoy Client. I know the client can execute applescript, but I need to be able to make calls into the client.

I’ve looked at the rest of the posts in the forum, and nothing has worked.  
I’ve also looked at using the UI Brower ([http://www.apple.com/applescript/uiscripting/index.html](http://www.apple.com/applescript/uiscripting/index.html)) to sends applescript commands to the Servoy Client application, but have had no success.

I have tried these 2 scripts to set values of fields in Servoy, and neither of them work.

This compiles, but doesn’t work

```auto
tell application "System Events"
	tell process "Servoy Client"
		tell window 1
			tell scroll area 1
				set the value of text field 2 to "test"
			end tell
		end tell
	end tell
end tell

```

This one doesn’t compile

```auto
tell application "Servoy Client"
		tell window 1
			tell scroll area 1
				set the value of text field 2 to "test"
			end tell
		end tell
	end tell

```

I have been able to get this script to work to get values of fields…

```auto
tell application "System Events"
	tell process "Servoy Client"
		tell window 1
			tell scroll area 1
				set myTest to the value of text field 2
				display dialog myTest
			end tell
		end tell
	end tell
end tell

```

---

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [November 6, 2006, 2:10am UTC](https://forum.servoy.com/t/applescript-calls-into-servoy-client/6693/2 "2006-11-06T02:10:25Z")

</div>

Temporarily, I’ve worked out this nasty solution to set clipboard to Servoy code, then run an applescript to click a menu item that runs a Servoy method to evaluate what is in the clipboard. I really hope Servoy can come up with something better? Please?

The applescript

```auto
tell application "Servoy Client"
	activate
end tell

--set to code that you would put in method editor
set the clipboard to "forms.busmod_docmgt_Main.fle_casenbr = '99'"

tell application "System Events"
	tell process "Servoy Client"
		tell menu bar 1
			tell menu bar item "Methods"
				tell menu 1
					click menu item "Run_Applescript"
				end tell
			end tell
		end tell
	end tell
end tell

```

The global method “Run\_Applescript”

```auto
eval(application.getClipboardString())

```

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [November 6, 2006, 9:11am UTC](https://forum.servoy.com/t/applescript-calls-into-servoy-client/6693/3 "2006-11-06T09:11:57Z")

</div>

Hi Scott,

An application has to support AppleScript to be able to script it. In fact an app has to define what apple events it supports and what to do with it.  
**Maybe** Apple have some AppleScript support built into the JVM to some extend that allows you to get values but I don’t think Servoy Client has AppleScript support built in.  
So some AppleScripts might compile simply because the syntax is correct and will send apple events to Servoy Client but Servoy Client is not ‘listening’ so nothing will ever happen.

I hope this explains things.

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [November 6, 2006, 9:41am UTC](https://forum.servoy.com/t/applescript-calls-into-servoy-client/6693/4 "2006-11-06T09:41:32Z")

</div>

Hi Scott,

I have not taken the time to read it yet but I found this [https://jasconn.dev.java.net/](https://jasconn.dev.java.net/).

Looks like a new and promising project, however based on Java 6.0 which is still alpha/beta for the mac…

Hope this helps, please let me/us know what you think of it (saves reading time ![:)]( "Smile") ).

---

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [November 6, 2006, 2:31pm UTC](https://forum.servoy.com/t/applescript-calls-into-servoy-client/6693/5 "2006-11-06T14:31:15Z")

</div>

> I have not taken the time to read it yet but I found this [https://jasconn.dev.java.net/](https://jasconn.dev.java.net/).

Looks like that may work, but like you said it requires Java 6. It would also require Servoy to build that into the Servoy Client app…if I’m reading it correctly.

I also looked at the URL below, and Apple basically says you can add basic applescript support, like print, open, etc, but additional functionality can only be added through UI Scripting  
[http://developer.apple.com/documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html](http://developer.apple.com/documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html)

If Servoy Client were a Cocoa-Java app, it would be pretty easy…

> **[O'Reilly Media - Technology and Business Training](https://www.oreilly.com/)**
>
> Gain technology and business knowledge and hone your skills with learning resources created and curated by O'Reilly's experts: live online training, video, books, our platform has content from 200+ of the world's best publishers.
