Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript + Mail (+ Java)




On Jan 13, 2006, at 11:59 AM, Shawn Erickson wrote:


I would use Launch Services API to get at this information via JNI and
not parse that file directly.

Before I get into the inevitable JNIDirect stuff I sort of tried to figure out how to parse this out of 
lsregister -dump
but failed to come up with a decent grep that showed what I thought it should. Theres another command besides lsregister I think that I've come across the might be in the archives in my past posts on it. (I might be mis-remembering and that might just be multiple URL references to lsregister)
Now the JNIDirect...
I have some Launch Services JNIDirect to do this. Basically for the functionality as I read this... 

Now, what you could do that would be *REALLY* spiffy would be to create a similar routine that took into account every stand-alone, AppleScriptable mailer for the Mac. 

I set up...

import macnative.jnidirect.ls.LSApp;

public class mailapps {

static { System.loadLibrary("ls"); }
public static void main(String[] args) {
LSApp lsapp = new LSApp();
String[] mailapps = lsapp.listUrlAcceptors("mailto:email@hidden",-1);
for (int i=0;i<mailapps.length;i++)
System.out.println(mailapps[i]);
}
}

(kLSRolesAll = -1)

which returns...

mini-black-box:~/devstuff/ls mjh$ java -cp .:jnidirect.jar:Linker.jar mailapps
/Applications/Mail.app

For the really curious I used JNIDirect to generate a strict JNI version (not JNIDirect no gcc or developer tools dependancy) at...

For the too curious, you can figure out why I only find Mail.app, I do have Eudora, not recently used but I moved it into /Applications to try and get a little more interesting output but it failed to find it. The LSApp code is a little lame in not using Launch Services to determine possible application locations. I was not and still am not sure of a Launch Services API for this. I just search /Applications and the user's /Applications. It should at least search nested directories which should of turned up Eudora.

Mike Hall        mikehall at spacestar dot net



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: AppleScript + Mail (+ Java) (From: Jeremy Wood <email@hidden>)
 >Re: AppleScript + Mail (+ Java) (From: email@hidden)
 >Re: AppleScript + Mail (+ Java) (From: Shawn Erickson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.