• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Launching applescript from a Java environment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Launching applescript from a Java environment (From: "Karl Kennedy" <email@hidden>)

  • Prev by Date: Re: iCal Todo notes
  • Next by Date: Mail.app smtp server set password fails
  • Previous by thread: Re: Launching applescript from a Java environment
  • Next by thread: iCal Todo notes
  • Index(es):
    • Date
    • Thread