ActiveState Powered by ActiveState

ActiveState Community


Macro Access to the current document/file system

Posted by scunliffe on 2007-03-13 16:54
OS: All / Any

Hi all,

[Addition]

Apparently [F1] Help, evaded my search. My apologies for not checking there first, it is exactly what I needed. (ignore my request below)

Just discovered Komodo, and I'm quite keen to get coding in it (macros to start), XUL a bit later.

For now, I just wanted to know how/what I can access from javascript in my macros...

A link to docs/help/api is fine too... I just didn't find one.

Cheers,
steve

shanec | Wed, 2007-03-14 09:34

There is a small public API, which may be a good place to start, that is documented in the help that comes with Komodo.

Otherwise, the best documentation right now is the code itself, and examples people are placing on this support site or elsewhere. We're in process (over the next few point releases) of reorganizing much of the code base so that it will be parseable for documentation, with clear public APIs.

Many people will ask (in these forums or on our email lists) how to do something, and we'll try to provide small examples if possible.

From JavaScript, you have 100% access to any code in Komodo.

scunliffe | Wed, 2007-03-14 10:44

shanec, thanks for the info... I was a bit premature when I sent the original post, as I had not scoured the documentation fully yet.

Not sure if you can answer this, but I was wondering about abilities of Macros (in JavaScript)...

I can (and have) used alert(), confirm(), prompt() etc. to interact with the user, but the one thing I would really love... is to be able to provide "options".

e.g. If I could present a dialog, that gave choices:

+---------------------------+
|  List values by:          |
|     (*) Name              |
|     (_) ID                |
|     (_) Class             |
|     (_) Size              |
|                           |
|      [OK]  [Cancel]       |
+---------------------------+

I thought that I might be clever, and use window.open to launch a window... but I couldn't get that to work...

Is there a possible way to do this with some "higher" level access object (e.g. komodo, editor)

If not, I guess this is where I should consider switching to an extension rather than a macro?

TIA,
Steve

shanec | Wed, 2007-03-14 10:50

You're kind of hitting the place where you need to move to an extension rather than using the macro system. You could try to hack this somewhat, but and extension would be the right way to do it. With an extension, you can add a custom dialog.

-->