View Single Post
  #3  
Old 03-08-2018, 02:37 PM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Smile Re: Load sketch, choose position

Marten already gave a good answer.

If we look to the IKIT documentation for the SD-DEFINE-AVAILABLE-COMMAND we will find the following for the action:
Code:
:action {STRING or LISP-form} - the command action
gmatelich, you have been using a lisp form , which means it is a full defined lisp form with one or more pairs of round brackets ().

A string can be anything.

In the case of available command, the content of the :action will be put-buffered into the 'command line' (to say in with a kind of picture). Therefore the usage of oli:sd-put-puffer is not needed.

What is needed in your case Gmaetlich is that the dialog you are calling is getting interactive.

a) you can call a dialog capsualted within round brackets (CREATE_PART ... ) .. then everything has to be defined, so that he ok-action of the dialog can be performed.
(this one we call also a 'fully qualified' call)
b) you can call a dialog without the round brackets. then it will react as when typing one thing ofter the other into the command line.

for b) if we ommit parts of the command to make it complete, the 'put-buffered' dialog will get interactive and its UI (if any) will pop up

instead of
(AM_LOAD_SKETCH :FILENAME ......)
use
AM_LOAD_SKETCH :FILENAME ....
and it will get interactive (sketch attached to cursor and asking for a position)

since the action is a string in the latter case we need to escape the double quotes (as Marten did as well)

The following would be sufficient:
Code:
:action "AM_LOAD_SKETCH :FILENAME (format nil \"~A/VersionNeutral/Annotation/NotesCastMetal.mi\" (oli::sd-sys-getenv \"SDSITECUSTOMIZEDIR\"))"
-----------------------
Last but not least: the template browser is a very good thing. You can also figure out the tiny LSP file for one template , modify it, or copy and modify it to make use of envirnment variables.
Reply With Quote