Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Execute Applescript from Java - Possible?

Execute Applescript from Java - Possible?
Thread Tools
Fresh-Faced Recruit
Join Date: Jun 2002
Status: Offline
Reply With Quote
Jun 29, 2002, 09:01 AM
 
Hi all,

Is it possible for a Java app to execute an AppleScript, for example, a Java app has an edit field (or a variable) which you type in the AS - ' tell app "Finder" .......' , then you hit a button and the AS is executed.

I've seen a java method that can call an external AS file, but as there is not a file to call this is obviously not the right man for the job.

I'm pretty new to programming and would appreciate any pointers in the right direction.

Many thanks.
     
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Jun 29, 2002, 06:17 PM
 
Runtime.getRuntime().exec("whatever");

There's the setup...let's see you score the goal all by yourself.

<a href="http://java.sun.com/j2se/1.3/docs/api/" target="_blank">the APIs</a>

<small>[ 06-29-2002, 07:18 PM: Message edited by: Kristoff ]</small>
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jun 30, 2002, 03:23 AM
 
I think more to the point of what Hendy's looking for would be this: There's a command-line tool called osascript that can execute AppleScripts. Check out man osascript.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Jun 30, 2002, 06:04 AM
 
osascript is cool, but I really wish it didn't require you to be a GUI-logged-in user to use tell.. I really wish I could use it over ssh and control applications remotely.
[vash:~] banana% killall killall
Terminated
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:54 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2