Я изменяю скриптом AkelPad.ini
Подскажите можно тут же подгрузить настройки
Posted: Mon Aug 06, 2012 5:53 pm
by FeyFre
Andrey_A_A, низя.
Posted: Mon Aug 06, 2012 8:01 pm
by Andrey_A_A
FeyFre wrote:Andrey_A_A, низя.
А локально, к примеру есть задача быстро подгружать несколько наборов левых и правых символов для правильности отображения Url - секции UrlLeftDelimiters и UrlRightDelimiters
или совсем низя)
Posted: Mon Aug 06, 2012 8:21 pm
by FeyFre
Andrey_A_A, AkelPad.SendMessage + AKD_SETFRAMEINFO + FIS_URLLEFTDELIMITERS/FIS_URLRIGHTDELIMITERS. См. AkelDll.h
Posted: Mon Aug 06, 2012 8:56 pm
by KDJ
Andrey_A_A
See also:
in AkelEdit.h:
AEM_GETURLLEFTDELIMITERS
AEM_SETURLLEFTDELIMITERS
in AkelDLL.h:
AKD_GETFRAMEINFO
FI_URLLEFTDELIMITERS
Script example: ResetUrlDelimiters.js
Posted: Tue Aug 07, 2012 1:41 pm
by DV
Упаковка текущего файла в zip-архив средствами JScript... ToDo: использование классов?
var isFileSaved;
var sCurrentFilePath;
var sZipFilePath;
isFileSaved = false;
sCurrentFilePath = AkelPad.GetEditFile(0);
if (sCurrentFilePath)
{
if (!AkelPad.GetEditModified(0))
isFileSaved = true;
}
if (!isFileSaved)
{
WScript.Echo("File is not saved. Please save the file first!");
WScript.Quit();
}
sZipFilePath = getZipFilePath();
if (!zip_create(sZipFilePath))
{
WScript.Echo("Failed to create the archive :(");
WScript.Quit();
}
if (!zip_add_file(sZipFilePath, sCurrentFilePath))
{
WScript.Echo("Failed to add the file to the archive :(");
WScript.Quit();
}
WScript.Echo("Archive created!\n" + sZipFilePath);
function getZipFilePath()
{
var sZipFileDir = getFileDir(sCurrentFilePath);
var sZipFileName = getFileName(sCurrentFilePath);
var s = sZipFileDir + "\\" + sZipFileName + ".zip";
return s;
}
function zip_create(sZipFilePath)
{
var isOK = false;
// Creating an empty .zip archive
try
{
var oFileSystem = new ActiveXObject("Scripting.FileSystemObject");
var oZipFile = oFileSystem.OpenTextFile(sZipFilePath, 2, true);
var data = String.fromCharCode(80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
oZipFile.Write(data);
oZipFile.Close();
isOK = true;
}
catch (err)
{
// ...
}
return isOK;
}
function zip_add_file(sZipFilePath, sFilePath)
{
var isOK = false;
// Packing the data
try
{
var oShell = new ActiveXObject("Shell.Application");
var oDstFolder = oShell.NameSpace(sZipFilePath);
oDstFolder.CopyHere(sFilePath, 16);
//WScript.Sleep(1000);
isOK = true;
}
catch (err)
{
// ...
}
return isOK;
}
function zip_add_folder(sZipFilePath, sFolderPath)
{
var isOK = false;
// Packing the data
try
{
var oShell = new ActiveXObject("Shell.Application");
var oDstFolder = oShell.NameSpace(sZipFilePath);
var oSrcFolder = oShell.NameSpace(sFolderPath);
var oFolderItems = oSrcFolder.Items();
oDstFolder.CopyHere(oFolderItems.Item(), 16);
//WScript.Sleep(1000);
isOK = true;
}
catch (err)
{
// ...
}
return isOK;
}
function getFileExt(filePathName) // file extension w/o leading '.'
{
var n = filePathName.lastIndexOf(".");
return (n >= 0) ? filePathName.substr(n + 1) : "";
}
function getFileName(filePathName) // file name w/o extension
{
var n2 = filePathName.lastIndexOf(".");
var n1 = filePathName.lastIndexOf("\\");
var nn = filePathName.lastIndexOf("/");
if (nn > n1) n1 = nn;
var s = "";
if (n1 < 0 && n2 < 0)
s = filePathName;
else if (n1 < 0)
s = filePathName.substr(0, n2);
else if (n2 < 0)
s = filePathName.substr(n1 + 1);
else if (n2 > n1)
s = filePathName.substr(n1 + 1, n2 - n1 - 1);
return s;
}
function getFileDir(filePathName) // file directory w/o trailing '\'
{
var n = filePathName.lastIndexOf("\\");
var nn = filePathName.lastIndexOf("/");
if (nn > n) n = nn;
return (n >= 0) ? filePathName.substr(0, n) : filePathName;
}
Posted: Wed Aug 08, 2012 8:53 am
by VladSh
DV
Не знал, что такое возможно. Здорово!
Если бы вывести список всех открытых файлов, поставить галки и запаковать выбранные, то вообще был бы яд!
А ещё лучше в аргументах передавать скрипту: текущий или выбор.
Posted: Thu Aug 09, 2012 8:24 pm
by KDJ
How to create Richedit control in ActiveX?
In the following script is not working:
The original specification for rich edit controls is Microsoft Rich Edit 1.0; the current specification is Microsoft Rich Edit 4.1. Each version of rich edit is a superset of the preceding one, except that only Asian builds of Microsoft Rich Edit 1.0 have a vertical text option. Before creating a rich edit control, you should call the LoadLibrary function to verify which version of Microsoft Rich Edit is installed.
And there is an table of versions of RichEdit functionality.
Rich Edit version DLL Window Class
1.0 Riched32.dll RICHEDIT_CLASS
2.0 Riched20.dll RICHEDIT_CLASS
3.0 Riched20.dll RICHEDIT_CLASS
4.1 Msftedit.dll MSFTEDIT_CLASS
Where:
RICHEDIT_CLASS for v1.0 is "RICHEDIT" (only ANSI version)
RICHEDIT_CLASS for v2.0 & v3.0 is "RichEdit20" +"A"/"W"
MSFTEDIT_CLASS for v4.1 is "RICHEDIT50W" (only UCS2 version)
(This constants are define in Richedit.h header file in Platform SDK)
So solution for you is probably:
Insert this snippet before first reference to RichEdit control(on the very beginning of script is not bad choice):
NB: It is essential You not to forget about this last snippet especially when script execution can be terminated, in order to prevent resource leak.(Since module was manually loaded it must be manually unloaded).
PS: By the way, You completely forgot about error checking facility which can explain most of "Why this does not works?":
FeyFre
Thank you very much for your extensive explanation about RichEdit. Now I understand almost everything.
AkelPad does not use Riched20.dll library.
1. To create AkelEdit control in AkelPad, you can use the class name AkelEditA/W or RichEdit20A/W.
2. To create original RichEdit control in AkelPad, you must load Riched32.dll (Msftedit.dll) library and create a window with class name RICHEDIT (RICHEDIT50W).
3. To create RichEdit in ActiveX, you must load Riched32.dll (Riched20.dll, Msftedit.dll) and create a window with class name RICHEDIT (RichEdit20A/W, RICHEDIT50W).
4. Question, how to create AkelEdit control in ActiveX?
Posted: Fri Aug 17, 2012 3:23 pm
by KDJ
Instructor
Is it possible to use AkelEdit control in ActiveX?
Posted: Fri Aug 17, 2012 4:11 pm
by Instructor
KDJ
Yes, if you compile AkelEdit.dll from sources and load library as you did with Riched20.dll.
Posted: Fri Aug 17, 2012 7:05 pm
by FeyFre
Oh. Now I understood what KDJ means by "In ActiveX". It does not equals to my(probably more canonical) definition of ActiveX.
Posted: Sat Aug 18, 2012 12:56 pm
by KDJ
Instructor wrote:Yes, if you compile AkelEdit.dll from sources and load library as you did with Riched20.dll.
I have no means to compile AkelEdit source.
Can you compile AkelEdit and put AkelEdit.dll on download page (or put it in Scripts.zip)?.
It will then be available to everyone.
Thank you very much.