jEdit Community - Resources for users of the jEdit Text Editor
Execute menu item from macro?
Submitted by kwerle on Tuesday, 31 August, 2004 - 08:18
I have just written a very useful console command. It works just the way I want. Unfortunately, console doesn't seem to let you create shortcuts for commands you wrote (another issue). Is it possible for me to write a macro that will call a specific menu item?

I just want it to do something very simple:
executeMenuItem("Plugins.Console.MyCommand");

Is there such a thing, and I'm just not seeing it?

TIA
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
invoking action
by DanF on Wed, 01/09/2004 - 15:07
Hi,

AFAIK, all menu items have a corresponding action, so what you want to do is invoke the action.

An easy way to list all the actions available (so you can find out which one corresponds to the menu item you want) is by running the "Display Actions" macro. You can find it in the Macros menu, Misc, Display Actions.

I invoke an action inside a macro by doing this:
jEdit.getAction("name-of-action-I-want-to-invoke").invoke(view);
It works ok, but I have a feeling there might be a better way of doing this.
 
Display Actions macro new in 4.2
by kwerle on Wed, 01/09/2004 - 18:24
I'm still using 4.1. I'm one of those hold-outs that waits for official releases. I do wonder why 4.2 hasn't been released...

I'll look for the source and see if I can get it to run under 4.1.

[EDIT: GAH! They seem to have just released it. I'll give it a shot under 4.2]

Works great - thanks!
User login
Browse archives
« November 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   101634
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18601
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18031
R Edit Mode - extensive version   0.1   17481
Advanced HTML edit mode   1.0   16213
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15236
XP icons for jEdit   1.1   14300