Надо бы Coder::HighLight.Scripts-Rus.txt wrote:AkelPad.IsPluginRunning
_______________________
...
Пример:
var bRunning=AkelPad.IsPluginRunning("HighLight::Main");
Scripts plugin
- Author
- Message
-
Offline
- Posts: 3217
- Joined: Wed Nov 29, 2006 1:19 pm
- Location: Киев, Русь
- Contact:
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
In this example it is necessary. OpenSaveMask.js uses WindowSubClass without WindowGetMessage.KDJ wrote:Instructor wrote:Changed: message loop not necessary for subclassing.Maybe this should be removed from the example.Scripts-Eng.txt wrote:AkelPad.WindowSubClass (+ActiveX)
...
Example:
...
//Message loop
AkelPad.WindowGetMessage();
VladSh
Поправлено.
-
Offline
- Posts: 670
- Joined: Thu Jun 03, 2010 8:47 am
- Location: Сочи, Хоста
- Contact:
Подскажите почему код (vbs)
если запустить не в AkelPad, то работает, т.е если отменяешь выбор папки, то происходит выход WScript.Quit
Если запускать этот код в AkelPad, то Err.Number не срабатывает
пробовал по разному
не происходит выхода... раньше работало
Code: Select all
On Error Resume Next
Folder = CreateObject("Shell.Application").BrowseForFolder(0, "Выбор папки", 0, "").Self.Path
If Err.Number <> 0 Then WScript.Quit
MsgBox "Переменная Folder =" & vbNewLine & "<" & Folder & ">"
Если запускать этот код в AkelPad, то Err.Number не срабатывает
пробовал по разному
Code: Select all
If Err.Number <> 0 Or Len(Folder) = 0 Or Folder=vbNullChar Or Folder = "" Then WScript.Quit
Last edited by Andrey_A_A on Wed Dec 24, 2014 9:05 am, edited 1 time in total.
-
Offline
- Posts: 670
- Joined: Thu Jun 03, 2010 8:47 am
- Location: Сочи, Хоста
- Contact:
Ещё одно: Если в конце пути каталога есть слеш \ , то функция GetFilePath не выдаёт родительский путь.
Code: Select all
pFile = "D:\TC IMAGE\AkelFiles\Plugs\Scripts\Include\"
Path = AkelPad.GetFilePath(pFile, 1)
MsgBox "Переменная Path =" & vbNewLine & "<" & Path & ">"
Path = CreateObject("Scripting.FileSystemObject").GetParentFolderName(pFile) ' родительский путь
MsgBox "Переменная Path =" & vbNewLine & "<" & Path & ">"
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
Not reproduced. Any example code?KDJ wrote:It seems to me that in x64 version, AkelPad.SetEditWnd method works incorrectly.
При наличии данной строки WScript.Quit игнорируется, т.к. сейчас WScript.Quit это послание серверу сценариев специального кода возврата SCRIPT_E_PROPAGATE, который говорит серверу выйти минуя OnScriptError. Однако строка "On Error Resume Next" блокирует выход. В новой версии плагина эта ситуация учтена.Andrey_A_A wrote:Подскажите почему код (vbs)Code: Select all
On Error Resume Next ...
Andrey_A_A wrote:Ещё одно: Если в конце пути каталога есть слеш \ , то функция GetFilePath не выдаёт родительский путь.
CPF_DIR для "D:\TC IMAGE\AkelFiles\Plugs\Scripts\Include" корректно выдаёт "D:\TC IMAGE\AkelFiles\Plugs\Scripts\Include".Scripts-Rus.txt wrote:AkelPad.GetFilePath (+ActiveX)
______________________________
Получить часть пути файла.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Examples are in the scripts TextMarker.js and RunCommand.js, functions GetTextAE() and ReplaceTextAE().Instructor wrote:Not reproduced. Any example code?KDJ wrote:It seems to me that in x64 version, AkelPad.SetEditWnd method works incorrectly.
TextMarker.js generates sometimes an error reported by Skif_off here: viewtopic.php?p=27149#p27149
If you run RunCommand.js, next press "CMD ?" button and choose command from the list, it replaces all text in AkelPad edit window instead of in edit window of the script.
-
Offline
- Posts: 1862
- Joined: Mon Aug 06, 2007 1:07 pm
- Contact:
Если скрыть дополнительные столбцы в списке скриптов, пункт «Открыть сайт» в контекстном меню остается, но заблокирован.
И еще с дополнительными столбцами притормаживает при первом открытии.
Тут бы или кэширование какое, или сперва список показать, а уже потом в отдельном потоке тянуть дополнительные данные из файлов.
И еще с дополнительными столбцами притормаживает при первом открытии.
Тут бы или кэширование какое, или сперва список показать, а уже потом в отдельном потоке тянуть дополнительные данные из файлов.
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
KDJ
Not reproduced, but guess I now what happens.
In currently developed Scripts plugin 6.0 implemented support for __int64 values (JScript and VBScript don't have native support for 8-byte integers). Scripts uses the next algorithm: if number larger then 0xFFFFFFFF, number converted to string and first character in this string is NULL. For example, 123 -> "\x00123". Therefore incrementing pointer must be done with _PtrAdd (see example scripts in current development version).
I have uploaded two versions. First to debug your scripts. It will convert number to string if number larger then 0xFFFF (it is almost any pointer). When scripts after editing starts running without errors/crashes, you can try current development version.
Not reproduced, but guess I now what happens.
In currently developed Scripts plugin 6.0 implemented support for __int64 values (JScript and VBScript don't have native support for 8-byte integers). Scripts uses the next algorithm: if number larger then 0xFFFFFFFF, number converted to string and first character in this string is NULL. For example, 123 -> "\x00123". Therefore incrementing pointer must be done with _PtrAdd (see example scripts in current development version).
I have uploaded two versions. First to debug your scripts. It will convert number to string if number larger then 0xFFFF (it is almost any pointer). When scripts after editing starts running without errors/crashes, you can try current development version.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Instructor
Unfortunately, this did not help. I think there is an error in SetEditWnd method.
Try simple test script:
This script works correctly in the following configurations:
- AkelPad 4.9.0 x86, WinXP x86,
- AkelPad 4.9.1 x86, WinXP x86,
- AkelPad 4.9.0 x86, Win7 x64,
- AkelPad 4.9.1 x86, Win7 x64,
- AkelPad 4.9.0 x64, Win7 x64.
Does not work correctly in:
- AkelPad 4.9.1 x64, Win7 x64 (text is added in AkelPad edit window instead of "my edit window").
Unfortunately, this did not help. I think there is an error in SetEditWnd method.
Try simple test script:
This script works correctly in the following configurations:
- AkelPad 4.9.0 x86, WinXP x86,
- AkelPad 4.9.1 x86, WinXP x86,
- AkelPad 4.9.0 x86, Win7 x64,
- AkelPad 4.9.1 x86, Win7 x64,
- AkelPad 4.9.0 x64, Win7 x64.
Does not work correctly in:
- AkelPad 4.9.1 x64, Win7 x64 (text is added in AkelPad edit window instead of "my edit window").
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Instructor
Furthermore I noticed that IsAkelEdit method returns an incorrect value (Scripts v.15.9 and 16.0 x64).
For my window created as "AkelEditW" (hMyEdit):
AkelPad.IsAkelEdit(hMyEdit) -> 0.
For AkelPad edit window also:
AkelPad.IsAkelEdit(AkelPad.GetEditWnd()) -> 0.
This can be a cause that SetEditWnd method not working properly.
In Scripts v15.8 x64 everything worked fine.
Furthermore I noticed that IsAkelEdit method returns an incorrect value (Scripts v.15.9 and 16.0 x64).
For my window created as "AkelEditW" (hMyEdit):
AkelPad.IsAkelEdit(hMyEdit) -> 0.
For AkelPad edit window also:
AkelPad.IsAkelEdit(AkelPad.GetEditWnd()) -> 0.
This can be a cause that SetEditWnd method not working properly.
In Scripts v15.8 x64 everything worked fine.
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
Not tested, but I think this is it.KDJ wrote:For my window created as "AkelEditW" (hMyEdit):
AkelPad.IsAkelEdit(hMyEdit) -> 0.