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)




Michael:

Just judging from the behavior I saw when messing around with the Mail.app, the LSBundleIdentifier can have only one value at a time and there can only be one for the type "U:mailto". Basically, it records whatever the user has selected for use as their defauler mailer, not the mail capable apps they have on the machine.

Not sure if that is the answer to your question or not.

Martin Maher, Senior Network Security Engineer
The SSL RAS "Mac guy"
Security Operations - VPN/RAS
KP-IT, Information Security Management
desk: 925/926-3297
tie: 8-473-3297
cell: 925/324-8209
email@hidden



Michael Hall <email@hidden>
Sent by: java-dev-bounces+martin.maher=email@hidden

01/13/06 12:14 PM

To
Shawn Erickson <email@hidden>
cc
email@hidden, Martin Maher/CA/KAIPERM@Kaiperm
Subject
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...
http://www.spacestar.net/users/mikehall/ls.jar

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
http://www.spacestar.net/users/mikehall
http://sourceforge.net/projects/macnative


 _______________________________________________
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

 _______________________________________________
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: Michael Hall <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.