AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Scripts plugin
Goto page Previous  1, 2, 3 ... , 69, 70, 71  Next
 
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6223

PostPosted: Wed Jun 01, 2016 6:25 pm    Post subject: Reply with quote

Добавлено: флаг ULT_LOCKSENDMESSAGE в метод AkelPad.ScriptNoMutex - вызовы AkelPad.SendMessage, AkelPad.Command блокируют поток скрипта (по умолчанию).
Добавлено: флаг ULT_UNLOCKSENDMESSAGE в метод AkelPad.ScriptNoMutex - вызовы AkelPad.SendMessage, AkelPad.Command не блокируют поток скрипта (медленнее).
Добавлено: флаг SH_GETLOCKSENDMESSAGE в метод AkelPad.ScriptHandle - блокировка потока скрипта вызовами AkelPad.SendMessage, AkelPad.Command.
Добавлено: флаг SH_GETEXECTYPE в метод AkelPad.ScriptHandle - получить код внешнего вызова скрипта.

Added: ULT_LOCKSENDMESSAGE flag in AkelPad.ScriptNoMutex method - AkelPad.SendMessage, AkelPad.Command called with script thread lock (by default).
Added: ULT_UNLOCKSENDMESSAGE flag in AkelPad.ScriptNoMutex method - AkelPad.SendMessage, AkelPad.Command called without script thread lock (slower).
Added: SH_GETLOCKSENDMESSAGE flag in AkelPad.ScriptHandle method - AkelPad.SendMessage, AkelPad.Command locks script thread.
Added: SH_GETEXECTYPE flag in AkelPad.ScriptHandle method - retrieve code of the external script call.


Scripts plugin v18.5


Last edited by Instructor on Sat Jun 04, 2016 8:26 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1919
Location: Poland

PostPosted: Fri Jun 03, 2016 7:35 pm    Post subject: Reply with quote

Instructor wrote:
KDJ wrote:
When I try to close any modified document (from the script), then displays message box "Document was modified. Do you want to save it?" and AkelPad hangs. On Win-XP sometimes, and on Win-7 always.
With Scripts v18.5. CloseDocument.js:
Code:
    if (LoWord(wParam) == 1000)
    {
      AkelPad.ScriptNoMutex(0x20 /*ULT_UNLOCKSENDMESSAGE*/);
      AkelPad.Command(4318 /*IDM_WINDOW_FRAMECLOSE*/);
      AkelPad.ScriptNoMutex(0x10 /*ULT_LOCKSENDMESSAGE*/);
    }

Thank you very much. In CloseDocument.js works properly.
Unfortunately in AkelPadManualSettings.js does not work. I don't know what is the cause.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6223

PostPosted: Sat Jun 04, 2016 7:12 am    Post subject: Reply with quote

KDJ
Code:
function SendMessage(hWnd, uMsg, wParam, lParam)
{
  //return oSys.Call("User32::SendMessageW", hWnd, uMsg, wParam, lParam);
  return AkelPad.SendMessage(hWnd, uMsg, wParam, lParam);
}
Scripts-Eng.txt wrote:
ULT_UNLOCKSENDMESSAGE AkelPad.SendMessage, AkelPad.Command called without script thread lock (slower).
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1919
Location: Poland

PostPosted: Sat Jun 04, 2016 11:56 am    Post subject: Reply with quote

Instructor
I tried different ways, but I hadn't thought of that. Thank you again.
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1919
Location: Poland

PostPosted: Sat Jun 04, 2016 8:39 pm    Post subject: Reply with quote

Instructor
In Scripts-Eng.txt I wanted to find "-100" and not found (using "Find" dialog).
Why not found, when I see that this string exists?
Because, the minus symbol is written as non-ASCII character ("\u2013").
These characters look identical (at monospace font):
"–" ("\u2013"),
"-" ("\u002D").
Can you correct it?
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6223

PostPosted: Sun Jun 05, 2016 10:29 am    Post subject: Reply with quote

KDJ
Done.
Back to top
View user's profile Send private message Send e-mail
Skif_off



Joined: 20 Oct 2013
Posts: 1096

PostPosted: Sun Aug 07, 2016 12:42 pm    Post subject: Reply with quote

Пытаюсь запустить SessionMenu.js, строка меню:
Code:
-"Показать меню с файлами сессии(й)" Call("Scripts::Main", 1, "SessionMenu.js", `-p=1, -b="!", -sm=2`)

Получаю ошибку:
Code:
Скрипт:   *\AkelFiles\Plugs\Scripts\SessionMenu.js
Строка:   53
Символ:   1
Ошибка:   Синтаксическая ошибка
Код:   800A03EA
Источник:   Ошибка выполнения Microsoft JScript

