How to call this agent from script?

I want to call an agent, that has the following code:

@Command([Compose]; @MailDbName; “Bookmark”);

@Command([EditGotoField]; “Body”);

@Command([EditSelectAll]);

@Command([Clear]);

@Command([EditInsertFileAttachment]; “c:\LinkToDoc.NDL”);

@All

It’s triggered by “action menu selection”, with target “none”.

The file to attach has to be created prior to composing the bookmark-document, using some LS-code.

Calling the agent this way

Set YourAgent = db.Getagent(“CreateBookmarkWithNDL”)

Call YourAgent.Run

doesn’t give any errors, neither is a bookmark-form shown on the screen.

Any suggestions are welcome.

Subject: How to call this agent from script ?

Knud,

You are not going to see the form open on screen since you are using back-end LotusScript classes. Why not stick with formula language such as @Command([RunAgent]; “your agent name”) or @Command([ToolsRunMacro); “your agent name”) ?

Otherwise, write the code in LotusScript and have it create the doc behind the scenes.

Ken A Collins

Hoboken, NJ

Subject: How to call this agent from script ?

Thanks for your input.I forgot, that agent.run is a backend method, and have solved the problem by splitting the action into 2 calls:

@Command([ToolsRunMacro]; “CreateNDL”);

@Command([ToolsRunMacro]; “CreateBookmarkWithNDL”)

The first agent creates the file using LS-code, and the last one runs @-commands.

Subject: How to call this agent from script ?

Wehn you run an agent via Lotusscript, as you show in the latter part of your code, that agent runs as back-end Lotusscript. It can’t do user interface stuff like @Command calls. If you absolutely have to invoke this code from Lotusscript, as you imply, you’ll need to re-write the stuff in pure LS using NotesUIDocument and company.

HTH