Looking for AppleScript scripting documentation / dictionary

I’m currently working with Notes 6.5.4.1 on Mac OS X 10.4.10 and need some information on using AppleScript to script Notes. This version of Notes appears to be quite old and it doesn’t have a proper AppleScript dictionary (so it’s not self-documenting, as it were), but I found on the Lotus Sandbox site an example of scripting sending e-mail and iterating over e-mails. That works, but it doesn’t give any information about the nouns / verbs / properties available, so you basically can’t do anything but what’s in the example (in my case, I’m trying to script an export of the Corporate Directory in Notes). The example references the “Lotus Notes Programmer’s Guide” but there’s no such document on the Lotus/IBM site. I can’t find any sensible documentation on scripting Notes at all.

Subject: Looking for AppleScript scripting documentation / dictionary

You might try posting to the AppleScript list (hosted by Apple, not IBM):

http://www.lists.apple.com/mailman/listinfo/applescript-users

Subject: Looking for AppleScript scripting documentation / dictionary

Hi James

I stumbled across your post very, very late but if you are still interested in AppleScripting I have done a bit in the past with some success.

You need to view the AppleScript dictionary for Notes to see the classes and methods. Youll need to browse for the application but it is viewable.

Basically, the Notes implementation is a bridge to the LotusScript classes and methods so you need to structure your AppleScripts similar to a LotusScript agent.

hope that helps

Subject: Looking for AppleScript scripting documentation / dictionary

I don’t know much about Mac, and nothing about Applescript, but assuming that AppleScript accesses the Mac equivalent of COM, the documentation is in Domino Designer Help, under LotusScript/COM/OLE classes.

You could of course use LotusScript to do the export instead.

/Peter

Subject: RE: Looking for AppleScript scripting documentation / dictionary

I don’t have access to Domino Designer, and I’m not sure that LotusScript would work since it needs to be done automatically outside Notes (we can invoke Notes programmatically, but the process needs to be initiated on a schedule).

I have no idea how the Notes end of the equation is handled either – I can find no documentation on the subject. The normal way an application under OS X to handle such things is through the OSA messaging mechanism. Applications are generally inspectable for a dictionary of object classes, their methods, and properites (it’s called a dictionary) and then OSA (be it AppleScript, Python, Ruby, whatever) preps messages for the application per the dictionary.

Notes seems to be different. It has no dictionary, but responds to messages, but the responses rather than being objects are simply integers (I’m assuming a handle of some sort). It appears that they manually wrote their own interface to OSA rather than use the API provided by the OS. As a result, you can’t tell what the object classes and methods are (responses from Notes are untyped).

What I’ve tried so far is basing the script on LotusScript – using the same class names and methods in the calls. This works lots of the time, but many calls don’t work, and some of the classes returned by methods are different (but I can’t know what they are because there’s no dictionary and Notes returns integer handles rather than classes). If it simply presented a faithful abstraction of LotusScript, at least I could get somewhere.

Subject: RE: Looking for AppleScript scripting documentation / dictionary

James,

You can check this link

http://www-12.lotus.com/ldd/doc/domino_notes/6.5.1/help65_designer.nsf/Main?OpenFrameSet

for Designer documentation. If OS X allows you to create a NotesSession object (the root of the Notes object hierarchy) via automation, then you are on your way.

Here is a link directly to the NotesSession help page:

http://www-12.lotus.com/ldd/doc/domino_notes/6.5.1/help65_designer.nsf/f4b82fbb75e942a6852566ac0037f284/daab691001cdd4ab85256e00004ac4c6?OpenDocument

Subject: RE: Looking for AppleScript scripting documentation / dictionary

That’s very helpful, thanks. It doesn’t fully address the problem (for example, the two big issues seem to be that on the Mac they don’t necessarily use the same names for classes or implement all the classes, and they don’t use actual arrays).

But, it got me into looking at doing it in Java. I tried to make a very simple Java application to do it to, but got even less far:

package com.biib.ri.orgchart;

import lotus.domino.*;

public class NotesExport extends NotesThread {

public static void main(String[] args) {

	NotesExport exportThread = new NotesExport();

	exportThread.start();

}



public void runNotes() {

	try {

		Session notesSession = NotesFactory.createSession();

		String platform = notesSession.getPlatform();

		System.out.println("It worked!\nPlatform = " + platform);

	} catch (Exception e) {

		e.printStackTrace();

	}

}

}

I run it with DYLD_LIBRARY_PATH and LD_LIBRARY_PATH to include /Applications/Lotus\ Notes and run the Java application (Notes.jar in the class path) and I get:

NotesException: Could not load dll for system name Mac OS X

at lotus.domino.NotesThread.load(NotesThread.java:294)

at lotus.domino.NotesThread.checkLoaded(NotesThread.java:320)

at lotus.domino.NotesThread.initThread(NotesThread.java:147)

at lotus.domino.NotesThread.run(NotesThread.java:205)

Exception in thread “Thread-0” java.lang.UnsatisfiedLinkError: NnotesInitThread

at lotus.domino.NotesThread.NnotesInitThread(Native Method)

at lotus.domino.NotesThread.initThread(NotesThread.java:153)

at lotus.domino.NotesThread.run(NotesThread.java:205)

… so I’m running up against a wall there too. I’m going to try an post the Java problem to one of the other topic areas and see if I get a lead there.

Thanks for your help.