Re: Launching applescript from a Java environment
Re: Launching applescript from a Java environment
- Subject: Re: Launching applescript from a Java environment
- From: Giorgio Valoti <email@hidden>
- Date: Fri, 21 Nov 2003 22:49:55 +0100
On 21/nov/03, at 11:45, Karl Kennedy wrote:
Anybody have any experience with it ? Iknow its possible,but has
anyboby tried it and if so,how did you manage it?
With Java-Cocoa, you could do something like:
NSData scriptData = new NSData
( new File( NSBundle.mainBundle().pathForResource(
"MyScript", "applescript" ) ) ); //If your script file is an app's
resource...
NSAppleScript script = new NSAppleScript( new String(
scriptData.bytes( 0, scriptData.length() ) ) );
NSMutableDictionary errors = new NSMutableDictionary();
script.execute( errors );
if( errors.count() > 0 ) {
NSSystem.log( errors.toString() );
}
HTH
--
Giorgio Valoti
-------------
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.