Applescript Calls into Servoy Client

Discuss all feature requests you have for a new Servoy versions here. Make sure to be clear about what you want, provide an example and indicate how important the feature is for you

Applescript Calls into Servoy Client

Postby sbutler » Mon Nov 06, 2006 3:05 am

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) 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
Code: Select all
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
Code: Select all
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...
Code: Select all
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
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Postby sbutler » Mon Nov 06, 2006 4:10 am

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
Code: Select all
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"
Code: Select all
eval(application.getClipboardString())
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Postby ROCLASI » Mon Nov 06, 2006 11:11 am

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.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Postby IT2Be » Mon Nov 06, 2006 11:41 am

Hi Scott,

I have not taken the time to read it yet but I found this 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 :) ).
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby sbutler » Mon Nov 06, 2006 4:31 pm

I have not taken the time to read it yet but I found this 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

If Servoy Client were a Cocoa-Java app, it would be pretty easy...
http://www.oreillynet.com/pub/a/mac/2004/10/22/cocoa.html
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH


Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 5 guests