В AkelPad открыто несколько файлов, каждый в своей вкладке.
Есть Ява скрипт Script.js. Я могу его применить в AkelPad примерно так:
-"Скрипт" Call("Scripts::Main", 1, "Script.js")
Но это скрипт применится только к активной в данный момент вкладке.
А как его применить ко всем открытым в AkelPad файлам, не переходя из вкладки во вкладку вручную?
В операции "Поиск/Замена" такая возможность есть.
Применение скрипта ко всем вкладкам
- Author
- Message
-
Offline
- Posts: 14
- Joined: Thu Aug 16, 2012 6:52 pm
Спасибо, KDJ!
Насколько я понял, чтобы скрипты применялись ко всем вкладкам, эту часть нужно вставлять в каждый JS-скрипт. И вставлять нужно примерно так:
Запрос:
вероятно, можно исключить? Мне он мешает.
Насколько я понял, чтобы скрипты применялись ко всем вкладкам, эту часть нужно вставлять в каждый JS-скрипт. И вставлять нужно примерно так:
Code: Select all
var hMainWnd = AkelPad.GetMainWnd();
var lpFrameStart = AkelPad.SendMessage(hMainWnd, 1290 /*AKD_FRAMEFINDW*/, 1 /*FWF_CURRENT*/, 0);
var lpFrameCur = lpFrameStart;
if (lpFrameStart)
{
do
{
WScript.Echo("Edit file: " + AkelPad.GetEditFile(0));
-------------
КОД СКРИПТА
-------------
lpFrameCur = AkelPad.SendMessage(hMainWnd, 1290 /*AKD_FRAMEFINDW*/, 9 /*FWF_TABNEXT*/, lpFrameCur);
AkelPad.SendMessage(hMainWnd, 1285 /*AKD_FRAMEACTIVATE*/, 0, lpFrameCur);
}
while (lpFrameCur && (lpFrameCur != lpFrameStart))
}
Code: Select all
WScript.Echo("Edit file: " + AkelPad.GetEditFile(0));
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
vadim
New script can be useful: RunScriptOnEachTab.js.
New script can be useful: RunScriptOnEachTab.js.
-
Offline
- Posts: 366
- Joined: Mon Jan 10, 2011 5:28 pm
- Contact:
KDJ
Thank you. Would be great also to have not only command interface, buta visual also. Some text block (like one i am writing this post in). And some dropdown list-menu or something to select template from scripts available - "scriptname(|cursor|)" with insert button because we can call several scripts from command option of your script.
Maybe also check for line length if it is restricted somehow.
Thank you. Would be great also to have not only command interface, buta visual also. Some text block (like one i am writing this post in). And some dropdown list-menu or something to select template from scripts available - "scriptname(|cursor|)" with insert button because we can call several scripts from command option of your script.
Maybe also check for line length if it is restricted somehow.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Lenchik
This GUI already exists: runScript.js.
It is necessary to connect in some way both scripts.
I think it will be easier for Infocatcher to add in runScript.js the option of running on all tabs.
This GUI already exists: runScript.js.
It is necessary to connect in some way both scripts.
I think it will be easier for Infocatcher to add in runScript.js the option of running on all tabs.
-
Offline
- Posts: 14
- Joined: Thu Aug 16, 2012 6:52 pm
Ну! Так даже лучше, возможностей больше. Спасибо!KDJ wrote:vadim
New script can be useful: RunScriptOnEachTab.js.