Если в строке 53 взять значение по умолчанию в кавычки - не вылетает. Получается, проблема с типом данных (строка vs. число), но только с "-p", а вот "-sm" получается без ошибок.

Баг плагина?
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6223

PostPosted: Mon Aug 08, 2016 5:26 am    Post subject: Reply with quote

Skif_off
Quote:
-"Показать меню с файлами сессии(й)" Call("Scripts::Main", 1, "SessionMenu.js", `-p=1, -b="!", -sm=2`)
Back to top
View user's profile Send private message Send e-mail
Skif_off



Joined: 20 Oct 2013
Posts: 1096

PostPosted: Mon Aug 08, 2016 12:18 pm    Post subject: Reply with quote

Instructor
Спасибо, теперь пытаюсь понять, о чём я думал, когда поставил запятые, - и не могу Smile))
Back to top
View user's profile Send private message
Powered



Joined: 26 Aug 2016
Posts: 2

PostPosted: Fri Aug 26, 2016 10:48 am    Post subject: Reply with quote

Непонятная ошибка при попытке в скрипте создать объект AkelPad.document. В скрипте всего одна эта строчка. Scripts.dll зарегистрирована. В чём проблема?
Code:

var AkelPad = new ActiveXObject("AkelPad.document");

Code:

---------------------------
Scripts плагин
---------------------------
Скрипт:   D:\PROG\TOOLS\AkelPad\AkelFiles\Plugs\Scripts\MCode.js
Строка:   1
Символ:   1
Ошибка:   
Код:   80010105
Источник:   

AkelPad 4.9.8 x86. ОС Win10 x64.
Back to top
View user's profile Send private message
Powered



Joined: 26 Aug 2016
Posts: 2

PostPosted: Fri Aug 26, 2016 11:21 am    Post subject: Reply with quote

Отбой, это я в двух соснах запутался. Не сообразил, что объект уже изначально есть в скриптах, выполняемых из AkelPad'a.
Back to top
View user's profile Send private message
r0n



Joined: 14 Jun 2014
Posts: 22

PostPosted: Fri Nov 04, 2016 4:28 pm    Post subject: List of messages send by AkelPad (EOD_ / AKDN_ / ...) Reply with quote

Is there a list of of messages which can be used when scripting in akelpad?

Examples:
#define EOD_SUCCESS 0 //Success.
#define EOD_ADT_OPEN EDT_OPEN //See EDT_OPEN.
...
...
#define AKDN_MAIN_ONSTART (WM_USER + 1) //0x401
#define AKDN_MAIN_ONSTART_PRESHOW (WM_USER + 2) //0x402

I got the above from:
https://github.com/Fr0sT-Brutal/AkelPad_AkelDefs/blob/master/AkelDLL.h

But I do not know if they are still valid (it's from 2014)?
At this moment I am using which seem to work:

#define AKDN_FRAME_ACTIVATE (WM_USER + 22) //0x416
#define AKDN_OPENDOCUMENT_FINISH (WM_USER + 54) //0x436
#define AKDN_SAVEDOCUMENT_FINISH (WM_USER + 56) //0x438
#define AKDN_EDIT_ONCLOSE (WM_USER + 13) //0x40D
#define AKDN_EDIT_ONFINISH (WM_USER + 12) //0x40C

I also looked in under "Scripts" in the plugin help:
Scipts >> Scripting Akelpad >> Windows Message >> SendMessage
At the top of that page ('SendMessage'), there is a blue link 'Windows® message' which displays a lot of windows messages.

I am not a C/C++ programmer but I managed to use some messages to trigger code in a dialog which I created in another application.
Back to top
View user's profile Send private message
Skif_off



Joined: 20 Oct 2013
Posts: 1096

PostPosted: Fri Nov 04, 2016 5:10 pm    Post subject: Reply with quote

r0n
Sources (current 4.9.8 ): AkelPad-4.9.8-src.zip/AkelFiles/Plugs/AkelDLL/AkelDLL.h
Or in SVN-repository.


Last edited by Skif_off on Fri Nov 04, 2016 5:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
r0n



Joined: 14 Jun 2014
Posts: 22

PostPosted: Fri Nov 04, 2016 5:11 pm    Post subject: Reply with quote

@Skif_off

Thank you!
Back to top
View user's profile Send private message
F. Phoenix



Joined: 24 Dec 2011
Posts: 175

PostPosted: Sun Nov 20, 2016 6:57 am    Post subject: Reply with quote

Можно сделать как-то чтоб отладка скриптов работала только для вызова скриптов из диалога плагина, но не AkelPad.Call(...)?
Или хотя бы отдельную кнопку что ли сделайте для разовой отладки в альтернативу флажку. Очень неудобно.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins All times are GMT
Goto page Previous  1, 2, 3 ... , 69, 70, 71  Next
Page 70 of 71

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group