Page 1 of 1

Using LiveCode to control another app

Posted: Wed Oct 20, 2010 11:06 pm
by adventuresofgreg
I would like to use LiveCode to control another application which is is a Java app. Is it possible to use AppleScript or AppleEvents and LiveCode to do this?

If so, I need help integrating that.

Greg

Re: Using LiveCode to control another app

Posted: Fri Oct 22, 2010 2:11 pm
by Mark
Greg,

Probably, this is impossible, since it is Java. You might want to ask the developer of that Java app.

What exactly do you want to do?

Best,

Mark

Re: Using LiveCode to control another app

Posted: Fri Oct 22, 2010 2:56 pm
by adventuresofgreg
The Java app is used by clients of a broker to buy and sell stocks, commodities, manage portfolios, retrieve market data, etc. The interface is good, but VERY manual. I need to enter multiple orders on a daily basis that are very complex - different time conditions, various symbols, expiry dates, etc, etc. Doing it manually each time will eventually lead to making errors and since all of the information is part of my LiveCode app, I really want to have it all done automatically.

The company makes API's available for this Java app: Java, C++, Excel, but does not seem to offer any applescript support. There Excel API looks like it could work for me, but it only works on Windows and I would like to avoid that. I think I can use Applescript GUI scripting, but it would be a big learning curve for me. I'd rather just have someone write all the AS for me and then I can insert components, as required into my LiveCode script.

Greg

Re: Using LiveCode to control another app

Posted: Sat Oct 23, 2010 11:59 pm
by Mark
Hi Greg,

Do you have a link to a website about the software you are using as well as those API's?

Mark

Re: Using LiveCode to control another app

Posted: Tue Oct 26, 2010 2:52 pm
by adventuresofgreg
Mark wrote:Hi Greg,

Do you have a link to a website about the software you are using as well as those API's?

Mark
yep - there is plenty of documentation here:
http://www.interactivebrokers.com/en/ge ... Guides.php

Re: Using LiveCode to control another app

Posted: Tue Oct 26, 2010 4:31 pm
by Mark
adventuresofgreg ,

I downloaded the TWSApp software at http://qurl.tk/jg and installed it, but I can't get beyond the login window. That means I can't say much about it.

I don't think that this JAVA-application can be accessed using GUI scripting. AppleScript can't even find the application after it has been compiled from the JAR file. I did a test with another JAVA application and ran into the same problem.

Your best bet is paying a few 100 bucks for an external, which would use the C++ API. This would allow you to make your own automatable interface.

Best regards,

Mark

Re: Using LiveCode to control another app

Posted: Tue Oct 26, 2010 5:37 pm
by adventuresofgreg
Mark wrote:adventuresofgreg ,

I downloaded the TWSApp software at http://qurl.tk/jg and installed it, but I can't get beyond the login window. That means I can't say much about it.

I don't think that this JAVA-application can be accessed using GUI scripting. AppleScript can't even find the application after it has been compiled from the JAR file. I did a test with another JAVA application and ran into the same problem.

Your best bet is paying a few 100 bucks for an external, which would use the C++ API. This would allow you to make your own automatable interface.

Best regards,

Mark
Hi Mark: If you go to the main page:

http://www.interactivebrokers.com/en/main.php

You can dowload a demo TW account that works.

Also - I am fully willing to have someone write an external for me using the c++ API - however, as I recall from reading some of the documentation, the C++ API runs on windows only, as does the Excel API. I think it's just the Java API that runs on both platforms (but I might be wrong ??).

Greg

Re: Using LiveCode to control another app

Posted: Tue Oct 26, 2010 7:05 pm
by Mark
Hi Greg,

According to the website, a Mac version of thje C++ API is available: "Includes the Java Socket API, Posix C++ Socket API and sample code for each." You need to use the Posix C++ Socket API.

Best,

Mark

Re: Using LiveCode to control another app

Posted: Tue Oct 26, 2010 7:34 pm
by adventuresofgreg
Mark wrote:Hi Greg,

According to the website, a Mac version of thje C++ API is available: "Includes the Java Socket API, Posix C++ Socket API and sample code for each." You need to use the Posix C++ Socket API.

Best,

Mark
cool. Lets email or better yet phone. greg@justgreg.com 403-242-5482

Re: Using LiveCode to control another app

Posted: Wed Oct 27, 2010 1:34 am
by Mark
adventuresofgreg ,

I'm not sure I'm the right person to help you with this. I'd probably cost more than a few 100 bucks. If you can't find anyone, feel free to contact me.

Kind regards,

Mark